当前位置: 首页>>代码示例>>Java>>正文


Java OWLEntity.isOWLClass方法代码示例

本文整理汇总了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;
}
 
开发者ID:lmazuel,项目名称:onagui,代码行数:25,代码来源:OWLAPIContainer.java

示例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;
}
 
开发者ID:lmazuel,项目名称:onagui,代码行数:24,代码来源:OWLAPIContainer.java

示例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);

	}
}
 
开发者ID:julianmendez,项目名称:jcel,代码行数:26,代码来源:AxiomTranslator.java

示例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);
		}
	}
	
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:16,代码来源:BasicMultiplePartitioning.java


注:本文中的org.semanticweb.owlapi.model.OWLEntity.isOWLClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。