本文整理匯總了Java中org.semanticweb.owlapi.model.OWLOntology.getDeclarationAxioms方法的典型用法代碼示例。如果您正苦於以下問題:Java OWLOntology.getDeclarationAxioms方法的具體用法?Java OWLOntology.getDeclarationAxioms怎麽用?Java OWLOntology.getDeclarationAxioms使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.semanticweb.owlapi.model.OWLOntology
的用法示例。
在下文中一共展示了OWLOntology.getDeclarationAxioms方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addBioEntity
import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
private void addBioEntity(OWLClass pr, OWLOntology lego, Bioentity bioentity) {
Set<OWLDeclarationAxiom> declarationAxioms = lego.getDeclarationAxioms(pr);
if (declarationAxioms == null || declarationAxioms.isEmpty()) {
// add class declaration and add label
OWLOntologyManager m = lego.getOWLOntologyManager();
OWLDataFactory f = m.getOWLDataFactory();
Set<OWLAxiom> axioms = new HashSet<OWLAxiom>();
axioms.add(f.getOWLDeclarationAxiom(pr));
String label = bioentity.getSymbol()+" - "+bioentity.getFullName();
axioms.add(f.getOWLAnnotationAssertionAxiom(f.getRDFSLabel(), pr.getIRI(), f.getOWLLiteral(label)));
m.addAxioms(lego, axioms);
}
}
示例2: getDcSourceProperty
import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
private OWLAnnotationProperty getDcSourceProperty(OWLOntology lego, OWLDataFactory f) {
OWLAnnotationProperty p = f.getOWLAnnotationProperty(DC_SOURCE);
Set<OWLDeclarationAxiom> declarationAxioms = lego.getDeclarationAxioms(p);
if (declarationAxioms == null || declarationAxioms.isEmpty()) {
OWLOntologyManager m = lego.getOWLOntologyManager();
m.addAxiom(lego, f.getOWLDeclarationAxiom(p));
}
return p;
}
示例3: getOWLIndividual
import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
/**
* Returns an OWLNamedIndividual with this IRI <b>if it has been declared</b>
* in the source or support ontologies. Returns null otherwise.
*
* @param iri
* @return {@link OWLNamedIndividual}
*/
public OWLNamedIndividual getOWLIndividual(IRI iri) {
OWLNamedIndividual c = getDataFactory().getOWLNamedIndividual(iri);
for (OWLOntology o : getAllOntologies()) {
for (OWLDeclarationAxiom da : o.getDeclarationAxioms(c)) {
if (da.getEntity() instanceof OWLNamedIndividual) {
return (OWLNamedIndividual) da.getEntity();
}
}
}
return null;
}