I am editing ontologies for a project in JAVA with org.semanticweb.owlapi.model.OWLOntology. I need to find a solution about adding multiple labels to an owl class.
For any class c from OWL-API, I can get its label via c.getIRI(). But how can I add the second label to this class?
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLOntologyManager;
private static void addMultipleLabel() {
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLDataFactory factory = manager.getOWLDataFactory();
IRI iri_1 = IRI.create("my_first_label");
IRI iri_2 = IRI.create("my_second_label");
OWLClass myClass = factory.getOWLClass(iri_1);
// how to assign also iri_2 to myClass
}
I found in SKOS, there is a possibility to add several labels for a class. But, using SKOS:altLabel requires that I define my owl class as a SKOS concept, which it put me in a challenge to change all my used models in the project.
Is there any clue, how can I add multiple labels for an OWL-API Class?
Thanks in advance for your suggestion and help.
Thanks to Ignazio,
so I correct it like this: