Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replacing values from SPARQL based constraints in the sh:message #117

Open
Dragos0000 opened this issue Jan 25, 2022 · 1 comment
Open

Comments

@Dragos0000
Copy link

Example of SHACL shape with SPARQL query

    rdf:type sh:SPARQLConstraint ;
    rdfs:label "skos-xl pref label in the same language " ;
    sh:message "multiple skos-xl preferred label for language \"{$lang}\"" ;
    sh:prefixes <http://publications.europa.eu/ontology/skosShapes> ;
    sh:select """prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix skosxl: <http://www.w3.org/2008/05/skos-xl#>
SELECT $this ?lang (skosxl:prefLabel as ?path) (?l1f as ?value)
WHERE {
    $this skosxl:prefLabel ?l1 .
  ?l1 skosxl:literalForm ?l1f .
  $this skosxl:prefLabel ?l2 .
  ?l2 skosxl:literalForm ?l2f .
  FILTER ( ?l1 != ?l2 && lang(?l1f) = lang(?l2f) )
  BIND (lang(?l1f) as ?lang)
}

Expected Behavior

Would expect the variable {$lang} to be replaced in the sh:message from the SPARQL query.
ex: multiple skos-xl preferred label for language "en"

Actual Behavior

In the validation process will get "multiple skos-xl preferred label for language "{$lang}"" message. The variable lang is not being replaced.

Is this supported or will be supported ?

@jimkont
Copy link
Member

jimkont commented Mar 15, 2022

Hi @Dragos0000 I remember that the variable replacement was not fully implemented on the sparql constraints. The shacl core variables should be working fine though. Need to find some time and debug this but cannot guarantee how soon this can be implemented unless someone else is willing to take a look. Would be happy to guide in the later case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants