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

项目:HermiT-android    文件:OWLNormalization.java   
public void visit(SWRLDataPropertyAtom atom) {
    if (!(atom.getSecondArgument() instanceof SWRLLiteralArgument))
        throwVarError(atom);
    if (!(atom.getFirstArgument() instanceof SWRLIndividualArgument))
        throwVarError(atom);
    OWLIndividual ind=((SWRLIndividualArgument)atom.getFirstArgument()).getIndividual();
    if (ind.isAnonymous())
        throwAnonIndError(atom);
    OWLLiteral lit=((SWRLLiteralArgument)atom.getSecondArgument()).getLiteral();
    addFact(m_factory.getOWLDataPropertyAssertionAxiom(atom.getPredicate().asOWLDataProperty(),ind.asOWLNamedIndividual(),lit));
}
项目:HermiT-android    文件:OWLNormalization.java   
public void visit(SWRLDataPropertyAtom at) {
    OWLDataProperty dp=at.getPredicate().asOWLDataProperty();
    SWRLVariable variable1=getVariableFor(at.getFirstArgument());
    SWRLDArgument argument2=at.getSecondArgument();
    if (argument2 instanceof SWRLVariable) {
        SWRLVariable variable2=getVariableFor((SWRLVariable)argument2);
        if (m_isPositive) {
            m_normalizedHeadAtoms.add(m_factory.getSWRLDataPropertyAtom(dp,variable1,variable2));
            m_headDataRangeVariables.add(variable2);
        }
        else {
            if (m_bodyDataRangeVariables.add(variable2))
                m_normalizedBodyAtoms.add(m_factory.getSWRLDataPropertyAtom(dp,variable1,variable2));
            else {
                SWRLVariable variable2Fresh=getFreshVariable();
                m_normalizedBodyAtoms.add(m_factory.getSWRLDataPropertyAtom(dp,variable1,variable2Fresh));
                m_normalizedHeadAtoms.add(m_factory.getSWRLDifferentIndividualsAtom(variable2,variable2Fresh));
            }
        }
    }
    else {
        OWLLiteral literal=((SWRLLiteralArgument)argument2).getLiteral();
        SWRLAtom newAtom=m_factory.getSWRLClassAtom(m_factory.getOWLDataHasValue(dp,literal),variable1);
        if (m_isPositive)
            m_headAtoms.add(newAtom);
        else
            m_bodyAtoms.add(newAtom);
    }
}
项目:Hermit_1.3.8_android    文件:OWLNormalization.java   
public void visit(SWRLDataPropertyAtom atom) {
    if (!(atom.getSecondArgument() instanceof SWRLLiteralArgument))
        throwVarError(atom);
    if (!(atom.getFirstArgument() instanceof SWRLIndividualArgument))
        throwVarError(atom);
    OWLIndividual ind=((SWRLIndividualArgument)atom.getFirstArgument()).getIndividual();
    if (ind.isAnonymous())
        throwAnonIndError(atom);
    OWLLiteral lit=((SWRLLiteralArgument)atom.getSecondArgument()).getLiteral();
    addFact(m_factory.getOWLDataPropertyAssertionAxiom(atom.getPredicate().asOWLDataProperty(),ind.asOWLNamedIndividual(),lit));
}
项目:Hermit_1.3.8_android    文件:OWLNormalization.java   
public void visit(SWRLDataPropertyAtom at) {
    OWLDataProperty dp=at.getPredicate().asOWLDataProperty();
    SWRLVariable variable1=getVariableFor(at.getFirstArgument());
    SWRLDArgument argument2=at.getSecondArgument();
    if (argument2 instanceof SWRLVariable) {
        SWRLVariable variable2=getVariableFor((SWRLVariable)argument2);
        if (m_isPositive) {
            m_normalizedHeadAtoms.add(m_factory.getSWRLDataPropertyAtom(dp,variable1,variable2));
            m_headDataRangeVariables.add(variable2);
        }
        else {
            if (m_bodyDataRangeVariables.add(variable2))
                m_normalizedBodyAtoms.add(m_factory.getSWRLDataPropertyAtom(dp,variable1,variable2));
            else {
                SWRLVariable variable2Fresh=getFreshVariable();
                m_normalizedBodyAtoms.add(m_factory.getSWRLDataPropertyAtom(dp,variable1,variable2Fresh));
                m_normalizedHeadAtoms.add(m_factory.getSWRLDifferentIndividualsAtom(variable2,variable2Fresh));
            }
        }
    }
    else {
        OWLLiteral literal=((SWRLLiteralArgument)argument2).getLiteral();
        SWRLAtom newAtom=m_factory.getSWRLClassAtom(m_factory.getOWLDataHasValue(dp,literal),variable1);
        if (m_isPositive)
            m_headAtoms.add(newAtom);
        else
            m_bodyAtoms.add(newAtom);
    }
}
项目:Wolpertinger    文件:OWLNormalization.java   
public void visit(SWRLDataPropertyAtom atom) {
    if (!(atom.getSecondArgument() instanceof SWRLLiteralArgument))
        throwVarError(atom);
    if (!(atom.getFirstArgument() instanceof SWRLIndividualArgument))
        throwVarError(atom);
    OWLIndividual ind=((SWRLIndividualArgument)atom.getFirstArgument()).getIndividual();
    if (ind.isAnonymous())
        throwAnonIndError(atom);
    OWLLiteral lit=((SWRLLiteralArgument)atom.getSecondArgument()).getLiteral();
    addFact(m_factory.getOWLDataPropertyAssertionAxiom(atom.getPredicate().asOWLDataProperty(),ind.asOWLNamedIndividual(),lit));
}
项目:Wolpertinger    文件:OWLNormalization.java   
public void visit(SWRLDataPropertyAtom at) {
    OWLDataProperty dp=at.getPredicate().asOWLDataProperty();
    SWRLVariable variable1=getVariableFor(at.getFirstArgument());
    SWRLDArgument argument2=at.getSecondArgument();
    if (argument2 instanceof SWRLVariable) {
        SWRLVariable variable2=getVariableFor((SWRLVariable)argument2);
        if (m_isPositive) {
            m_normalizedHeadAtoms.add(m_factory.getSWRLDataPropertyAtom(dp,variable1,variable2));
            m_headDataRangeVariables.add(variable2);
        }
        else {
            if (m_bodyDataRangeVariables.add(variable2))
                m_normalizedBodyAtoms.add(m_factory.getSWRLDataPropertyAtom(dp,variable1,variable2));
            else {
                SWRLVariable variable2Fresh=getFreshVariable();
                m_normalizedBodyAtoms.add(m_factory.getSWRLDataPropertyAtom(dp,variable1,variable2Fresh));
                m_normalizedHeadAtoms.add(m_factory.getSWRLDifferentIndividualsAtom(variable2,variable2Fresh));
            }
        }
    }
    else {
        OWLLiteral literal=((SWRLLiteralArgument)argument2).getLiteral();
        SWRLAtom newAtom=m_factory.getSWRLClassAtom(m_factory.getOWLDataHasValue(dp,literal),variable1);
        if (m_isPositive)
            m_headAtoms.add(newAtom);
        else
            m_bodyAtoms.add(newAtom);
    }
}
项目:owlapi-gwt    文件:HashCode.java   
@Override
public void visit(SWRLDataPropertyAtom node) {
    hashCode = primes[65];
    hashCode = hashCode * MULT + node.getFirstArgument().hashCode();
    hashCode = hashCode * MULT + node.getSecondArgument().hashCode();
    hashCode = hashCode * MULT + node.getPredicate().hashCode();
}
项目:owlapi-gwt    文件:SWRLDataPropertyAtomImpl.java   
@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof SWRLDataPropertyAtom)) {
        return false;
    }
    SWRLDataPropertyAtom other = (SWRLDataPropertyAtom) obj;
    return other.getPredicate().equals(getPredicate())
            && other.getFirstArgument().equals(getFirstArgument())
            && other.getSecondArgument().equals(getSecondArgument());
}
项目:binaryowl    文件:SWRLDataPropertyAtomSerializer.java   
@Override
protected SWRLDataPropertyAtom readObject(BinaryOWLInputStream inputStream) throws IOException, BinaryOWLParseException {
    OWLDataPropertyExpression predicate = inputStream.readOWLObject();
    SWRLIArgument firstArg = inputStream.readOWLObject();
    SWRLDArgument secondArg = inputStream.readOWLObject();
    return inputStream.getDataFactory().getSWRLDataPropertyAtom(predicate, firstArg, secondArg);
}
项目:HermiT-android    文件:OWLClausification.java   
public Atom visit(SWRLDataPropertyAtom atom) {
    Variable variable1=toVariable(atom.getFirstArgument());
    Variable variable2=toVariable(atom.getSecondArgument());
    m_abstractVariables.add(variable1);
    return getRoleAtom(atom.getPredicate().asOWLDataProperty(),variable1,variable2);
}
项目:Hermit_1.3.8_android    文件:OWLClausification.java   
public Atom visit(SWRLDataPropertyAtom atom) {
    Variable variable1=toVariable(atom.getFirstArgument());
    Variable variable2=toVariable(atom.getSecondArgument());
    m_abstractVariables.add(variable1);
    return getRoleAtom(atom.getPredicate().asOWLDataProperty(),variable1,variable2);
}
项目:owlapi-gwt    文件:OWLObjectVisitorExAdapter.java   
@Override
public O visit(SWRLDataPropertyAtom node) {
    return doDefault(node);
}
项目:owlapi-gwt    文件:OWLObjectVisitorAdapter.java   
@Override
public void visit(SWRLDataPropertyAtom node) {
    handleDefault(node);
}
项目:owlapi-gwt    文件:OWLObjectTypeIndexProvider.java   
@Override
public void visit(SWRLDataPropertyAtom node) {
    type = RULE_OBJECT_TYPE_INDEX_BASE + 4;
}
项目:owlapi-gwt    文件:SWRLVariableExtractor.java   
@Override
public void visit(SWRLDataPropertyAtom node) {
    node.getFirstArgument().accept(this);
    node.getSecondArgument().accept(this);
}
项目:owlapi-gwt    文件:SWRLRuleImpl.java   
@Override
public SWRLDataPropertyAtom visit(SWRLDataPropertyAtom node) {
    return node;
}
项目:owlapi-gwt    文件:AbstractEntityRegistrationManager.java   
@Override
public void visit(@Nonnull SWRLDataPropertyAtom node) {
    node.getPredicate().accept(this);
    node.getFirstArgument().accept(this);
    node.getSecondArgument().accept(this);
}
项目:binaryowl    文件:SWRLDataPropertyAtomSerializer.java   
@Override
protected void writeObject(SWRLDataPropertyAtom object, BinaryOWLOutputStream outputStream) throws IOException {
    outputStream.writeOWLObject(object.getPredicate());
    outputStream.writeOWLObject(object.getFirstArgument());
    outputStream.writeOWLObject(object.getSecondArgument());
}