本文整理汇总了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;
}