Open henrieglesorotos opened 1 week ago
@henrieglesorotos Thanks for the bug report.
I haven't yet looked into exactly what is causing the issue in load_from_source
, however a quick workaround would be to manually specify the data graph format and shapes graph format to the validate
command, like this:
validate(PATH_1_NT, shacl_graph=PATH_2_TTL, allow_warnings=self.allow_warnings, debug=self.debug, data_graph_format="ntriples", shacl_graph_format="turtle")
That will allow PySHACL to not need to try to guess which format each graph is before parsing it. (Though it definitely should be able to do that by the filename, so I think there is still a bug).
Unrelatedly:
Note I have to use 0.28.1 as I am on rdflib 7.0.
Curious, is there something in the rdflib 7.1 release that's preventing you from upgrading?
Thanks @ashleysommer
I was getting the same error by specifying data_graph_format
kwarg. However, I didn't realise that shacl_graph_format
was a thing! I can try that.
For now I am just loading the graphs into mem using rdflib.
In terms of what's preventing me from upgrading - it's just the effort involved in bumping on a couple of internal deps we have. Nothing major.
Thanks @ashleysommer
I was getting the same error by specifying
data_graph_format
kwarg. However, I didn't realise thatshacl_graph_format
was a thing! I can try that.
All of the available arguments to use for validate()
are listed in the README file, under Python Module Use.
Specifically those for the data_graph_format
and shacl_graph_format
are under the heading "Some other optional keywords".
I am validating a graph at a .nt filepath, but using a .ttl set of shapes.
validate(PATH_1_NT, shacl_graph=PATH_2_TTL, allow_warnings=self.allow_warnings, debug=self.debug)
I tried to decipher what was going on in the
load_from_source
, but thought it would be quicker asking here.Using python 3.10.
poetry show pyshacl
Note I have to use 0.28.1 as I am on rdflib 7.0.