-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add support to SPARQL-Star #215
base: master
Are you sure you want to change the base?
Conversation
@@ -46,7 +46,7 @@ | |||
[selectClause,*(datasetClause),whereClause,solutionModifier]. | |||
|
|||
subSelect ==> | |||
[selectClause,whereClause,solutionModifier,valuesClause]. | |||
[selectClause,whereClause,solutionModifier,valuesClause]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting only, no change on this clause/rule.
%[81] | ||
triplesSameSubjectPath ==> [varOrTerm,propertyListPathNotEmpty]. | ||
triplesSameSubjectPath ==> [varOrTermOrQuotedTP,propertyListPathNotEmpty]. | ||
% TODO: triplesNodePath[100] or triplesNode[98] below? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is different than the docs, but I did not change as it's not directly related to the change here. Leaving a TODO for later™.
'<<'= '<<', | ||
'>>'= '>>', | ||
'{|'= '\\{\\|', | ||
'|}'= '\\|\\}', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's where I struggled the most. I hadn't realized I had to escape the right elements. I suspected I needed to move the <<
before other punctuation like <
and <=
, but it escaped me to escape it 😬 The error message was a CodeMirror error, saying the stream could not be processed. Took me at least one hour, then a walk outside, to come back and review everything and seeing other examples here I escaped these and everything worked fine 👍 🎉
Not sure what would be the best way to display SPARQL-star results 😥 I had a go at modifying the YASR parser and related code. I used a class-static method, but I guess that could have been an exported function instead. Not sure if that needs tests (nor how easy it'd be to write them). So happy to get a review for the current status, and then iterate and improve as needed 👍 I used this nested example: # https://w3c.github.io/rdf-star/tests/turtle/syntax/#turtle-star-nested-2
PREFIX : <http://example/>
:s :p :o .
:a :q <<:s :p :o >> .
<< :a :q <<:s :p :o >>>> :r :z . Here's the result in Apache Jena Fuseki UI: Maybe each triple quoted should be a new 3-column table within the current column (recursively)? Thanks! |
Hi @kinow I noticed some curious issue with this PR, the following code gets flagged as wrong:
no such error without this patch |
The syntax for triple terms / named occurrences being worked on by the RDF WG looks like it will be similar, but not the same, as the RDF-star CG report. |
Had forgotten about this PR. Maybe I should move this to the forked repo that we are now using in Jena Fuseki. Will do that (later, when I find some spare time) |
Closes #190
This draft pull request includes the commit from #214 , in order for the build to pass. If that other PR is merged, I will drop the commit here and rebase onto
master
.The other commit, right now, adds the SPARQL grammar (thanks @afs for the link) to the Prolog database. I regenerated the tokenizer table, used by CodeMirror, with SWI-Prolog and tested locally in YASGUI. You can see it in action with the YASQE editor in these screenshots:
I've also tested successfully in Jena. This screenshot shows the current behavior (running
FusekiCmd
from Eclipse, port3030
):And this one shows the Fuseki UI using the local development version of YASGUI (I removed
triply/yasqe
from Jena Fuseki UI, thenyarn add /home/kinow/.../yasqe
, running Yarn using port8080
, proxying Fuseki requests to the port3030
- i.e. Fuseki UI dev mode, same data & backend, different UI only):I loaded a simple Turtle file into a dataset in Jena:
to query and produce some RDF-Star results. At the moment it shows a JavaScript error in the query results panel (“e[t].value.replace is not a function”).
So that's the only part pending, but I think the hardest part was the Prolog parser and getting it working with YASQE. Now it should be a matter of checking if the type is a triple and displaying it correctly (probably as a quoted triple?).
Cheers
-Bruno