Search code examples
graphdb

How to rename graphdb repository with sparql or rest


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.


Solution

  • 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.

    http://graphdb.ontotext.com/documentation/free/configuring-a-repository.html?highlight=rename#configuring-a-repository-reconfigure-a-repository-using-the-workbench

    Note that this also re-initializes the repository.