New Query Language for Graph Databases to Become International Standard
Graph query languages are nice and all, but what about Linked Data here?
Queries of schemaless graphs miss lots of data because without a schema
this graph calls it &quot;color&quot; and that graph calls it &quot;colour&quot;
and that graph calls it &quot;色&quot; or &quot;カラー&quot;. (Of course this is also an issue even when there is a defined schema; but it&#x27;s hardly possible to just happen to have comprehensible inter or even intra-organizational cohesion without e.g. RDFS and&#x2F;or OWL and&#x2F;or SHACL for describing (and changing) the shape of the data)<p>So, the task is then to compile schema-aware SPARQL to GQL or GraphQL or SQL or interminable recursive SQL queries or whatever it is.<p>For GraphQL, there&#x27;s GraphQL-LD (which somewhat unfortunately contains a hashtag-indeterminate dash). I cite this in full here because it&#x27;s very relevant to the GQL task at hand:<p>&quot;GraphQL-LD: Linked Data Querying with GraphQL&quot; (2018) <a href="https:&#x2F;&#x2F;comunica.github.io&#x2F;Article-ISWC2018-Demo-GraphQlLD&#x2F;" rel="nofollow">https:&#x2F;&#x2F;comunica.github.io&#x2F;Article-ISWC2018-Demo-GraphQlLD&#x2F;</a><p>&gt; <i>GraphQL is a query language that has proven to be a popular among developers. In 2015, the GraphQL framework [3] was introduced by Facebook as an alternative way of querying data through interfaces. Since then, GraphQL has been gaining increasing attention among developers, partly due to its simplicity in usage, and its large collection of supporting tools. One major disadvantage of GraphQL compared to SPARQL is the fact that it has no notion of semantics, i.e., it requires an interface-specific schema. This therefore makes it difficult to combine GraphQL data that originates from different sources. This is then further complicated by the fact that GraphQL has no notion of global identifiers, which is possible in RDF through the use of URIs. Furthermore, GraphQL is however not as expressive as SPARQL, as GraphQL queries represent trees [4], and not full graphs as in SPARQL.</i><p>&gt; <i>In this work, we introduce GraphQL-LD, an approach for extending GraphQL queries with a JSON-LD context [5], so that they can be used to evaluate queries over RDF data. This results in a query language that is less expressive than SPARQL, but can still achieve many of the typical data retrieval tasks in applications. Our approach consists of an algorithm that translates GraphQL-LD queries to SPARQL algebra [6]. This allows such queries to be used as an alternative input to SPARQL engines, and thereby opens up the world of RDF data to the large amount of people that already know GraphQL. Furthermore, results can be translated into the GraphQL-prescribed shapes. The only additional requirement is their queries would now also need a JSON-LD context, which could be provided by external domain experts.</i><p>&gt; <i>In related work, HyperGraphQL [7] was introduced as a way to expose access to RDF sources through GraphQL queries and emit results as JSON-LD. The difference with our approach is that HyperGraphQL requires a service to be set up that acts as a intermediary between the GraphQL client and the RDF sources. Instead, our approach enables agents to directly query RDF sources by translating GraphQL queries client-side.</i><p>All of these RDFS vocabularies and OWL ontologies provide structure that minimizes the costs of merging and&#x2F;or querying multiple datasets: <a href="https:&#x2F;&#x2F;lov.linkeddata.es&#x2F;dataset&#x2F;lov&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lov.linkeddata.es&#x2F;dataset&#x2F;lov&#x2F;</a><p>All of these schema.org&#x2F;Dataset s in the &quot;Linked Open Data Cloud&quot; are easier to query than a schemaless graph: <a href="https:&#x2F;&#x2F;lod-cloud.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lod-cloud.net&#x2F;</a> . Though one can query schemaless graphs with SPARQL, as well.<p>For reference, RDFLib has a bunch of RDF graph implementations over various key&#x2F;value and SQL store backends. RDFLib-sqlachemy does query parametrization correctly in order to minimize the risk of query injection. FOR THE RECORD, SQL Injection is the CWE Top 25 #1 most prevalent security weakness; which is something that any new spec and implementation should really consider before launching anything other than an e.g. overly-verbose JSON-based query language that people end up bolting a micro-DSL onto. <a href="https:&#x2F;&#x2F;github.com&#x2F;RDFLib&#x2F;rdflib-sqlalchemy" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;RDFLib&#x2F;rdflib-sqlalchemy</a><p>Most practically, I frequently want to read a graph of objects into RAM; update, extend, and interlink; and then transactionally save the delta back to the store. This requires a few things: (1) an efficient binary  serialization protocol like Apache Arrow (SIMD), Parquet, or any of the BSON binary JSONs; (2) a transactional local store that can be manually synchronized with the remote store until <i>it&#x27;s</i> consistent.<p>SPARQL Update was somewhat of an out-of-scope afterthought. Here&#x27;s SPARQL 1.1 Update:
<a href="https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;sparql11-update&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;sparql11-update&#x2F;</a><p>Here&#x27;s SOLID, which could be implemented with SPARQL on GQL, too; though all the re-serialization really shouldn&#x27;t be necessary for EAV triples with a named graph URI identifier: <a href="https:&#x2F;&#x2F;solidproject.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;solidproject.org&#x2F;</a><p>5 star data: PDF -&gt; XLS -&gt; CSV -&gt; RDF (GQL, AFAIU (but with no URIs(!?))) -&gt; LOD
<a href="https:&#x2F;&#x2F;5stardata.info&#x2F;en&#x2F;" rel="nofollow">https:&#x2F;&#x2F;5stardata.info&#x2F;en&#x2F;</a>