Closed DylanVanAssche closed 5 months ago
Done in pyoxigraph 0.4.0-alpha.5: https://pyoxigraph.readthedocs.io/en/latest/model.html#pyoxigraph.Dataset.canonicalize
Thanks @Tpt !
If I understand it correctly, I can now do the same as with RDFLib to compare 2 graphs:
canonicalize
on the Store==
to compare both graph stores?@DylanVanAssche Yes, except you need to use the Dataset
class and not the Store
class
@Tpt Thanks!
Dataset
does not have a load
statement to read from a file. Or do I look at it in the wrong way?
@DylanVanAssche Indeed. But you can do Dataset(load(path"my_file.txt"))
Ah amazing! Thanks!
Is your feature request related to a problem? Please describe.
I'm part of the W3C Community Group on Knowledge Graph Construction. We are having a Challenge at ESWC 2024 conference where participants with their RML engine can compete in compliance with the new RML modules. One of them is RML-Star for generating RDF-Star. We provide a tool to run the test-cases of each module and compare the output with what is expected. However, I got stuck with RML-Star with RDFLib which led me to search for an alternative here.
Describe the solution you'd like
Pyoxigraph can read 2 graphs, but does not expose the option to make them isomorph before checking their equality. Exposing isomorphism to pyoxigraph would be amazing because oxigraph can already do it with
Graph
andDataset
.Describe alternatives you've considered
RDFLib can read 2 graphs and compare them if they are equal by making both isomorph and then check if they are equal. RDFLib does not do RDF-Star, pyoxigraph does.
Additional context
RDFLib's compare module: https://rdflib.readthedocs.io/en/stable/_modules/rdflib/compare.html