我想向rdfs:label
添加OWLIndividual
,我有以下内容:
OWLIndividual newIndividual = factory.getOWLNamedIndividual(IRI.create(name));
OWLLiteral lbl = factory.getOWLLiteral(name);
OWLAnnotation label =
factory.getOWLAnnotation(
factory.getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL.getIRI()), lbl);
现在,我如何将标签与个人联系起来?
答案 0 :(得分:2)
您可以通过以下方式关联标签:
OWLAxiom axiom = factory.getOWLAnnotationAssertionAxiom(newIndividual.asOWLNamedIndividual().getIRI(), label);
manager.applyChange(new AddAxiom(ontology, axiom));
在这种情况下,您需要使用NamedIndividual
来检索IRI以断言注释。