Ich muss URL für alle anonyme Klasse in einer Ontologie hinzufügen. Aber ich kann keine Methode dafür finden. Der Code fast wie folgt aus:Wie ändere ich die URL der OntClass-Instanz in Jena?
OntModel ontoModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
ontoModel.read(xxxxx, null);
ExtendedIterator<OntClass> iter = ontoModel.listClasses();
while (iter.hasNext()) {
if(ontClass.isAnon()) {
//Add URL to the anonymous ontClass
String newURL = getNewURL();
//ontClass.addProperty(ontoModel.createProperty("rdf","about") , newURL);// I tried this, but it is useless
}
}
Ich brauche eine URL für die ontClass zu geben. Also könnte es zu einer URLResource wechseln und ich könnte die URL von ontClass.getURL() erhalten.