Re: Moving a given subset of triples to another graph.

INSERT {} WHERE {} should do the trick

https://www.w3.org/TR/sparql11-update/#insert

For your specific example:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
INSERT
{
  GRAPH <http://mygraph2/> { ?s rdf:type ?o }
}
WHERE
{
  GRAPH <http://mygraph/> { ?s rdf:type ?o }
}

Note that since this is a SPARQL update this may need to be submitted to a different endpoint/API than you would submit a query to

Regards,

Rob Vesse


On 15/11/2016 07:10, "Olivier Rossel" <olivier.rossel@gmail.com> wrote:

    Hi all.
    
    I wonder how I can move all triples matching a given SELECT (like this):
    SELECT * WHERE { GRAPH <http://mygraph/> {?s rdf:type ?o} }
    
    into another named graph (let's call it http://mygraph2).
    
    What kind of SPARQL statement would do that?
    
    

Received on Tuesday, 15 November 2016 10:24:31 UTC