Skip to content
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

tarql should support named graphs #98

Open
VladimirAlexiev opened this issue Mar 2, 2022 · 4 comments
Open

tarql should support named graphs #98

VladimirAlexiev opened this issue Mar 2, 2022 · 4 comments

Comments

@VladimirAlexiev
Copy link

to @cygri, cc @rdstn @andrecastro0o
For significant Update scenarios, it's very useful to have data organized by Named Graph.

Eg to implement CrunchBase incremental updates, it makes sense to have a named graph per record. Eg for organizations.csv:

  • instead of Turtle
<org/(uuid)> a cb:Organization;
  cb:name "(name)";
  ...
  # empty newline
  • I want TRIG:
graph <graph/organizations/(uuid)> {
  <org/(uuid)> a cb:Organization;
    cb:name "(name)";
    ...
    # empty newline
}
  • plus a SPARQL update:
clear <graph/organizations/(uuid)>

As @jindrichmynarz reported, SPARQL 1.1 cannot produce named graphs with CONSTRUCT: w3c/sparql-dev#31.

Is there a chance for TARQL to implement some workaround?
TARQL is based on Jena, so @afs is there a chance Jena can implement this before it's standardized in SPARQL 1.2? I.e. expedite this issue and have a reference implementation for the others to follow?

@VladimirAlexiev
Copy link
Author

@jindrichmynarz and @afs, I'm an idiot: Jindrich wrote

Apache Jena already allows to CONSTRUCT named graphs (https://jena.apache.org/documentation/query/construct-quad.html).

So we'll test it with TARQL

@afs
Copy link

afs commented Mar 2, 2022

For portability, TARQL could generate SPARQL Updates (INSERT DATA etc).

@rdstn
Copy link

rdstn commented Mar 2, 2022

Tested with TARQL, looks like it doesn't work, at least on the version I treid with:

org.apache.jena.query.QueryParseException: Encountered " "graph" "GRAPH "" at line 37, column 4.

@afs
Copy link

afs commented Mar 2, 2022

If you look at the stacktrace, it'll say where in TARQL. TARQL might choose strict SPARQL 1.1 and CONSTRUCT/GRAPH is a syntax extension.

A quick search of the code found TarqlParser.java and TarqlQuery.java, which has a comment it is a port from Jena2. All that is much simpler these days.

@VladimirAlexiev VladimirAlexiev changed the title support named graphs tarql should support named graphs Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants