Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

RDF*/SPARQL* support? #955

Closed
sa-bpelakh opened this issue Feb 6, 2020 · 26 comments
Closed

RDF*/SPARQL* support? #955

sa-bpelakh opened this issue Feb 6, 2020 · 26 comments
Labels
enhancement New feature or request SPARQL
Milestone

Comments

@sa-bpelakh
Copy link
Contributor

There is currently a W3C working group considering the adoption of Olaf Hartig's work on RDF*/SPARQL* as a W3C standard (http://olafhartig.de/files/Hartig_AMW2017_RDFStar.pdf). Several DB vendors already support this syntax (Anzo, Stardog, Blazegraph), and others are working on adding it as a feature. It provides a great bridge between RDF and Property graphs.

Could this be possibly added to rdflib?

@gromgull
Copy link
Member

gromgull commented Feb 7, 2020 via email

@JervenBolleman
Copy link
Contributor

JervenBolleman commented Feb 7, 2020

@gromgull I am working on it! Hope to publish a branch next week.

@sa-bpelakh
Copy link
Contributor Author

sa-bpelakh commented Feb 7, 2020

@JervenBolleman that is fantastic, please let me know if you need a hand with testing.

@JervenBolleman
Copy link
Contributor

The approach I am taking is by going the RDF* PG mode where <ex:p ex:y ex:z> asserts the triple and itself is a special BNode (basically a bnode with a derivable _:id) Which maps to reified statements. Has it's downsides but I think making RDF* a syntactic sugar is the way to go. At least with my limited skills.

JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue Mar 4, 2020
@JervenBolleman
Copy link
Contributor

Hi, just wanted to note that my slow progress is available here. I am however, having difficulty with the parser code. So I was very over optimistic on getting this work faster.

@JervenBolleman
Copy link
Contributor

I am now into adding the new EmpTP nodes into the algebra. Recursive <<?s ?o <<?s2 ?o2 ?p2>>>> does not work, as I don't know how to define that in the parser logic.

@JervenBolleman
Copy link
Contributor

Well "it works" now. PG mode, SPARQL only by translating the sparql* into a reification quad.
Needs serious work to polish it all up and make it more Pythonic.

@nicholascar
Copy link
Member

Great work here @JervenBolleman! We (my company) will likely be looking at RDF* soon for W3C graph work (GQL).

@JervenBolleman
Copy link
Contributor

JervenBolleman commented Mar 6, 2020

@nicholascar thank you. Still a lot of work to be done.

  • Move EmbTP to reification quad translation into evaluation from algebra (Via new triple object)
  • Implement SPARQL* update
  • Make SPARQL* recursive in the parser
  • Add many more test cases!
  • BIND and VALUES need to work as well.
  • Figure out why URIRef inside the <<>> are not transformed into URIRef objects

@JervenBolleman
Copy link
Contributor

Just want to share my progress. The parsing is done better now, and instead of hacking in support to the algebra it is now pushed down into the evaluation. However, I have not yet managed to get the evaluate to work nicely. It is natural to put it in the evalBGP part, but resolving an "EmbeddedTriple" to a series of Identifiers is quite painful there. I need to think a bit more.

JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue Mar 8, 2020
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue Mar 8, 2020
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue Mar 8, 2020
Approach is horrid though, and code is being executed in the wrong place.
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue Mar 8, 2020
…spot in the evaluate stack. However, functionality wise it is a step back. Commiting and pushing this to share the work so others can have a look.
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue Mar 9, 2020
… triple with a reification quad. Unfortunatly, the parser gives CompValue objects in the case where I expect URIRef. There is now one method in evaluate that needs to be overriden to generate the right logic. This method still needs to move to the graph so that optimized stores can be developed.
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue Mar 9, 2020
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue Mar 9, 2020
…e compvalue's into URIRef etc. Now wired up, reveals a failing test
@pragya16067
Copy link

Hi @JervenBolleman, I along with a group of students from IIIT Delhi ardently wish to contribute to this issue. We would like to get in contact with you soon if possible and would be very obliged if you could walk us through the work done so far.
Looking forward to your response!

@JervenBolleman
Copy link
Contributor

JervenBolleman commented Mar 13, 2020

@pragya16067 find my e-mail and contact me.

@pragya16067
Copy link

Hey @JervenBolleman, mailed!

@nicholascar
Copy link
Member

nicholascar commented Mar 13, 2020

Position paper on RDF*/SPARQL* at https://blog.liu.se/olafhartig/2019/01/10/position-statement-rdf-star-and-sparql-star/

@JervenBolleman
Copy link
Contributor

This preprint has a lot of details required for implementing. Includes the required changes to the grammar.

@pragya16067
Copy link

Thanks @JervenBolleman and @nicholascar. Will take a look!

JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue Mar 14, 2020
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue Mar 14, 2020
@nicholascar nicholascar added this to the rdflib 6.0.0 milestone Mar 15, 2020
@nicholascar
Copy link
Member

Consider the alternate Turtle syntax proposal by Stardog (they seem to have implemented it already): https://www.stardog.com/blog/property-graphs-meet-stardog/

@hartig
Copy link

hartig commented Apr 28, 2020

Just for the record: another triple store that supports RDF* and SPARQL* now is Ontotext GraphDB (as of version 9.2); see http://graphdb.ontotext.com/documentation/9.2/free/devhub/rdf-sparql-star.html

The main part of their implementation is within their GraphDB code base but some of the base stuff is in the underlying RDF4J library they are using internally.

Another Java library that you may look at to get inspiration for adding RDF*/SPARQL* support in RDFLib is Apache Jena and the RDFTools library we have built on top if it. At the core, the object model of Jena has been extended with a class called Node_Triple that can be used in the Triple class. Also, there are grammars for Turtle* and for the SPARQL* syntax.

@aarushiag
Copy link

aarushiag commented May 9, 2020

Hi @JervenBolleman and @nicholascar , we have tried to make some changes for making the SPARQL* recursive in nature. Kindly review it :) (PR Link - JervenBolleman#1 )

JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue May 10, 2020
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue May 10, 2020
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue May 10, 2020
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue May 10, 2020
Approach is horrid though, and code is being executed in the wrong place.
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue May 10, 2020
…spot in the evaluate stack. However, functionality wise it is a step back. Commiting and pushing this to share the work so others can have a look.
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue May 10, 2020
… triple with a reification quad. Unfortunatly, the parser gives CompValue objects in the case where I expect URIRef. There is now one method in evaluate that needs to be overriden to generate the right logic. This method still needs to move to the graph so that optimized stores can be developed.
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue May 10, 2020
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue May 10, 2020
…e compvalue's into URIRef etc. Now wired up, reveals a failing test
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue May 10, 2020
JervenBolleman added a commit to JervenBolleman/rdflib that referenced this issue May 10, 2020
@pragya16067
Copy link

Hi @JervenBolleman and @nicholascar, I have added support for parsing and querying on RDF* graphs via some additional wrapper functions in the RDF (Turtle) parser.
Kindly review it :) (PR Link - JervenBolleman#4 )

@pragya16067
Copy link

Great work here @JervenBolleman! We (my company) will likely be looking at RDF* soon for W3C graph work (GQL).

Hi @nicholascar. I have added a PR (#1111) with my work on adding support for parsing RDF* graphs. Kindly review it :) Hope to hear from you soon.

@alex-randles
Copy link

Hi Guys,

I am curious to know is there any update on this?

Thanks!

@nicholascar
Copy link
Member

Hi @alex-randles JervenBolleman reviewed the PR associated with this issue, #1111, so that's the latest direct work.

The other maintainers and I are still performing a bunch of clean-up updates to the code base before an RDFlib 6.0.0 release - mainly reducing the number of small PRs and tidying up old functions - before we tackle this major enhancement. So we will linkey only get to directly focussing on this work in a couple of months however it would be great if you or others could review and comment on PR #1111. I think it will need updating and a bit of work to pass tests still, if the approach is deemed appropriate.

@JervenBolleman
Copy link
Contributor

JervenBolleman commented Sep 23, 2020 via email

@westurner
Copy link
Contributor

westurner commented Jan 3, 2021

Are there rdf-star issues and/or mailing list posts for the considered blocking SPARQL* spec issue(s)?

RDF*

RDF*: RDF*, SPARQL*, N-Triples*, Turtle*

## RDF*
RDF*: RDF*, SPARQL*, N-Triples*, Turtle*
- Web: https://w3c.github.io/rdf-star/
- Src: https://github.com/w3c/rdf-star
- Issues: https://github.com/w3c/rdf-star/issues
- MailingList: https://lists.w3.org/Archives/Public/public-rdf-star/
- UseCases: https://w3c.github.io/rdf-star/UCR/rdf-star-ucr.html
- Spec: RDF*: https://w3c.github.io/rdf-star/rdf-star-cg-spec.html
- Spec: SPARQL*: https://w3c.github.io/rdf-star/tests/sparql/syntax/manifest.html
- Spec: RDF* Semantics: https://w3c.github.io/rdf-star/tests/semantics/manifest.html
- Spec: Turtle*: https://w3c.github.io/rdf-star/tests/turtle/syntax/manifest.html
- Spec: N-Triples*: https://w3c.github.io/rdf-star/tests/nt/syntax/manifest.html

@Crazytieguy
Copy link

Hi! Is there any progress on this?

@ghost ghost added SPARQL enhancement New feature or request labels Dec 23, 2021
@ghost ghost locked and limited conversation to collaborators Dec 25, 2021
@ghost ghost converted this issue into discussion #1554 Dec 25, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request SPARQL
Projects
None yet
Development

No branches or pull requests

10 participants