本文整理汇总了Java中org.semanticweb.owlapi.model.OWLEntity.isOWLClass方法的典型用法代码示例。如果您正苦于以下问题:Java OWLEntity.isOWLClass方法的具体用法?Java OWLEntity.isOWLClass怎么用?Java OWLEntity.isOWLClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLEntity
的用法示例。
在下文中一共展示了OWLEntity.isOWLClass方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChildren
import org.semanticweb.owlapi.model.OWLEntity; //导入方法依赖的package包/类
@Override
public Set<OWLEntity> getChildren(OWLEntity cpt) {
if(!cpt.isOWLClass()) return new HashSet<OWLEntity>();
Set<OWLEntity> entities = new HashSet<OWLEntity>();
Set<OWLEntity> result = new HashSet<OWLEntity>();
OWLClass localRootClass = cpt.asOWLClass();
entities.addAll(reasoner.getSubClasses(localRootClass, true).getFlattened());
entities.addAll(reasoner.getInstances(localRootClass, true).getFlattened());
for(OWLEntity child : entities) {
// Only Class or Named individual
if(!child.isOWLClass() && !child.isOWLNamedIndividual())
{
continue;
}
// Not Nothing
if(child.isOWLClass() && child.asOWLClass().isOWLNothing())
{
continue;
}
result.add(child);
}
return result;
}
示例2: getParents
import org.semanticweb.owlapi.model.OWLEntity; //导入方法依赖的package包/类
@Override
public Set<OWLEntity> getParents(OWLEntity cpt) {
if(!cpt.isOWLClass()) return new HashSet<OWLEntity>();
Set<OWLEntity> entities = new HashSet<OWLEntity>();
Set<OWLEntity> result = new HashSet<OWLEntity>();
OWLClass localRootClass = cpt.asOWLClass();
entities.addAll(reasoner.getSuperClasses(localRootClass, true).getFlattened());
for(OWLEntity parentClass : entities) {
// Only Class
if(!parentClass.isOWLClass())
{
continue;
}
// Not Nothing
if(parentClass.isOWLClass() && parentClass.asOWLClass().isOWLNothing())
{
continue;
}
result.add(parentClass);
}
return result;
}
示例3: visit
import org.semanticweb.owlapi.model.OWLEntity; //导入方法依赖的package包/类
@Override
public Set<ComplexIntegerAxiom> visit(OWLDeclarationAxiom axiom) {
Objects.requireNonNull(axiom);
OWLEntity entity = axiom.getEntity();
if (entity.isOWLClass()) {
return declare(entity.asOWLClass(), axiom.getAnnotations());
} else if (entity.isOWLObjectProperty()) {
return declare(entity.asOWLObjectProperty(), axiom.getAnnotations());
} else if (entity.isOWLNamedIndividual()) {
return declare(entity.asOWLNamedIndividual(), axiom.getAnnotations());
} else if (entity.isOWLDataProperty()) {
return declare(entity.asOWLDataProperty(), axiom.getAnnotations());
} else if (entity.isOWLAnnotationProperty()) {
// FIXME add annotation property
return Collections.emptySet();
} else {
throw TranslationException.newUnsupportedAxiomException(axiom);
}
}
示例4: createTaskClassIdentifiers
import org.semanticweb.owlapi.model.OWLEntity; //导入方法依赖的package包/类
private void createTaskClassIdentifiers(OntologyProcessing4Overlapping ontology_processing, Set<OWLEntity> entities, Set<Integer> identifiers){
int ident;
for (OWLEntity ent: entities){
if (ent.isOWLClass()){ //only for classes
ident = ontology_processing.getIdentifier4Class(ent.asOWLClass());
if (ident>=0)
identifiers.add(ident);
}
}
}