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

项目:HermiT-android    文件:OWLNormalization.java   
public void visit(SWRLObjectPropertyAtom at) {
    OWLObjectPropertyExpression ope=at.getPredicate().getSimplified();
    OWLObjectProperty op=ope.getNamedProperty();
    SWRLVariable variable1;
    SWRLVariable variable2;
    if (ope.isAnonymous()) {
        variable1=getVariableFor(at.getSecondArgument());
        variable2=getVariableFor(at.getFirstArgument());
    }
    else {
        variable1=getVariableFor(at.getFirstArgument());
        variable2=getVariableFor(at.getSecondArgument());

    }
    SWRLAtom newAtom=m_factory.getSWRLObjectPropertyAtom(op,variable1,variable2);
    if (m_isPositive) {
        // head
        m_normalizedHeadAtoms.add(newAtom);
    }
    else {
        // body
        m_normalizedBodyAtoms.add(newAtom);
    }
}
项目:Hermit_1.3.8_android    文件:OWLNormalization.java   
public void visit(SWRLObjectPropertyAtom at) {
    OWLObjectPropertyExpression ope=at.getPredicate().getSimplified();
    OWLObjectProperty op=ope.getNamedProperty();
    SWRLVariable variable1;
    SWRLVariable variable2;
    if (ope.isAnonymous()) {
        variable1=getVariableFor(at.getSecondArgument());
        variable2=getVariableFor(at.getFirstArgument());
    }
    else {
        variable1=getVariableFor(at.getFirstArgument());
        variable2=getVariableFor(at.getSecondArgument());

    }
    SWRLAtom newAtom=m_factory.getSWRLObjectPropertyAtom(op,variable1,variable2);
    if (m_isPositive) {
        // head
        m_normalizedHeadAtoms.add(newAtom);
    }
    else {
        // body
        m_normalizedBodyAtoms.add(newAtom);
    }
}
项目:HermiT-android    文件:OWLNormalization.java   
public void visit(SWRLObjectPropertyAtom atom) {
    if (!(atom.getFirstArgument() instanceof SWRLIndividualArgument) || !(atom.getSecondArgument() instanceof SWRLIndividualArgument))
        throwVarError(atom);
    OWLObjectPropertyExpression ope=atom.getPredicate().getSimplified();
    OWLIndividual first=((SWRLIndividualArgument)atom.getFirstArgument()).getIndividual();
    OWLIndividual second=((SWRLIndividualArgument)atom.getSecondArgument()).getIndividual();
    if (first.isAnonymous() || second.isAnonymous())
        throwAnonIndError(atom);
    if (ope.isAnonymous())
        addFact(m_factory.getOWLObjectPropertyAssertionAxiom(ope.getNamedProperty(),second.asOWLNamedIndividual(),first.asOWLNamedIndividual()));
    else
        addFact(m_factory.getOWLObjectPropertyAssertionAxiom(ope.asOWLObjectProperty(),first.asOWLNamedIndividual(),second.asOWLNamedIndividual()));
}
项目:HermiT-android    文件:OWLClausification.java   
protected void checkRuleAtom(SWRLAtom atom) {
    if (atom instanceof SWRLObjectPropertyAtom) {
        m_containsObjectProperties=true;
        OWLObjectProperty objectProperty=((SWRLObjectPropertyAtom)atom).getPredicate().getNamedProperty();
        boolean isGraphObjectProperty=m_graphObjectProperties.contains(objectProperty);
        boolean isNonGraphObjectProperty=m_objectPropertiesOccurringInOWLAxioms.contains(objectProperty);
        if (isGraphObjectProperty)
            m_containsGraphObjectProperties=true;
        if (isNonGraphObjectProperty)
            m_containsNonGraphObjectProperties=true;
        if (!isGraphObjectProperty && !isNonGraphObjectProperty)
            m_containsUndeterminedObjectProperties=true;
    }
}
项目:HermiT-android    文件:OWLClausification.java   
public Atom visit(SWRLObjectPropertyAtom atom) {
    Variable variable1=toVariable(atom.getFirstArgument());
    Variable variable2=toVariable(atom.getSecondArgument());
    m_abstractVariables.add(variable1);
    m_abstractVariables.add(variable2);
    return getRoleAtom(atom.getPredicate().asOWLObjectProperty(),variable1,variable2);
}
项目:Hermit_1.3.8_android    文件:OWLNormalization.java   
public void visit(SWRLObjectPropertyAtom atom) {
    if (!(atom.getFirstArgument() instanceof SWRLIndividualArgument) || !(atom.getSecondArgument() instanceof SWRLIndividualArgument))
        throwVarError(atom);
    OWLObjectPropertyExpression ope=atom.getPredicate().getSimplified();
    OWLIndividual first=((SWRLIndividualArgument)atom.getFirstArgument()).getIndividual();
    OWLIndividual second=((SWRLIndividualArgument)atom.getSecondArgument()).getIndividual();
    if (first.isAnonymous() || second.isAnonymous())
        throwAnonIndError(atom);
    if (ope.isAnonymous())
        addFact(m_factory.getOWLObjectPropertyAssertionAxiom(ope.getNamedProperty(),second.asOWLNamedIndividual(),first.asOWLNamedIndividual()));
    else
        addFact(m_factory.getOWLObjectPropertyAssertionAxiom(ope.asOWLObjectProperty(),first.asOWLNamedIndividual(),second.asOWLNamedIndividual()));
}
项目:Hermit_1.3.8_android    文件:OWLClausification.java   
protected void checkRuleAtom(SWRLAtom atom) {
    if (atom instanceof SWRLObjectPropertyAtom) {
        m_containsObjectProperties=true;
        OWLObjectProperty objectProperty=((SWRLObjectPropertyAtom)atom).getPredicate().getNamedProperty();
        boolean isGraphObjectProperty=m_graphObjectProperties.contains(objectProperty);
        boolean isNonGraphObjectProperty=m_objectPropertiesOccurringInOWLAxioms.contains(objectProperty);
        if (isGraphObjectProperty)
            m_containsGraphObjectProperties=true;
        if (isNonGraphObjectProperty)
            m_containsNonGraphObjectProperties=true;
        if (!isGraphObjectProperty && !isNonGraphObjectProperty)
            m_containsUndeterminedObjectProperties=true;
    }
}
项目:Hermit_1.3.8_android    文件:OWLClausification.java   
public Atom visit(SWRLObjectPropertyAtom atom) {
    Variable variable1=toVariable(atom.getFirstArgument());
    Variable variable2=toVariable(atom.getSecondArgument());
    m_abstractVariables.add(variable1);
    m_abstractVariables.add(variable2);
    return getRoleAtom(atom.getPredicate().asOWLObjectProperty(),variable1,variable2);
}
项目:Wolpertinger    文件:OWLNormalization.java   
public void visit(SWRLObjectPropertyAtom atom) {
    if (!(atom.getFirstArgument() instanceof SWRLIndividualArgument) || !(atom.getSecondArgument() instanceof SWRLIndividualArgument))
        throwVarError(atom);
    OWLObjectPropertyExpression ope=atom.getPredicate().getSimplified();
    OWLIndividual first=((SWRLIndividualArgument)atom.getFirstArgument()).getIndividual();
    OWLIndividual second=((SWRLIndividualArgument)atom.getSecondArgument()).getIndividual();
    if (first.isAnonymous() || second.isAnonymous())
        throwAnonIndError(atom);
    if (ope.isAnonymous())
        addFact(m_factory.getOWLObjectPropertyAssertionAxiom(ope.getNamedProperty(),second.asOWLNamedIndividual(),first.asOWLNamedIndividual()));
    else
        addFact(m_factory.getOWLObjectPropertyAssertionAxiom(ope.asOWLObjectProperty(),first.asOWLNamedIndividual(),second.asOWLNamedIndividual()));
}
项目:owlapi-gwt    文件:HashCode.java   
@Override
public void visit(SWRLObjectPropertyAtom node) {
    hashCode = primes[64];
    hashCode = hashCode * MULT + node.getFirstArgument().hashCode();
    hashCode = hashCode * MULT + node.getSecondArgument().hashCode();
    hashCode = hashCode * MULT + node.getPredicate().hashCode();
}
项目:owlapi-gwt    文件:SWRLObjectPropertyAtomImpl.java   
@Override
public SWRLObjectPropertyAtom getSimplified() {
    OWLObjectPropertyExpression prop = getPredicate().getSimplified();
    if (prop.equals(getPredicate())) {
        return this;
    } else if (prop.isAnonymous()) {
        // Flip
        return new SWRLObjectPropertyAtomImpl(prop.getInverseProperty()
                .getSimplified(), getSecondArgument(), getFirstArgument());
    } else {
        // No need to flip
        return new SWRLObjectPropertyAtomImpl(prop, getFirstArgument(),
                getSecondArgument());
    }
}
项目:owlapi-gwt    文件:SWRLObjectPropertyAtomImpl.java   
@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof SWRLObjectPropertyAtom)) {
        return false;
    }
    SWRLObjectPropertyAtom other = (SWRLObjectPropertyAtom) obj;
    return other.getPredicate().equals(getPredicate())
            && other.getFirstArgument().equals(getFirstArgument())
            && other.getSecondArgument().equals(getSecondArgument());
}
项目:binaryowl    文件:SWRLObjectPropertyAtomSerializer.java   
@Override
protected SWRLObjectPropertyAtom readObject(BinaryOWLInputStream inputStream) throws IOException, BinaryOWLParseException {
    OWLObjectPropertyExpression predicate = inputStream.readOWLObject();
    SWRLIArgument firstArg = inputStream.readOWLObject();
    SWRLIArgument secondArg = inputStream.readOWLObject();
    return inputStream.getDataFactory().getSWRLObjectPropertyAtom(predicate, firstArg, secondArg);
}
项目:HermiT-android    文件:OWLClausification.java   
protected void makeGraphObjectProperty(SWRLAtom atom) {
    if (atom instanceof SWRLObjectPropertyAtom) {
        OWLObjectProperty objectProperty=((SWRLObjectPropertyAtom)atom).getPredicate().getNamedProperty();
        m_graphObjectProperties.add(objectProperty);
    }
}
项目:HermiT-android    文件:OWLClausification.java   
protected void makeNonGraphObjectProperty(SWRLAtom atom) {
    if (atom instanceof SWRLObjectPropertyAtom) {
        OWLObjectProperty objectProperty=((SWRLObjectPropertyAtom)atom).getPredicate().getNamedProperty();
        m_objectPropertiesOccurringInOWLAxioms.add(objectProperty);
    }
}
项目:Hermit_1.3.8_android    文件:OWLClausification.java   
protected void makeGraphObjectProperty(SWRLAtom atom) {
    if (atom instanceof SWRLObjectPropertyAtom) {
        OWLObjectProperty objectProperty=((SWRLObjectPropertyAtom)atom).getPredicate().getNamedProperty();
        m_graphObjectProperties.add(objectProperty);
    }
}
项目:Hermit_1.3.8_android    文件:OWLClausification.java   
protected void makeNonGraphObjectProperty(SWRLAtom atom) {
    if (atom instanceof SWRLObjectPropertyAtom) {
        OWLObjectProperty objectProperty=((SWRLObjectPropertyAtom)atom).getPredicate().getNamedProperty();
        m_objectPropertiesOccurringInOWLAxioms.add(objectProperty);
    }
}
项目:Wolpertinger    文件:OWLNormalization.java   
public void visit(SWRLObjectPropertyAtom at) {
    OWLObjectPropertyExpression ope=at.getPredicate().getSimplified();
    OWLObjectProperty op=ope.getNamedProperty();

    SWRLIArgument argument1;
    SWRLIArgument argument2;

    if (ope.isAnonymous()) {
        argument1=at.getSecondArgument();
        argument2=at.getFirstArgument();
    }
    else {
        argument1=at.getFirstArgument();
        argument2=at.getSecondArgument();

    }

    SWRLAtom newAtom=m_factory.getSWRLObjectPropertyAtom(op,argument1,argument2);


    /* we omitted the rule normalization from HermiT
    SWRLVariable variable1;
    SWRLVariable variable2;


    if (ope.isAnonymous()) {
        variable1=getVariableFor(at.getSecondArgument());
        variable2=getVariableFor(at.getFirstArgument());
    }
    else {
        variable1=getVariableFor(at.getFirstArgument());
        variable2=getVariableFor(at.getSecondArgument());

    }
    SWRLAtom newAtom=m_factory.getSWRLObjectPropertyAtom(op,variable1,variable2);
    */
    if (m_isPositive) {
        // head
        m_normalizedHeadAtoms.add(newAtom);
    }
    else {
        // body
        m_normalizedBodyAtoms.add(newAtom);
    }
}
项目:owlapi-gwt    文件:OWLObjectVisitorExAdapter.java   
@Override
public O visit(SWRLObjectPropertyAtom node) {
    return doDefault(node);
}
项目:owlapi-gwt    文件:OWLObjectVisitorAdapter.java   
@Override
public void visit(SWRLObjectPropertyAtom node) {
    handleDefault(node);
}
项目:owlapi-gwt    文件:OWLObjectTypeIndexProvider.java   
@Override
public void visit(SWRLObjectPropertyAtom node) {
    type = RULE_OBJECT_TYPE_INDEX_BASE + 3;
}
项目:owlapi-gwt    文件:SWRLVariableExtractor.java   
@Override
public void visit(SWRLObjectPropertyAtom node) {
    node.getFirstArgument().accept(this);
    node.getSecondArgument().accept(this);
}
项目:owlapi-gwt    文件:SWRLRuleImpl.java   
@Override
public SWRLObjectPropertyAtom visit(SWRLObjectPropertyAtom node) {
    return node.getSimplified();
}
项目:owlapi-gwt    文件:AbstractEntityRegistrationManager.java   
@Override
public void visit(@Nonnull SWRLObjectPropertyAtom node) {
    node.getPredicate().accept(this);
    node.getFirstArgument().accept(this);
    node.getSecondArgument().accept(this);
}
项目:binaryowl    文件:SWRLObjectPropertyAtomSerializer.java   
@Override
protected void writeObject(SWRLObjectPropertyAtom object, BinaryOWLOutputStream outputStream) throws IOException {
    outputStream.writeOWLObject(object.getPredicate());
    outputStream.writeOWLObject(object.getFirstArgument());
    outputStream.writeOWLObject(object.getSecondArgument());
}