rdflib-neo4j icon indicating copy to clipboard operation
rdflib-neo4j copied to clipboard

Are we able to add attribute for predicate in RDFlib, and save it to neo4j as relationship's attribute

Open JasonPad19 opened this issue 1 year ago • 3 comments

Hi

Thanks for supporting the rdf-neo4j integration.

I am facing a challenge that we need to maintain a history of data in neo4j. The easiest practice in neo4j is to add a date attribute under the relationship between node A and node B. Yet, the source data we are importing are from turtle files. I haven't figured out an efficient way to push multiple date's turtle files into neo4j, and maintaining the date attribute at the same time.

source turtle files 2024-01-01Order.ttl Customer A -> buys -> Product A

2024-01-02Order.ttl Customer B -> buys -> Product A

expected view in neo4j Customer A -> buys ( order date: 2024-01-01) -> Product A Customer B -> buys ( order date: 2024-01-02)-> Product A

Would you suggest any practice please?

JasonPad19 avatar Jan 18 '24 03:01 JasonPad19

Can you please give us more information about your use case? The Turtle file format doesn't support properties on relationships, and currently rdflib doesn't support the parse of the rdf star format, that is the one that supports this kind of data.

alfredorubin96 avatar Jan 22 '24 12:01 alfredorubin96

Thanks for your comments. :)

Yes, We will have daily facts that will be converted to triples via rdflib, and then pushed to neo4j using rdflib-neo4j package. e.g.

  • 2024-01-01Order.ttl
  • 2024-01-02Order.ttl
  • 2024-01-03Order.ttl

And, we would like to keep the history in neo4j as well, which will end up a rdf-star format or attribute on predicate.

But I am not sure what is the best approach to construct the presentation in neo4j based on our daily ttl files, considering using rdflib-neo4j package.

JasonPad19 avatar Jan 25 '24 02:01 JasonPad19

First of all, sorry for the late answer, in second place: the possibility of adding relationship properties on the nodes is something that we currently don't offer, due to the fact that that rdflib doesn't officially support rdf-star.

We are thinking about a way to skip this problem, but it requires some time.

Let us know if you need anything else

alfredorubin96 avatar Jun 12 '24 10:06 alfredorubin96

I'll close this issue for now, due to the lack of support for rdf-star from rdflib. Feel free to reopen this issue.

alfredorubin96 avatar Sep 06 '24 14:09 alfredorubin96