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

Wrong report about a SPARQLTarget #14

Open
VladimirAlexiev opened this issue Dec 10, 2024 · 1 comment
Open

Wrong report about a SPARQLTarget #14

VladimirAlexiev opened this issue Dec 10, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@VladimirAlexiev
Copy link

When validating electrical CIM Advanced SHACL shapes with SPARQLTarget:

You see this error

Using the values of sh:prefixes as defined by 5.2.1 Prefix Declarations for SPARQL Queries, the values of sh:select must be valid SPARQL 1.1 SELECT queries with a single result variable this
Value:

SELECT DISTINCT ?this WHERE { 
  ?this rdf:type cim:PowerTransformer . 
  FILTER NOT EXISTS {?this ^cim:PowerTransformerEnd.PowerTransformer/cim:TransformerEnd.endNumber 3}. }

There is no info to identify the shape, but only this one matches the query:

equ:PowerTransformer-twoWinding
        a               sh:NodeShape ;
        sh:property     equ:PowerTransformerEnd-secondWindingValues ;
        sh:target  
        [
              a sh:SPARQLTarget ;
              sh:prefixes cim: ;
              sh:select """
                SELECT DISTINCT ?this
                WHERE {
                  ?this rdf:type cim:PowerTransformer   .
                  FILTER NOT EXISTS {?this ^cim:PowerTransformerEnd.PowerTransformer/cim:TransformerEnd.endNumber 3}.
                }
                """ ;
        ] .      

This SPARQL query is valid, and the prefix used is declared at the beginning of the file:

cim:    
    a           owl:Ontology ;
    owl:imports sh: ;
    sh:declare [
        a sh:PrefixDeclaration ;
        sh:namespace "http://iec.ch/TC57/CIM100#"^^xsd:anyURI ;
        sh:prefix "cim" ;
    ] ;
@costas80
Copy link
Contributor

Thanks for raising this @VladimirAlexiev. I'll try to replicate this to see why the finding was reported and to improve the validator's feedback.

@costas80 costas80 added the bug Something isn't working label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants