Closed AJAY31797 closed 9 months ago
Hi @AJAY31797 This is an RDFLib basic use question, not related the usage of PySHACL, so should not be in the PySHACL issue tracker.
However, to answer your question, please see the examples in this repo for how to parse literal ttl strings into an RDFLib graph. Eg, https://github.com/RDFLib/pySHACL/blob/master/examples/two_file_example.py
Also all of the files under test/issues/
will contain lots of ways of using RDFLib to drive PySHACL. Eg: https://github.com/RDFLib/pySHACL/tree/master/test/issues
Hi @ashleysommer, Thanks a lot for your response.
Best Regards, Ajay
Hi,
I am trying to validate a data graph against a shapes graph using pySHACL. I have the data graph exported from the IFCtoLBD converter, 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. I am unsure how to generate a SHACL-SPARQL shape graph in the RDFLib. I want to generate the graph in the Turtle format. Can anyone suggest how to do it? 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 a SHACL-SPARQL shapes graph, which needs a combination of triples as well as SPARQL query. Can we simply write the graph within triple quotation marks and serialize it as 'ttl'? I am new to RDFLib. Any help is much appreciated.
Thanks.