Open kinow opened 1 year ago
Not sure what would be the best way to display SPARQL-star results :disappointed_relieved:
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 :+1:
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! Bruno
Hi @kinow
I noticed some curious issue with this PR, the following code gets flagged as wrong:
PREFIX some: <https://www.example.com/>
SELECT * WHERE {
bind(some:function(?var1) as ?var2)
^-- This line is invalid. Expected: VAR1, VAR2
}
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