Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
So, very new to all this... but have a question.
Is it possible to define an owl:imports in a shape file to pull in previously defined shapes from another file? Ref https://github.com/ESIPFed/science-on-schema.org/blob/master/tools/sospy/shapegraphs/reqrec.ttl
I'm looking at https://book.validatingrdf.com/bookHtml011.html section 5.4 for inspiration.
Note: Maybe I'm being too cute trying to import from a github raw URL?
I get a proper violation from the recomended.ttl file, but I can not import it and use it. I don't know if this is not possible or (more likely) I'm doing it wrong.
Firstly, there is nothing technically wrong with what you are doing. The
However there a couple of reasons it isn't working for you in this case.
PyShacl has an optional argument that instructs the validator to run an OWL2 reasoning/inferencing graph-expander on the Data-Graph prior to validating, but that doesn't apply to the Shapes Graph. And even if it did, the OWL2 library we use (OWL-RL) has a no-imports policy so it wouldn't work anyway.
So why do they use
We have certainly discussed the pros and cons of including such a feature in pyShacl. And your creation of this issue will reignite that conversation. There is a chance it will be added in the future, but it will be post-1.0.
Thanks for taking the time for that very detailed and very helpful post! Much appreciated!
I'll keep watching to see any further development and for now will just return to the concept of keeping my shape graphs as self contained files. Or I can just break them up and do run multiple runs of pyshacl for the various sets of shapes to test, like required, recommended, etc. etc.
To give you some context to all this. Several of us are working on schema.org based metadata for various data facilities and some government agencies. One issue though is that some of the tooling is a bit lacking. (I'm looking at you, Google Structured Data Testing Tool) So a thought has been to define the shapes we are after and essentially do a sort of "test driven development" pattern from software land. This also lets us ensure that extensions to schema.org, which we need, can be checked since SDTT just throughs them as errors.
I'm curious to give this a try and this is the start of all that.
Some caveats (as much for me to document it somewhere, as it is potentially informational for you):