Code Monkey home page Code Monkey logo

Comments (4)

ashleysommer avatar ashleysommer commented on June 12, 2024

Ok, after some digging it seems this error is actually coming from the SHACL ontology file here: https://www.w3.org/ns/shacl.ttl

Normally that file is used in concept.. it is listed as a prefix at the top of every SHACL shape file, but its normally not imported.

However in this case,

  1. Schema.org Shapes file owl:imports DASH shapes file
  2. DASH Shapes file owl:imports shacl.ttl
  3. shacl.ttl (on line 15) creates a sh:declare node, with sh:namespace being a string literal, not an xsd:anyURI
  4. DASH Shapes file owl:imports TOSH Shapes file
  5. TOSH Shapes file declares a SPARQLFunction that references prefixes, including the broken sh prefix declaration from shacl.ttl
  • This results in this ConstraintLoad error showing.

So its definitely a bug in the shacl.ttl file
I went to report the issue, but someone else actually recently found the same error:
w3c/data-shapes#125

Looks like the bug is not able to be fixed in shacl.ttl for historical reasons, so I will have to put a workaround in PySHACL.

from pyshacl.

ashleysommer avatar ashleysommer commented on June 12, 2024

@James-Hudson3010 A fix for this is in PySHACL v0.13.2

from pyshacl.

James-Hudson3010 avatar James-Hudson3010 commented on June 12, 2024

Confirmed. (I am curious why it seemed to work with the pySHACL CLI tool)

from pyshacl.

ashleysommer avatar ashleysommer commented on June 12, 2024

Its because you didn't enable advanced mode, or owl imports on the cli invocation.
The error is introduced from the SHACL Ontology file, which is imported from the DASH Shapes file, which is only imported if you have owl imports enabled. (--imports in the cli tool).
Secondly, the error is triggered by a SPARQLFunction, those are only used when Advanced Mode is enabled (-a in the cli tool).

So it would've shown the same error if you executed the CLI tool like this:

pyshacl -s ./schema_org_validation.ttl -a --imports ./test_data.ttl

from pyshacl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.