-
Notifications
You must be signed in to change notification settings - Fork 44
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
[MRG]: Add rdf serialization #49
Conversation
* upstream/master: Fixed Build status link Added build status from Travis-CI doc: fixed docstring for assertLess fix: remove redundant ls fix: remove checking for py3k fix: added assertLess fix: added support for asserts to unittest fix: more set fixes fix: support for 2.6 set fix: added python versions to tests fix: updated dateutil name enh: add travis testing file
Hi @satra, FYI, prov now has many more tests (https://github.com/trungdong/prov/tree/master/prov/tests), which you can use to test the RDF export. Since we don't have RDF import, you won't be able to do the round-trip tests as in the test cases, but even a one-way export test could be useful. |
* upstream/master: Fixed: Cloning the records when creating a new document from them Bugfix regarding a software agent record.
@trungdong - i'm slowly making my way through rdf deserialization. in terms of comparing documents, how do you ensure that order of attributes don't matter?
to me these are the same graphs, but the roundtrip fails because the orders of attributes are different. |
Hi @satra, I suggest you do prov.model --> RDF --> prov.model. Comparing two |
thanks @trungdong - i was doing |
even sets are not quite doing their job - will have to look into this further.
vs
sets
vs
|
forgot to say that the graphs in the previous comment are failing the assert. |
nevermind - found it - it's the QName |
* upstream/master: Fixed: PROV-N representation for xsd:dateTime (closed trungdong#58) Fixed: Unintended merging of Identifier and QualifiedName values
* upstream/master: fix: formal attributes were not being included in all attributes
* upstream/master: Fixed trungdong#60 but no need to touch ProvRecord.formal_attributes (as per trungdong#61)
Hi @satra. You will find below an example in which the serialization to rdf adds extra (unwanted)
Obtained turtle export: @prefix niiri: . @prefix prov: . @prefix rdf: . @prefix rdfs: . @prefix xml: . @prefix xsd: . niiri:entity_2 a prov:Entity . niiri:activity a prov:Activity ; prov:qualifiedUsage [ a prov:Usage ; prov:entity niiri:entity_1 ] ; prov:used niiri:entity_1 . niiri:entity_1 a prov:Entity ; prov:qualifiedDerivation [ a prov:Derivation ; prov:usedEntity niiri:entity_1 ] ; prov:qualifiedGeneration [ a prov:Generation ; prov:activity niiri:activity ] ; prov:wasDerivedFrom niiri:entity_1 ; prov:wasGeneratedBy niiri:activity . Unfortunately, I did not find the fix... I hope this example is useful. Let me know if I can help you to track this down! |
@cmaumet - should entity_1 be derived from entity_1? |
also the qualified relations aren't unwanted - that's how the representation for derivation is intended to be. a wasDerivedFrom is a relationship, i.e. an edge between two nodes. the qualified derivation allows describing properties of that edge. this is partly what makes the deserialization difficult. |
thank you |
a few more things to finalize:
|
these tests fail round trip - need to figure out a way to skip.
|
@trungdong - some of the issues here are unfortunately due to rdflib interactions. but this is good for review. i still need to figure out the python 3 errors, again an interaction with rdflib! and how to suppress the failing scruff tests. |
* fix/literal: fix: extra curly bracket fix: test setup fix: only escape triple quotes in the triple quote case fix: string representation containing double quotes or triple quotes - closes trungdong#79
* upstream/master:
* upstream/master: Remove networkx versioning also in setup.py Relaxed networkx requirement. Closed trungdong#84. Fix deprecated usage of cgi.escape since Python 3.3
1 similar comment
@trungdong - finally got some time to fix and this is ready for merge :) |
closes #1 |
Excellent! Thank you very much @satra!!! |
new feature from: trungdong/prov#49
This is ready for merge!