csensemakers / desci-sense

2 stars 2 forks source link

Python triplets output format #112

Open ShaRefOh opened 7 months ago

ShaRefOh commented 7 months ago

Hey @ronentk, @pepoospina and I agreed that the Python output should be decoupled for the Nanopub-specific syntax and placeholders, as other apps and integrations would also use the triplets. Therefore, we should use a placeholder for ourselves.

The format will use regular triplets. For triplets that represent the relation between the post and the URL, we will use:

<_:this_post><www.example.com/relation><www.example2.com> If the triplet represents that the post has keywords, we will use: <_:this_post><http://pcp-on-web.de/ontology#hasKeyword> "keyword"

Then on the ts nanopub construction side, we will replace the placeholder <_:this_post> with the nanopub placeholder <http://purl.org/nanopub/temp/mynanopub#assertion>

ronentk commented 6 months ago

Hi @ShaRefOh @pepoospina , the current functionality creates a string in the RDF output format we want (by default it's turtle). You can see an example here: https://github.com/csensemakers/desci-sense/blob/st-dev/nlp/notebooks/firebase_parser_test.ipynb

Note that now the ParserResult is an RDF Graph - this is what we wanted, right? https://github.com/csensemakers/desci-sense/blob/4b17fb4f05961ceb4e3872bae4427b029af7ff1d/nlp/desci_sense/shared_functions/interface.py#L163

I'm close to finishing this and we can merge back with main

pepoospina commented 6 months ago

Yes @ronentk , the semantics property is expected to be just one RDF string now. Not an array of string triplets as before.