-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signing named graphs #682
Comments
I'm interested in this too. In the past (early rdflib days) I implemented my own graph hasher and wrote my own code to serialise the graph with deterministic blank node names. I'll be happy to see an answer here too! |
i briefly looked into this before, but maybe @jimmccusker could have a look... seems to be a bug in
is it maybe getting confused by the store being re-used? |
apart form that, as sha256 is used as a checksum, i think this would be a good approach to sign graphs, yes |
To answe the original question, the isomorphic graph has a special method called graph_digest() that will output a graph-level hash using the Sayers and Karp algorithm. It looks like. The blank node has the same context (surrounding triples, grounding out at liberals or URIs) in all the graphs, so they are getting the same BNode IDs. So the canonicalized graphs should have the same ID fo the blank node version of Mary. I'll look into why they are the same as the non-canonicalized BNodes though. It could have something to do with the reuse of the |
notice how |
Ah, yes, sorry, still early here. Will investigate ASAP. |
If you are interested in my approach for experiment-data management you can have a look at Linked-data-for-scientists-with-python. |
The simple fix is for to_isomorphic() to not use the same store (which is what I do above). I tried using the same store but with an identifier, and the problem persists. The downside is that the triples are duplicated before actually being canonicalized. |
Added test for Issue #682 and fixed.
Hi all,
I would like to store my experiment data with RDFLib. Moreover I want to sign the data of every single experiment to make it sharable for the future. My approach is to use one named graph for each experiment, hash this graph and sign the hash.
It seems that I don't really understand the concept of isomorphic graphs. Why is the hash of the isomorphic named graph the same as the hash of its isomorphic conjunctive graph?
Should I sign the
_TripleCanonicalizer(gmary).to_hash()
instead or do I run in problems with blank nodes with this approach?Here is some code to clarify what I want to do:
Cheers,
LibrEars
The text was updated successfully, but these errors were encountered: