I have multiple graphs in RDF Knowledgebase
for example
<123> <hasValue> "23" <graph1>
<234> <hasValue> "47" <graph1>
<374> <hasValue> "23" <graph1>
-----------
----------
<456> <hasFeature> "50" <graph2>
<244> <hasFeature> "23" <graph2>
<123> <hasFeature> "23" <graph2>
---------------------
Now I wan to run SPARQL query to get the results which is common in both graphs.
suppose If I run the following query for one graph I get the following result
SELECT ?subject
FROM Named <http://www.xyz.com/namespace/graph1>
WHERE {GRAPH ?graph
{?subject prefix:hasValue "23" .}}
<123>
<374>
---
---
---
if run the following second query for graph2 I get the following
SELECT ?subject
FROM Named <http://www.xyz.com/namespace/graph2>
WHERE {GRAPH ?graph
{?subject prefix:hasFeature "23" .}}
<244>
<123>
-----
However I want the subject <123> which is common in both queries. Is any way we can combine both queries to get the only subject which is common in both queries. Thanks in advance.