One of the issues that I think is important in designing an ontology is the decision of whether to use user supplied names or UUIDs. I want to write a SPARQL query that makes the decision easy by automating the change from user defined names to UUIDs. (I could also go the other way but I think going in this direction is the more important problem to solve because it is the more common kind of evolution, user supplied names are simpler but UUIDs become a requirement as the ontology gets larger and used with other systems).
I figured out how to create labels from user supplied names
. You need that because in Protege when you use the "User Supplied Name" it doesn't put anything in the rdfs:label. I wrote SPARQL queries that find user supplied names like "MyCoolClass" and generate labels like: "My Cool Class".
I think it is fairly easy to write something that generates a new UUID IRI, copies all the links from the existing IRI to the new one, and then deletes the old one. But for large ontologies this will take a bit of time, essentially you have to make a copy of every object in the ontology. I was wondering is there an easier way to do it? E.g., if I have a NamdedIndividual called FooBar1 and I create a UUID for it and then say that UUID9753 is the same individual as FooBar1 and then delete FooBar1 will that delete UUID9753 as well?
I know that most triplestores have programming API's to do this but I want to write something at the SPARQL level so it is portable. If anyone knows of some existing SPARQL code or tricks in RDF or OWL that would make this easier, please let me know.