I want to perform the following queries, to add a relation skos:related between node a and node b :
PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
INSERT { GRAPH ?graph { ?a skos:related ?b } }
WHERE{
GRAPH ?graph {
{ ?a skos:inScheme ?scheme } .
{ ?b skos:inScheme ?scheme }
}
};
INSERT { GRAPH ?graph { ?b skos:related ?a } }
WHERE{
GRAPH ?graph {
{ ?a skos:inScheme ?scheme } .
{ ?b skos:inScheme ?scheme }
}
};
I would prefer to send a single query to the RDF store, but can't find a way to do so. Obviously, the queries are here in generic form, and ?a, ?b, ?scheme and ?graph variables are bound with specific values at execution.
Is there a way?