trungdong / prov

A Python library for W3C Provenance Data Model (PROV)
http://prov.readthedocs.io/
MIT License
122 stars 44 forks source link

Feature Request: PROV-RDF Serialization #1

Closed nicholsn closed 7 years ago

nicholsn commented 11 years ago

I'd be interested in adding support for PROV-RDF using rdflib. Is this in the roadmap? If so, I could help add this feature with a little guidance about how to extend prov with additional serializations.

trungdong commented 11 years ago

Hi Nolan,

We did consider of adding RDF export/import support but never had the bandwidth. Hence, you are very welcome to make contribution in this area. Please let me know what you need and I'll try to help the best I can.

Are you looking for both RDF import and export? I think RDF export is easier than import, and can be quickly implemented. Importing is trickier as it is not a straight forward mapping.

You might find the PROV-O document (http://dvcs.w3.org/hg/prov/raw-file/default/ontology/releases/CR-prov-o-20121211/Overview.html) useful for mapping PROV-DM to RDF.

nicholsn commented 11 years ago

Great. I think eventual support for import and export would be great, but export would be a great place to start. I'm still getting familiar with your codebase (nice work btw!) and the PROV-O document, but in the meantime perhaps you could tell me where you think the best place to add an rdf export def would be or if there example code of something similar. Maybe get_provn?

Thanks and looking forward to contributing!

trungdong commented 11 years ago

Thank you for the nice comment. I made a stab at RDF export and created an rdf branch for it. It is currently experimental and I'm still quite unsure about coupling the code of the model with that for RDF export. Nevertheless, I hope it gives you some ideas.

RDF support will not be trivial (as our experience with the ProvToolbox's implementation in Java told us) and it might be better to have a separate module for RDF (de)serialisation.

nicholsn commented 11 years ago

You're very welcome and thanks for taking an initial stab at the RDF export. This will definitely give me a good foothold to start from and I agree that coupling the serialization code with the model might need a little refactoring. I'll tinker with this over the upcoming break for the holidays and we can discuss.

trungdong commented 10 years ago

@nicholsn, @satra,

Just a head up. I'm refactoring the prov.model package, introducing significant changes to the data model. In addition, I separated (de)serialization's code from the mode's. See prov.model.serializers package in the 1.x branch, which contains the PROV-JSON serializer. It would be great if you have a chance to port the RDF code to a new serializer following the PROV-JSON example.

satra commented 10 years ago

@trungdong - i'll send a PR today. is there a prov/bundle you have that generates all possible records?

trungdong commented 10 years ago

@satra, thank you. It doesn't need to be that fast but you're very welcome to :)

The branch is completed in functionality, except prov.model.graph which has not been ported. That's why I haven't released it yet.

BTW, the Django app prov.persistence has been removed and will become a separate package soon.

trungdong commented 7 years ago

RDF support is now implemented from version 1.5.0