0

I am trying to validate a data graph against a shapes graph using pyshacl, which is a Python library for working with SHACL. I have the data graph stored as a '.ttl' file in my system, which I have imported for validation. However, I need to develop the shapes graph on my own. Can anyone suggest how to develop a SHACL-SPARQL shapes graph in Python? I went through the documentation of rdflib, but to my understanding, it provides only the capability to add the triples and query them. However, I could not find anything related to creating SHACL-SPARQL shapes graph, which needs a combination of triples as well as SPARQL query.

Thanks.

2
  • 1
    any SHACL shape is just a set of RDF triples, thus, creating those via rdflib should be nothing more than adding triples to a graph. And a SPARQL query in a SHACL shape is nothing more than an RDF literal containing the SPARQL query string. Sep 27 at 8:25
  • Thanks, @UninformedUser, for the clarification. Sep 29 at 23:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.