I am trying to rename a ontotext graphdb repository programmatically (via a SPARQL query or rest endpoint).
I can use the following SPARQL documented here to delete old repository and insert new repository however this deletes all data from old repository
PREFIX sys:<http://www.openrdf.org/config/repository#>
DELETE { GRAPH ?g { ?repository sys:repositoryID ?old_name } }
INSERT { GRAPH ?g { ?repository sys:repositoryID ?new_name } }
WHERE {
GRAPH ?g { ?repository a sys:Repository . }
GRAPH ?g { ?repository sys:repositoryID ?old_name . }
FILTER( ?old_name = "old_repository_name" ) .
BIND( "new_repository_name" AS ?new_name ) .
}
I can manually copy over the index files to this new repository location, however Is there an inbuilt graphdb feature to do this.
The link you share is for the 6.6 documentation, which is a very old version of GraphDB. In the newer versions of GraphDB you can rename the repository from the Workbench Edit repository form.
Note that this also re-initializes the repository.