Reputation: 797
Is possible to rename a graph using sparql update?
The only way through that I see is this:
INSERT {GRAPH uri:graphNEW {?s ?p ?o}}
WHERE {GRAPH uri:graphOLD {?s ?p ?o}};
DROP GRAPH uri:graphOLD
but I'm not 100% sure that all the triples and attributes (like langue tags and xsd format) will be copied in the new graph.
Is there a cleverer way to do it?
EDIT: question improved thanks to Roman Susi suggestion
Upvotes: 7
Views: 1285
Reputation: 16630
From http://www.w3.org/TR/sparql11-update/#graphManagement
MOVE uri:graphOLD TO uri:graphNEW
which will replace uri:graphNEW
ADD uri:graphOLD TO uri:graphNEW
which will add all of old into new and keep existing triples in uri:graphNEW
.
Upvotes: 8
Reputation: 4199
Graphs can be made empty of records with DELETE, but to remove the graph itself DROP GRAPH directive is needed:
DROP GRAPH <yourgraph>
Upvotes: 1