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); } }
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())); }
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; } }
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); }
@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(); }
@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()); } }
@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()); }
@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); }
protected void makeGraphObjectProperty(SWRLAtom atom) { if (atom instanceof SWRLObjectPropertyAtom) { OWLObjectProperty objectProperty=((SWRLObjectPropertyAtom)atom).getPredicate().getNamedProperty(); m_graphObjectProperties.add(objectProperty); } }
protected void makeNonGraphObjectProperty(SWRLAtom atom) { if (atom instanceof SWRLObjectPropertyAtom) { OWLObjectProperty objectProperty=((SWRLObjectPropertyAtom)atom).getPredicate().getNamedProperty(); m_objectPropertiesOccurringInOWLAxioms.add(objectProperty); } }
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); } }
@Override public O visit(SWRLObjectPropertyAtom node) { return doDefault(node); }
@Override public void visit(SWRLObjectPropertyAtom node) { handleDefault(node); }
@Override public void visit(SWRLObjectPropertyAtom node) { type = RULE_OBJECT_TYPE_INDEX_BASE + 3; }
@Override public void visit(SWRLObjectPropertyAtom node) { node.getFirstArgument().accept(this); node.getSecondArgument().accept(this); }
@Override public SWRLObjectPropertyAtom visit(SWRLObjectPropertyAtom node) { return node.getSimplified(); }
@Override public void visit(@Nonnull SWRLObjectPropertyAtom node) { node.getPredicate().accept(this); node.getFirstArgument().accept(this); node.getSecondArgument().accept(this); }
@Override protected void writeObject(SWRLObjectPropertyAtom object, BinaryOWLOutputStream outputStream) throws IOException { outputStream.writeOWLObject(object.getPredicate()); outputStream.writeOWLObject(object.getFirstArgument()); outputStream.writeOWLObject(object.getSecondArgument()); }