SPARQL Query Default Graph (Doc ID 1669045.1)

Last updated on FEBRUARY 08, 2017

Applies to:

Oracle Spatial and Graph - Version 12.1.0.1 and later
Information in this document applies to any platform.

Goal

With several semantic models, each with exactly one graph.
The default graphs of all the models are empty.
These models are all combined in one virtual model; and that model is published on the Joseki endpoint. This works very well.
We are able to query the union of all the graphs.

SELECT * { GRAPH ?graph {?s ?p ?o}}

However, while having ontologies in graphs has its advantages, it will also make some queries harder to write. So we would like to have the default graph be the union of all graphs.
In that way the following query would yield results despite the default graph being empty.

SELECT * { ?s ?p ?o }

This functionality corresponds to using a SEM_MATCH with the graphs and named_graphs parameters set to NULL. This is mentioned in the documentation for SEM_MATCH, in 1.6.2.1 (http://docs.oracle.com/cd/E16655_01/appdev.121/e17895/sdo_rdf_concepts.htm#CIHFIBJH ) .

What we haven’t found however, is how to make this work in Joseki, so that our SPARQL endpoint behaves in the same way.
 

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms