Can I merge an unknown named graph with an other in a SPARQL query?

I want to query on two different named graphs as the default graph with SPARQL :

SELECT *
GRAPH <graph1>
GRAPH <graph2>
WHERE{
    ...
}

My problem is that I don’t know the URI of graph1, but I know a specific triple of graph1 allowing me to find his URI.

SELECT ?g
WHERE{
    GRAPH ?g{
        eg:MyKnownURI a eg:Element.
    }
}

Currently, I have to perform the second query to get <graph1> and next, I can perform the first query.

Is there a syntax to perform the two requests in one ?


Source: syntax

Leave a Reply