Is it possible to combine these 2 SPARQL INSERT into one?

I want to execute the following queries to add a skos relationship: 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 one request to the RDF repository, but cannot find a way to do this. Obviously, the queries are here in general form, and the variables? A B Schem and? Graph are bound to specific values ​​at runtime.

Is there any way?

+1
source share
1 answer

Can't you just approve both directions of skiing: related relationship in one query template? I.e:.

 PREFIX skos:<http://www.w3.org/2004/02/skos/core#> INSERT { GRAPH ?graph { ?a skos:related ?b . ?b skos:related ?a } } WHERE{ GRAPH ?graph { { ?a skos:inScheme ?scheme } . { ?b skos:inScheme ?scheme } } }; 
+1
source

All Articles