From and From Named Graph in SPARQL

2.7k views Asked by At

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 and I1
  • a named graph I2

Is this understanding right?

1

There are 1 answers

0
AndyS On BEST ANSWER

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 which I, I1, and I2 are taken.

You are correct that the dataset for the query will have a default graph which is the merge of I and I1, and also a named graph I2.

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, and I2 are taken from the web (the universe of graphs is the web).