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

项目:HermiT-android    文件:OWLNormalization.java   
public void visit(SWRLClassAtom atom) {
    if (!(atom.getArgument() instanceof SWRLIndividualArgument))
        throw new IllegalArgumentException("A SWRL rule contains a head atom "+atom+" with a variable that does not occur in the body. ");
    OWLIndividual ind=((SWRLIndividualArgument)atom.getArgument()).getIndividual();
    if (ind.isAnonymous())
        throwAnonIndError(atom);
    if (!isSimple(atom.getPredicate())) {
        OWLClassExpression definition=getDefinitionFor(atom.getPredicate(),m_alreadyExists);
        if (!m_alreadyExists[0])
            m_newInclusions.add(new OWLClassExpression[] { negative(definition),atom.getPredicate() });
        addFact(m_factory.getOWLClassAssertionAxiom(definition,ind.asOWLNamedIndividual()));
    }
    else
        addFact(m_factory.getOWLClassAssertionAxiom(atom.getPredicate(),ind.asOWLNamedIndividual()));
}
项目:HermiT-android    文件:OWLClausification.java   
public Atom visit(SWRLClassAtom atom) {
    if (atom.getPredicate().isAnonymous())
        throw new IllegalStateException("Internal error: SWRL rule class atoms should be normalized to contain only named classes, but this class atom has a complex concept: "+atom.getPredicate());
    Variable variable=toVariable(atom.getArgument());
    m_abstractVariables.add(variable);
    return Atom.create(AtomicConcept.create(atom.getPredicate().asOWLClass().getIRI().toString()),variable);
}
项目:Hermit_1.3.8_android    文件:OWLNormalization.java   
public void visit(SWRLClassAtom atom) {
    if (!(atom.getArgument() instanceof SWRLIndividualArgument))
        throw new IllegalArgumentException("A SWRL rule contains a head atom "+atom+" with a variable that does not occur in the body. ");
    OWLIndividual ind=((SWRLIndividualArgument)atom.getArgument()).getIndividual();
    if (ind.isAnonymous())
        throwAnonIndError(atom);
    if (!isSimple(atom.getPredicate())) {
        OWLClassExpression definition=getDefinitionFor(atom.getPredicate(),m_alreadyExists);
        if (!m_alreadyExists[0])
            m_newInclusions.add(new OWLClassExpression[] { negative(definition),atom.getPredicate() });
        addFact(m_factory.getOWLClassAssertionAxiom(definition,ind.asOWLNamedIndividual()));
    }
    else
        addFact(m_factory.getOWLClassAssertionAxiom(atom.getPredicate(),ind.asOWLNamedIndividual()));
}
项目:Hermit_1.3.8_android    文件:OWLClausification.java   
public Atom visit(SWRLClassAtom atom) {
    if (atom.getPredicate().isAnonymous())
        throw new IllegalStateException("Internal error: SWRL rule class atoms should be normalized to contain only named classes, but this class atom has a complex concept: "+atom.getPredicate());
    Variable variable=toVariable(atom.getArgument());
    m_abstractVariables.add(variable);
    return Atom.create(AtomicConcept.create(atom.getPredicate().asOWLClass().getIRI().toString()),variable);
}
项目:Wolpertinger    文件:OWLNormalization.java   
public void visit(SWRLClassAtom atom) {
    if (!(atom.getArgument() instanceof SWRLIndividualArgument))
        throw new IllegalArgumentException("A SWRL rule contains a head atom "+atom+" with a variable that does not occur in the body. ");
    OWLIndividual ind=((SWRLIndividualArgument)atom.getArgument()).getIndividual();
    if (ind.isAnonymous())
        throwAnonIndError(atom);
    if (!isSimple(atom.getPredicate())) {
        OWLClassExpression definition=getDefinitionFor(atom.getPredicate(),m_alreadyExists);
        if (!m_alreadyExists[0])
            m_newInclusions.add(new OWLClassExpression[] { negative(definition),atom.getPredicate() });
        addFact(m_factory.getOWLClassAssertionAxiom(definition,ind.asOWLNamedIndividual()));
    }
    else
        addFact(m_factory.getOWLClassAssertionAxiom(atom.getPredicate(),ind.asOWLNamedIndividual()));
}
项目:Wolpertinger    文件:OWLNormalization.java   
public void visit(SWRLClassAtom at) {
    OWLClassExpression c=m_expressionManager.getSimplified(m_expressionManager.getNNF(at.getPredicate()));
    SWRLIArgument argument=at.getArgument();
    if (m_isPositive) {
        // head
        if (c instanceof OWLClass)
            m_normalizedHeadAtoms.add(m_factory.getSWRLClassAtom(c,argument));
        else {
            /*
            OWLClass definition=getClassFor(at.getPredicate(),m_alreadyExists);
            if (!m_alreadyExists[0])
                m_classExpressionInclusions.add(new OWLClassExpression[] { negative(definition),at.getPredicate() });
            m_normalizedHeadAtoms.add(m_factory.getSWRLClassAtom(definition,argument));
            */
        }
    }
    else {
        // body
        if (c instanceof OWLClass)
            m_normalizedBodyAtoms.add(m_factory.getSWRLClassAtom(c,argument));
        else {
            /*
            OWLClass definition=getClassFor(at.getPredicate(),m_alreadyExists);
            if (!m_alreadyExists[0])
                m_classExpressionInclusions.add(new OWLClassExpression[] { negative(at.getPredicate()),definition });
            m_normalizedBodyAtoms.add(m_factory.getSWRLClassAtom(definition,argument));
            */
        }
    }
}
项目:owlapi-gwt    文件:SWRLClassAtomImpl.java   
@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof SWRLClassAtom)) {
        return false;
    }
    SWRLClassAtom other = (SWRLClassAtom) obj;
    return other.getArgument().equals(getArgument())
            && other.getPredicate().equals(getPredicate());
}
项目:owlapi-gwt    文件:SWRLClassAtomImpl.java   
@Override
protected int compareObjectOfSameType(OWLObject object) {
    SWRLClassAtom other = (SWRLClassAtom) object;
    int diff = getPredicate().compareTo(other.getPredicate());
    if (diff != 0) {
        return diff;
    }
    return getArgument().compareTo(other.getArgument());
}
项目:owlapi-gwt    文件:OWLObjectVisitorExAdapter.java   
@Override
public O visit(SWRLClassAtom node) {
    return doDefault(node);
}
项目:owlapi-gwt    文件:OWLObjectVisitorAdapter.java   
@Override
public void visit(SWRLClassAtom node) {
    handleDefault(node);
}
项目:owlapi-gwt    文件:OWLObjectTypeIndexProvider.java   
@Override
public void visit(SWRLClassAtom node) {
    type = RULE_OBJECT_TYPE_INDEX_BASE + 1;
}
项目:owlapi-gwt    文件:SWRLVariableExtractor.java   
@Override
public void visit(SWRLClassAtom node) {
    node.getArgument().accept(this);
}
项目:owlapi-gwt    文件:HashCode.java   
@Override
public void visit(SWRLClassAtom node) {
    hashCode = primes[62];
    hashCode = hashCode * MULT + node.getArgument().hashCode();
    hashCode = hashCode * MULT + node.getPredicate().hashCode();
}
项目:owlapi-gwt    文件:OWLClassExpressionCollector.java   
@Override
public Set<OWLClassExpression> visit(SWRLClassAtom node) {
    return node.getPredicate().accept(this);
}
项目:owlapi-gwt    文件:SWRLRuleImpl.java   
@Override
public SWRLClassAtom visit(SWRLClassAtom node) {
    return node;
}
项目:owlapi-gwt    文件:AbstractEntityRegistrationManager.java   
@Override
public void visit(@Nonnull SWRLClassAtom node) {
    node.getArgument().accept(this);
    node.getPredicate().accept(this);
}
项目:binaryowl    文件:SWRLClassAtomSerializer.java   
@Override
protected void writeObject(SWRLClassAtom object, BinaryOWLOutputStream outputStream) throws IOException {
    outputStream.writeOWLObject(object.getPredicate());
    outputStream.writeOWLObject(object.getArgument());
}
项目:binaryowl    文件:SWRLClassAtomSerializer.java   
@Override
protected SWRLClassAtom readObject(BinaryOWLInputStream inputStream) throws IOException, BinaryOWLParseException {
    OWLClassExpression predicate = inputStream.readOWLObject();
    SWRLIArgument arg = inputStream.readOWLObject();
    return inputStream.getDataFactory().getSWRLClassAtom(predicate, arg);
}