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


Java OWLObjectPropertyExpression.asOWLObjectProperty方法代码示例

本文整理汇总了Java中org.semanticweb.owlapi.model.OWLObjectPropertyExpression.asOWLObjectProperty方法的典型用法代码示例。如果您正苦于以下问题:Java OWLObjectPropertyExpression.asOWLObjectProperty方法的具体用法?Java OWLObjectPropertyExpression.asOWLObjectProperty怎么用?Java OWLObjectPropertyExpression.asOWLObjectProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.semanticweb.owlapi.model.OWLObjectPropertyExpression的用法示例。


在下文中一共展示了OWLObjectPropertyExpression.asOWLObjectProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkPotentialRedundantSubClassAxioms

import org.semanticweb.owlapi.model.OWLObjectPropertyExpression; //导入方法依赖的package包/类
/**
 * Check all classes for potential redundant subClass axioms of type:
 * <pre>
 *   A SubClassOf R some B
 *    and
 *   A SubClassOf B
 * </pre>
 * 
 * @return list of axiom pairs
 */
public List<PotentialRedundant> checkPotentialRedundantSubClassAxioms() {
	List<PotentialRedundant> result = new ArrayList<PotentialRedundant>();
	for(OWLClass cls : graph.getAllOWLClasses()) {
		Set<OWLSubClassOfAxiom> axioms = graph.getAllOWLSubClassOfAxiomsForSubClass(cls);
		if (axioms.size() > 1) {
			// only check sets with more than one axiom
			for (OWLSubClassOfAxiom main : axioms) {
				OWLClassExpression mainSuperClassCE = main.getSuperClass();
				if (mainSuperClassCE.isAnonymous()) {
					continue;
				}
				OWLClass mainSuperClass = mainSuperClassCE.asOWLClass();
				for (OWLSubClassOfAxiom current : axioms) {
					if (main == current) {
						continue;
					}
					OWLClassExpression currentSuperClass = current.getSuperClass();
					if (currentSuperClass.isAnonymous() && currentSuperClass instanceof OWLObjectSomeValuesFrom) {
						OWLObjectSomeValuesFrom someValuesFrom = (OWLObjectSomeValuesFrom) currentSuperClass;
						final OWLClassExpression filler = someValuesFrom.getFiller();
						if (mainSuperClass.equals(someValuesFrom.getFiller())) {
							final OWLObjectPropertyExpression property = someValuesFrom.getProperty();
							final OWLClassExpression subClass = current.getSubClass();
							final PotentialRedundant redundant = new PotentialRedundant(main, current, subClass.asOWLClass(), property.asOWLObjectProperty(), filler.asOWLClass());
							result.add(redundant);
						}
					}
				}
			}
		}
	}
	
	if (!result.isEmpty()) {
		return result;
	}
	return null;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:48,代码来源:InferenceBuilder.java

示例2: OWLQuantifiedProperty

import org.semanticweb.owlapi.model.OWLObjectPropertyExpression; //导入方法依赖的package包/类
public OWLQuantifiedProperty(OWLObjectPropertyExpression p, Quantifier q) {
	if (p != null) {
		if (p instanceof OWLObjectInverseOf) {
			isInverseOf = true;
			p = ((OWLObjectInverseOf)p).getInverse();
		}
		property = p.asOWLObjectProperty();
	}
	this.quantifier = q;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:11,代码来源:OWLQuantifiedProperty.java

示例3: asOWLObjectProperty

import org.semanticweb.owlapi.model.OWLObjectPropertyExpression; //导入方法依赖的package包/类
private OWLObjectProperty asOWLObjectProperty(OWLObjectPropertyExpression expression) {
	if (!(expression instanceof OWLObjectProperty)) {
		throw new TranslationException("Object property expression cannot be translated: '" + expression + "'.");
	}
	return expression.asOWLObjectProperty();
}
 
开发者ID:julianmendez,项目名称:jcel,代码行数:7,代码来源:AxiomTranslator.java


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