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


Java OWLSubObjectPropertyOfAxiom.getSubProperty方法代码示例

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


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

示例1: visit

import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入方法依赖的package包/类
@Override
public void visit(OWLSubObjectPropertyOfAxiom axiom) {
	OWLObjectPropertyExpression subPropertyExpression = axiom.getSubProperty();
	if(subPropertyExpression.isAnonymous()){
		sparql += objectVar + "<" + subPropertyExpression.getInverseProperty().asOWLObjectProperty().toStringID() + "> " + subjectVar + " .";
	} else {
		sparql += subjectVar + "<" + subPropertyExpression.asOWLObjectProperty().toStringID() + "> " + objectVar + " .";
	}
	
	OWLObjectPropertyExpression superPropertyExpression = axiom.getSuperProperty();
	if(superPropertyExpression.isAnonymous()){
		sparql += objectVar + "<" + superPropertyExpression.getInverseProperty().asOWLObjectProperty().toStringID() + "> " + subjectVar + " .";
	} else {
		sparql += subjectVar + "<" + superPropertyExpression.asOWLObjectProperty().toStringID() + "> " + objectVar + " .";
	}
}
 
开发者ID:SmartDataAnalytics,项目名称:OWL2SPARQL,代码行数:17,代码来源:OWLAxiomToSPARQLConverter.java

示例2: getAssertedSubProperties

import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入方法依赖的package包/类
/**
 * Find all asserted direct sub properties of the parent property.
 * 
 * @param parent
 * @param g
 * @return set
 */
public static Set<OWLObjectProperty> getAssertedSubProperties(OWLObjectProperty parent, OWLGraphWrapper g) {
	Set<OWLObjectProperty> properties = new HashSet<OWLObjectProperty>();
	for(OWLOntology ont : g.getAllOntologies()) {
		Set<OWLSubObjectPropertyOfAxiom> axioms = ont.getObjectSubPropertyAxiomsForSuperProperty(parent);
		for (OWLSubObjectPropertyOfAxiom axiom : axioms) {
			OWLObjectPropertyExpression subProperty = axiom.getSubProperty();
			if (subProperty instanceof OWLObjectProperty) {
				properties.add(subProperty.asOWLObjectProperty());
			}
		}
	}
	return properties;
}
 
开发者ID:geneontology,项目名称:minerva,代码行数:21,代码来源:StartUpTool.java

示例3: visit

import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入方法依赖的package包/类
@Override
public Set<ComplexIntegerAxiom> visit(OWLSubObjectPropertyOfAxiom axiom) throws TranslationException {
	Objects.requireNonNull(axiom);
	OWLObjectPropertyExpression leftPropExpr = axiom.getSubProperty();
	OWLObjectPropertyExpression rightPropExpr = axiom.getSuperProperty();
	ComplexIntegerAxiom ret = getAxiomFactory().createSubObjectPropertyOfAxiom(
			translateObjectPropertyExpression(leftPropExpr), translateObjectPropertyExpression(rightPropExpr),
			translateAnnotations(axiom.getAnnotations()));
	return Collections.singleton(ret);
}
 
开发者ID:julianmendez,项目名称:jcel,代码行数:11,代码来源:AxiomTranslator.java

示例4: transformOWLSubObjectPropertyOfAxiom

import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入方法依赖的package包/类
private Axiom transformOWLSubObjectPropertyOfAxiom(OWLSubObjectPropertyOfAxiom a) {
    OWLObjectPropertyExpression sub = a.getSubProperty();
    OWLObjectPropertyExpression sup = a.getSuperProperty();

    Role lhs = new NamedRole(sub.asOWLObjectProperty().toStringID());
    Role rhs = new NamedRole(sup.asOWLObjectProperty().toStringID());

    return new RoleInclusion(new Role[]{lhs}, rhs);
}
 
开发者ID:aehrc,项目名称:ontology-core,代码行数:10,代码来源:OWLImporter.java

示例5: transformOWLEquivalentObjectPropertiesAxiom

import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入方法依赖的package包/类
private List<Axiom> transformOWLEquivalentObjectPropertiesAxiom(
        OWLEquivalentObjectPropertiesAxiom a) {
    List<Axiom> axioms = new ArrayList<Axiom>();
    for (OWLSubObjectPropertyOfAxiom ax : a.asSubObjectPropertyOfAxioms()) {
        OWLObjectPropertyExpression sub = ax.getSubProperty();
        OWLObjectPropertyExpression sup = ax.getSuperProperty();

        axioms.add(
                new RoleInclusion(new NamedRole(sub.asOWLObjectProperty().toStringID()),
                new NamedRole(sup.asOWLObjectProperty().toStringID()))
        );
    }
    return axioms;
}
 
开发者ID:aehrc,项目名称:ontology-core,代码行数:15,代码来源:OWLImporter.java


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