w3c / EasierRDF

Making RDF easy enough for most developers
267 stars 13 forks source link

Pattern based queries #69

Open draggett opened 5 years ago

draggett commented 5 years ago

This demo shows how Turtle can be extended to allow the subject or object of triples to annotate a collection of triples in the same graph. This uses curly brackets which are interpreted as an implicit blank node. Why the same graph? Because sometimes you will want to make different annotations on the same triples, and you want to include the annotations in the same file as the triples being annotated.

The demo focuses on how this can be applied to RDF for representing pattern based queries, inspired by SPARQL. The demo is implemented as a Web page with a JavaScript library for the extended version of RDF.

See: https://www.w3.org/Data/demos/chunks/patterns.html

afs commented 5 years ago

rdfs:seeAlso https://www.w3.org/DesignIssues/N3QL.html

draggett commented 5 years ago

Thanks Andy. In my demo, the query is modelled as RDF so that for machine learning, queries can be treated as data and manipulated as such. Is there a direct mapping of N3QL to RDF, and what would it look like? For instance, the page you linked to treats terms that start with '?' as named variables. These would need to be declared as variables

afs commented 5 years ago

That's a question for the author of N3QL.

Using syntax that identifies variables or declaring certain terms to be handled as variables is only syntax/skolemization. For your use case of machine manipulation, variable syntax would be a little easier because fragments are then valid as query patterns.

afs commented 5 years ago

Another one: https://www.w3.org/Submission/spin-sparql/