I am getting a confusion related to FROM
and FROM NAMED
graphs in SPARQL. I did read the specifications relating to these two construct in the SPARQL Specifications. I just want to confirm my understanding.
Suppose an RDF Dataset is located at IRI I
. I
is made up of:
- a default graph
G
- 3 named graphs
{(I1,G1), (I2,G2), (I3,G3)}
Now, suppose I have a SPARQL query:
SELECT *
FROM I
FROM I1
FROM NAMED I2
So if I understand, to evaluate this query, the SPARQL service may construct the active graph at the back, this active merge will contain:
- a default graph which is the merge of
I
andI1
- a named graph
I2
Is this understanding right?
The
FROM
,FROM NAMED
clauses describe the dataset to be queried. How that comes into being is not part of the SPARQL spec. There is a universe of graphs from whichI
,I1
, andI2
are taken.You are correct that the dataset for the query will have a default graph which is the merge of
I
andI1
, and also a named graphI2
.Whether those are taken from the underlying dataset is implementation dependent. It is a common thing to provide (the universe of graphs is the named graphs in the dataset) but it is also possible that the
I
,I1
, andI2
are taken from the web (the universe of graphs is the web).