• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java OWLSubPropertyAxiom类的典型用法和代码示例

java 2次浏览

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

OWLSubPropertyAxiom类属于org.semanticweb.owlapi.model包,在下文中一共展示了OWLSubPropertyAxiom类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addSubPropertyAxiom

点赞 3

import org.semanticweb.owlapi.model.OWLSubPropertyAxiom; //导入依赖的package包/类
private void addSubPropertyAxiom(OWLSubPropertyAxiom<?> axiom)
{
   OWLPropertyExpression<?,?> subProperty = axiom.getSubProperty();
   OWLPropertyExpression<?,?> superProperty = axiom.getSuperProperty();
   
   OwlNode<OWLPropertyExpression<?,?>> subClassNode = createNode(subProperty);
   OwlNode<OWLPropertyExpression<?,?>> superClassNode = createNode(superProperty);
   
   if (mPropertyCache.contains(subProperty)) {
      subClassNode = findNode(subProperty);
      superClassNode.setParent(subClassNode.getParent());
      subClassNode.setParent(superClassNode);
   }
   else if (mPropertyCache.contains(superProperty)) {
      superClassNode = findNode(superProperty);
      subClassNode.setParent(superClassNode);
   }
   else {
      superClassNode.setParent(mRoot);
      subClassNode.setParent(superClassNode);
   }
   mPropertyCache.add(subProperty);
   mPropertyCache.add(superProperty);
}
 

开发者ID:obidea,
项目名称:semantika,
代码行数:25,
代码来源:OwlPropertyStructureHandler.java

示例2: getSuperProperties

点赞 2

import org.semanticweb.owlapi.model.OWLSubPropertyAxiom; //导入依赖的package包/类
public static Set<OWLObjectPropertyExpression> getSuperProperties(OWLObjectPropertyExpression prop, OWLOntology ont) {
	Set<OWLObjectPropertyExpression> result = new HashSet<>();
	Set<OWLSubObjectPropertyOfAxiom> axioms = ont.getObjectSubPropertyAxiomsForSubProperty(prop);
	for (OWLSubPropertyAxiom<OWLObjectPropertyExpression> axiom : axioms) {
		result.add(axiom.getSuperProperty());
	}
	return result;
}
 

开发者ID:owlcollab,
项目名称:owltools,
代码行数:9,
代码来源:OwlHelper.java

示例3: visit

点赞 2

import org.semanticweb.owlapi.model.OWLSubPropertyAxiom; //导入依赖的package包/类
/**
 * A utility method to process OWL <code>SubDataPropertyOf(DPE1 DPE2)</code> axiom and produce
 * inferred mapping assertions.
 */
@Override
public void visit(OWLSubDataPropertyOfAxiom axiom)
{
   /*
    * Trace all the ancestors of the data property expression in the given OWL SubDataPropertyOf axiom.
    */
   Set<OWLSubPropertyAxiom<?>> ancestors = mOntology.traceAncestors(axiom.getSubProperty(), true);
   for (OWLSubPropertyAxiom<?> ax : ancestors) {
      /*
       * Get all (copy) known mappings for the visited sub data property expression.
       */
      OWLDataPropertyExpression subProperty = (OWLDataPropertyExpression) ax.getSubProperty();
      subProperty.accept(this); // this call will produce (sub property) mSignature
      Set<IMapping> subPropertyMappings = getMappingsForPropertyExpression();
      if (subPropertyMappings.isEmpty()) {
         continue;
      }
      /*
       * Produce the "extra" mappings for the visited super data property expression as many as
       * the known mappings in the sub data property expression.
       */
      OWLDataPropertyExpression superProperty = (OWLDataPropertyExpression) ax.getSuperProperty();
      superProperty.accept(this); // this call will produce (super property) mSignature and mIsInverse
      URI superPropertySignature = mSignature;
      for (IMapping subPropertyMapping : subPropertyMappings) {
         IPropertyMapping pm = createPropertyMapping(superPropertySignature, subPropertyMapping, mIsInverse);
         addInferredMapping(pm);
      }
   }
}
 

开发者ID:obidea,
项目名称:semantika,
代码行数:35,
代码来源:TMappingProcessor.java

示例4: equals

点赞 2

import org.semanticweb.owlapi.model.OWLSubPropertyAxiom; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (!super.equals(obj)) {
        return false;
    }
    if (!(obj instanceof OWLSubPropertyAxiom)) {
        return false;
    }
    OWLSubPropertyAxiom<?> other = (OWLSubPropertyAxiom<?>) obj;
    return other.getSubProperty().equals(subProperty)
            && other.getSuperProperty().equals(superProperty);
}
 

开发者ID:matthewhorridge,
项目名称:owlapi-gwt,
代码行数:16,
代码来源:OWLSubPropertyAxiomImpl.java

示例5: compareObjectOfSameType

点赞 2

import org.semanticweb.owlapi.model.OWLSubPropertyAxiom; //导入依赖的package包/类
@Override
protected int compareObjectOfSameType(OWLObject object) {
    OWLSubPropertyAxiom<?> other = (OWLSubPropertyAxiom<?>) object;
    int diff = subProperty.compareTo(other.getSubProperty());
    if (diff != 0) {
        return diff;
    }
    return superProperty.compareTo(other.getSuperProperty());
}
 

开发者ID:matthewhorridge,
项目名称:owlapi-gwt,
代码行数:10,
代码来源:OWLSubPropertyAxiomImpl.java

示例6: axiomSetToHTML

点赞 2

import org.semanticweb.owlapi.model.OWLSubPropertyAxiom; //导入依赖的package包/类
private static String axiomSetToHTML(Set<Object> set, boolean isAddition, Properties lang){
    String v = "";
    String message;
    if(isAddition){
        message=lang.getProperty(Constants.LANG_ADDED)+": ";
    }else{
        message=lang.getProperty(Constants.LANG_DELETED)+": ";
    }
    for(Object f:set){
        try{
            v+="<li>";
            if(f instanceof OWLSubClassOfAxiom){
                v+=message+lang.getProperty(Constants.LANG_SUBCLASS_OF) +" "+ ((OWLSubClassOfAxiom)f).getSuperClass().asOWLClass().getIRI();
            }else if(f instanceof OWLSubPropertyAxiom){
                OWLPropertyExpression prop = ((OWLSubPropertyAxiom)f).getSuperProperty();
                if(prop instanceof OWLObjectPropertyImpl){
                    v+=message+lang.getProperty(Constants.LANG_SUBPROP_OF) +" "+ ((OWLObjectPropertyImpl)prop).getIRI();
                }else if(prop instanceof OWLDataPropertyImpl){
                    v+=message+lang.getProperty(Constants.LANG_SUBPROP_OF) +" "+ ((OWLDataPropertyImpl)prop).getIRI();
                }
            }else if(f instanceof OWLObjectPropertyDomainAxiom){
                v+=message+Constants.LANG_DOMAIN+" "+expressionToHTML(((OWLObjectPropertyDomainAxiom)f).getDomain(), lang);
            }else if(f instanceof OWLDataPropertyDomainAxiom){
                v+=message+lang.getProperty(Constants.LANG_DOMAIN)+" "+expressionToHTML(((OWLDataPropertyDomainAxiom)f).getDomain(), lang);
            }else if(f instanceof OWLObjectPropertyRangeAxiom){
                v+=message+lang.getProperty(Constants.LANG_RANGE)+" "+expressionToHTML(((OWLObjectPropertyRangeAxiom)f).getRange(), lang);
            }else if(f instanceof OWLDataPropertyRangeAxiom){
                v+=message+lang.getProperty(Constants.LANG_RANGE)+" "+((OWLDataPropertyRangeAxiom)f).getRange().asOWLDatatype().getIRI();
            }else if(f instanceof OWLAnnotationAssertionAxiom){
                v+= message+((OWLAnnotationAssertionAxiom)f).getProperty().toString() +" "+ ((OWLAnnotationAssertionAxiom)f).getValue().toString();
            }else{
                //other less typical axioms
                v+=message+((OWLAxiom)f).getAxiomType().getName()+" "+f.toString().replace("<", "&lt;").replace(">", "&gt;");
            }
            /**
             * To add if we want to refine
             * OWLDisjointClassesAxiom, OWLDisjointDataPropertiesAxiom, OWLDisjointObjectPropertiesAxiom,
             * OWLEquivalentClassesAxiom, OWLEquivalentDataPropertiesAxiom, OWLEquivalentObjectPropertiesAxiom, 
             * OWLFunctionalDataPropertyAxiom, OWLFunctionalObjectPropertyAxiom,
             */
            v+="</li>\n";
        }catch (Exception e){
            System.out.println("Error while transforming "+f.toString() +" "+e.getMessage());
        }
            
    }
    
    return v;
}
 

开发者ID:dgarijo,
项目名称:Widoco,
代码行数:50,
代码来源:OntologyDifferencesRenderer.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)