Java 类org.semanticweb.owlapi.model.OWLObjectInverseOf 实例源码

项目:owltools    文件:OWLInAboxTranslator.java   
/**
 * @param p
 * @return type-level form of relation
 */
private OWLObjectPropertyExpression trTypeLevel(
        OWLObjectPropertyExpression p) {
    if (!this.isTranslateObjectProperty) {
        return p;
    }
    if (p instanceof OWLObjectInverseOf) {
        OWLObjectPropertyExpression p2 = trTypeLevel(((OWLObjectInverseOf)p).getInverse());
        return getOWLDataFactory().getOWLObjectInverseOf(p2);
    }
    else {
        instanceLevelRelations.add((OWLObjectProperty)p);
        IRI iri = ((OWLObjectProperty) p).getIRI();
        return trTypeLevel(iri);
    }
}
项目:HermiT-android    文件:ObjectPropertyInclusionManager.java   
protected Map<OWLObjectPropertyExpression,Set<OWLObjectPropertyExpression>> buildInversePropertiesMap(Collection<OWLObjectPropertyExpression[]> simpleObjectPropertyInclusions) {
    Map<OWLObjectPropertyExpression,Set<OWLObjectPropertyExpression>> inversePropertiesMap=new HashMap<OWLObjectPropertyExpression,Set<OWLObjectPropertyExpression>>();
    for (OWLObjectPropertyExpression[] inclusion : simpleObjectPropertyInclusions)
        if (inclusion[1] instanceof OWLObjectInverseOf) {
            Set<OWLObjectPropertyExpression> inverseProperties=inversePropertiesMap.get(inclusion[0]);
            if (inverseProperties==null)
                inverseProperties=new HashSet<OWLObjectPropertyExpression>();
            inverseProperties.add(inclusion[1].getInverseProperty().getSimplified());
            inversePropertiesMap.put(inclusion[0],inverseProperties);
        }
    return inversePropertiesMap;
}
项目:HermiT-android    文件:OWLClausification.java   
protected static Role getRole(OWLObjectPropertyExpression objectPropertyExpression) {
    objectPropertyExpression=objectPropertyExpression.getSimplified();
    if (objectPropertyExpression instanceof OWLObjectProperty)
        return AtomicRole.create(((OWLObjectProperty)objectPropertyExpression).getIRI().toString());
    else if (objectPropertyExpression instanceof OWLObjectInverseOf) {
        OWLObjectPropertyExpression internal=((OWLObjectInverseOf)objectPropertyExpression).getInverse();
        if (!(internal instanceof OWLObjectProperty))
            throw new IllegalStateException("Internal error: invalid normal form.");
        return AtomicRole.create(((OWLObjectProperty)internal).getIRI().toString()).getInverse();
    }
    else
        throw new IllegalStateException("Internal error: invalid normal form.");
}
项目:Hermit_1.3.8_android    文件:ObjectPropertyInclusionManager.java   
protected Map<OWLObjectPropertyExpression,Set<OWLObjectPropertyExpression>> buildInversePropertiesMap(Collection<OWLObjectPropertyExpression[]> simpleObjectPropertyInclusions) {
    Map<OWLObjectPropertyExpression,Set<OWLObjectPropertyExpression>> inversePropertiesMap=new HashMap<OWLObjectPropertyExpression,Set<OWLObjectPropertyExpression>>();
    for (OWLObjectPropertyExpression[] inclusion : simpleObjectPropertyInclusions)
        if (inclusion[1] instanceof OWLObjectInverseOf) {
            Set<OWLObjectPropertyExpression> inverseProperties=inversePropertiesMap.get(inclusion[0]);
            if (inverseProperties==null)
                inverseProperties=new HashSet<OWLObjectPropertyExpression>();
            inverseProperties.add(inclusion[1].getInverseProperty().getSimplified());
            inversePropertiesMap.put(inclusion[0],inverseProperties);
        }
    return inversePropertiesMap;
}
项目:Hermit_1.3.8_android    文件:OWLClausification.java   
protected static Role getRole(OWLObjectPropertyExpression objectPropertyExpression) {
    objectPropertyExpression=objectPropertyExpression.getSimplified();
    if (objectPropertyExpression instanceof OWLObjectProperty)
        return AtomicRole.create(((OWLObjectProperty)objectPropertyExpression).getIRI().toString());
    else if (objectPropertyExpression instanceof OWLObjectInverseOf) {
        OWLObjectPropertyExpression internal=((OWLObjectInverseOf)objectPropertyExpression).getInverse();
        if (!(internal instanceof OWLObjectProperty))
            throw new IllegalStateException("Internal error: invalid normal form.");
        return AtomicRole.create(((OWLObjectProperty)internal).getIRI().toString()).getInverse();
    }
    else
        throw new IllegalStateException("Internal error: invalid normal form.");
}
项目:owltools    文件:TemplatedTransformer.java   
private BindingSet unify(OWLObjectPropertyExpression p,
        OWLObjectPropertyExpression template,  Set<IRI> vars) {
    if (p instanceof OWLObjectProperty && template instanceof OWLObjectProperty) {
        return unify(((OWLObjectProperty) p).getIRI(),
                ((OWLObjectProperty) template).getIRI(),
                vars);
    }
    if (p instanceof OWLObjectInverseOf && template instanceof OWLObjectInverseOf) {
        return unify(((OWLObjectInverseOf)p).getInverse(),
                ((OWLObjectInverseOf)template).getInverseProperty(),
                vars);
    }
    return null;
}
项目:owltools    文件:TemplatedTransformer.java   
private OWLObjectPropertyExpression replaceVariables(
        OWLObjectPropertyExpression p, BindingSet bset) {
    if (p instanceof OWLObjectProperty) {
        IRI y = replaceIRI(((OWLObjectProperty)p).getIRI(), bset);
        return getOWLDataFactory().getOWLObjectProperty(y);
    }
    if (p instanceof OWLObjectInverseOf) {
        return getOWLDataFactory().getOWLObjectInverseOf(
                 replaceVariables(((OWLObjectInverseOf)p).getInverse(),
                         bset));
    }
    return null;
}
项目:owltools    文件:OWLQuantifiedProperty.java   
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;
}
项目:Wolpertinger    文件:DebugTranslation.java   
public void visit(OWLSubPropertyChainOfAxiom arg0) {
    // TODO Auto-generated method stub
    String superPropertyName = null;
    OWLObjectPropertyExpression superPropertyExpression = arg0.getSuperProperty();

    int counter = 1;
    writer.print("icons :-");

    for (OWLObjectPropertyExpression subPropertyExpression : arg0.getPropertyChain()) {
        int firstCounter = counter;
        int secondCounter = ++counter;
        String subPropertyName = null;

        if (subPropertyExpression instanceof OWLObjectInverseOf) {
            int temp = firstCounter;
            firstCounter = secondCounter;
            secondCounter = temp;
            subPropertyName = mapper.getPredicateName(((OWLObjectInverseOf) subPropertyExpression).getInverse().asOWLObjectProperty());
        } else {
            subPropertyName = mapper.getPredicateName(subPropertyExpression.asOWLObjectProperty());
        }

        writer.print(String.format("%s(X%d,X%d),", subPropertyName, firstCounter, secondCounter));
    }
    if (superPropertyExpression instanceof OWLObjectInverseOf) {
        superPropertyName = mapper.getPredicateName(((OWLObjectInverseOf) superPropertyExpression).getInverse().asOWLObjectProperty());
        writer.print(String.format("not %s(X%d,X%d).", superPropertyName, counter, 1));
    } else {
        superPropertyName = mapper.getPredicateName(arg0.getSuperProperty().asOWLObjectProperty());
        writer.print(String.format("not %s(X%d,X%d).", superPropertyName, 1, counter));
    }
}
项目:Wolpertinger    文件:NaiveTranslation.java   
public void visit(OWLSubPropertyChainOfAxiom arg0) {
    // TODO Auto-generated method stub
    String superPropertyName = null;
    OWLObjectPropertyExpression superPropertyExpression = arg0.getSuperProperty();

    int counter = 1;
    writer.print(":-");

    for (OWLObjectPropertyExpression subPropertyExpression : arg0.getPropertyChain()) {
        int firstCounter = counter;
        int secondCounter = ++counter;
        String subPropertyName = null;

        if (subPropertyExpression instanceof OWLObjectInverseOf) {
            int temp = firstCounter;
            firstCounter = secondCounter;
            secondCounter = temp;
            subPropertyName = mapper.getPredicateName(((OWLObjectInverseOf) subPropertyExpression).getInverse().asOWLObjectProperty());
        } else {
            subPropertyName = mapper.getPredicateName(subPropertyExpression.asOWLObjectProperty());
        }

        writer.print(String.format("%s(X%d,X%d),", subPropertyName, firstCounter, secondCounter));
    }
    if (superPropertyExpression instanceof OWLObjectInverseOf) {
        superPropertyName = mapper.getPredicateName(((OWLObjectInverseOf) superPropertyExpression).getInverse().asOWLObjectProperty());
        writer.print(String.format("not %s(X%d,X%d).", superPropertyName, counter, 1));
    } else {
        superPropertyName = mapper.getPredicateName(arg0.getSuperProperty().asOWLObjectProperty());
        writer.print(String.format("not %s(X%d,X%d).", superPropertyName, 1, counter));
    }
}
项目:jcel    文件:ObjectPropertyExpressionTranslator.java   
@Override
public IntegerObjectPropertyExpression visit(OWLObjectInverseOf property) {
    Objects.requireNonNull(property);
    IntegerObjectPropertyExpression propExpr = property.getInverse().accept(this);
    IntegerObjectPropertyExpression ret;
    if (propExpr instanceof IntegerObjectProperty) {
        ret = getDataTypeFactory().createObjectInverseOf((IntegerObjectProperty) propExpr);
    } else if (propExpr instanceof IntegerObjectInverseOf) {
        ret = ((IntegerObjectInverseOf) propExpr).getInverse();
    } else {
        throw new IllegalArgumentException("Object property expression cannot be translated: " + property);
    }

    return ret;
}
项目:semantika    文件:OwlClassStructureHandler.java   
private OWLSubClassOfAxiom asSubClassOfAxiom(OWLObjectPropertyRangeAxiom axiom)
{
   OWLObjectInverseOf inverseExpression = mOwlDataFactory.getOWLObjectInverseOf(axiom.getProperty());
   OWLClassExpression classExpression = axiom.getRange();
   OWLClassExpression sub = mOwlDataFactory.getOWLObjectSomeValuesFrom(inverseExpression, mOwlDataFactory.getOWLThing());
   return mOwlDataFactory.getOWLSubClassOfAxiom(sub, classExpression);
}
项目:owlapi-gwt    文件:OWLObjectInverseOfImpl.java   
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (!super.equals(obj)) {
        return false;
    }
    if (!(obj instanceof OWLObjectInverseOf)) {
        return false;
    }
    return ((OWLObjectInverseOf) obj).getInverse().equals(inverseProperty);
}
项目:owlapi-gwt    文件:OWLObjectPropertyAssertionAxiomImpl.java   
@Override
public OWLObjectPropertyAssertionAxiom getSimplified() {
    if (!getProperty().isAnonymous()) {
        return this;
    } else {
        OWLObjectInverseOf property = (OWLObjectInverseOf) getProperty();
        OWLObjectPropertyExpression invProp = property.getInverse();
        return new OWLObjectPropertyAssertionAxiomImpl(getObject(),
                invProp, getSubject(), NO_ANNOTATIONS);
    }
}
项目:elk-reasoner    文件:AbstractElkObjectConverter.java   
@Override
public OWLObjectInverseOf visit(ElkObjectInverseOf expression) {
    return owlFactory_
            .getOWLObjectInverseOf(convert(expression.getObjectProperty()));
}
项目:elk-reasoner    文件:OwlObjectInverseOfConverterVisitor.java   
@Override
public ElkObjectPropertyExpression visit(OWLObjectInverseOf property) {
    return property.getInverse().accept(OWL_OBJECT_PROPERTRY_CONVERTER_);
}
项目:elk-reasoner    文件:OwlObjectPropertyExpressionConverterVisitor.java   
@Override
public ElkObjectPropertyExpression visit(OWLObjectInverseOf property) {
    return property.getInverse().accept(OWL_OBJECT_INVERSE_OF_CONVERTER_);
}
项目:Wolpertinger    文件:NaiveTranslation.java   
public void visit(OWLObjectInverseOf arg0) {
}
项目:born    文件:ElPropertyExpressionFilter.java   
@Override
public Boolean visit(OWLObjectInverseOf propertyExpression) {
    return false;
}
项目:semantika    文件:OwlObjectHandler.java   
@Override
public void visit(OWLObjectInverseOf expr)
{
   mIsInverse = true;
   mSignature = expr.getInverse().asOWLObjectProperty().getIRI().toURI();
}
项目:semantika    文件:TMappingProcessor.java   
private OWLSubClassOfAxiom asSubClassOfAxiom(OWLObjectPropertyRangeAxiom axiom)
{
   OWLObjectInverseOf inv = sOwlDataFactory.getOWLObjectInverseOf(axiom.getProperty());
   OWLClassExpression sub = sOwlDataFactory.getOWLObjectSomeValuesFrom(inv, sOwlDataFactory.getOWLThing());
   return sOwlDataFactory.getOWLSubClassOfAxiom(sub, axiom.getRange());
}
项目:owlapi-gwt    文件:OWLObjectVisitorExAdapter.java   
@Override
public O visit(OWLObjectInverseOf property) {
    return doDefault(property);
}
项目:owlapi-gwt    文件:OWLObjectVisitorAdapter.java   
@Override
public void visit(OWLObjectInverseOf property) {
    handleDefault(property);
}
项目:owlapi-gwt    文件:OWLObjectTypeIndexProvider.java   
@Override
public void visit(OWLObjectInverseOf property) {
    type = OBJECT_PROPERTY_INVERSE;
}
项目:owlapi-gwt    文件:HashCode.java   
@Override
public void visit(OWLObjectInverseOf property) {
    hashCode = primes[57];
    hashCode = hashCode * MULT + property.getInverse().hashCode();
}
项目:owlapi-gwt    文件:AbstractEntityRegistrationManager.java   
@Override
public void visit(@Nonnull OWLObjectInverseOf property) {
    property.getInverse().accept(this);
}
项目:owlapi-gwt    文件:OWLObjectInverseOfImpl.java   
@Override
protected int compareObjectOfSameType(OWLObject object) {
    return inverseProperty.compareTo(((OWLObjectInverseOf) object)
            .getInverse());
}
项目:SVoNt    文件:PelletOWL2ELProfile.java   
public Object visit(OWLObjectInverseOf property) {
  profileViolations.add(new UseOfObjectPropertyInverse(getCurrentOntology(), getCurrentAxiom(), property));
  return null;
}
项目:binaryowl    文件:OWLObjectInverseOfSerializer.java   
@Override
protected void writeObject(OWLObjectInverseOf object, BinaryOWLOutputStream outputStream) throws IOException {
    outputStream.writeOWLObject(object.getInverse());
}
项目:binaryowl    文件:OWLObjectInverseOfSerializer.java   
@Override
protected OWLObjectInverseOf readObject(BinaryOWLInputStream inputStream) throws IOException, BinaryOWLParseException {
    OWLObjectPropertyExpression inverse = inputStream.readOWLObject();
    return inputStream.getDataFactory().getOWLObjectInverseOf(inverse);
}
项目:Wolpertinger    文件:DebugTranslation.java   
public void visit(OWLObjectInverseOf arg0) {
    // TODO Auto-generated method stub

}
项目:Wolpertinger    文件:DirectTranslation.java   
public void visit(OWLObjectInverseOf arg0) {
    // TODO Auto-generated method stub

}