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)); }
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); } }
@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(); }
@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()); }
@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); }
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); }
@Override public O visit(SWRLDataPropertyAtom node) { return doDefault(node); }
@Override public void visit(SWRLDataPropertyAtom node) { handleDefault(node); }
@Override public void visit(SWRLDataPropertyAtom node) { type = RULE_OBJECT_TYPE_INDEX_BASE + 4; }
@Override public void visit(SWRLDataPropertyAtom node) { node.getFirstArgument().accept(this); node.getSecondArgument().accept(this); }
@Override public SWRLDataPropertyAtom visit(SWRLDataPropertyAtom node) { return node; }
@Override public void visit(@Nonnull SWRLDataPropertyAtom node) { node.getPredicate().accept(this); node.getFirstArgument().accept(this); node.getSecondArgument().accept(this); }
@Override protected void writeObject(SWRLDataPropertyAtom object, BinaryOWLOutputStream outputStream) throws IOException { outputStream.writeOWLObject(object.getPredicate()); outputStream.writeOWLObject(object.getFirstArgument()); outputStream.writeOWLObject(object.getSecondArgument()); }