/** * * @see org.semanticweb.owlapi.model.OWLAxiomVisitor#visit(org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom) */ public void visit(OWLNegativeObjectPropertyAssertionAxiom negObjPropertyAssertion) { //assert !negObjPropertyAssertion.getProperty().isAnonymous(); OWLObjectProperty property = negObjPropertyAssertion.getProperty().asOWLObjectProperty(); String propertyName = mapper.getPredicateName(property); OWLNamedIndividual subject = negObjPropertyAssertion.getSubject().asOWLNamedIndividual(); OWLNamedIndividual object = negObjPropertyAssertion.getObject().asOWLNamedIndividual(); String subjectName = mapper.getConstantName(subject); String objectName = mapper.getConstantName(object); writer.print("not_"); writer.print(propertyName); writer.print(ASP2CoreSymbols.BRACKET_OPEN); writer.print(subjectName); writer.print(ASP2CoreSymbols.ARG_SEPERATOR); writer.print(objectName); writer.print(ASP2CoreSymbols.BRACKET_CLOSE); writer.print(ASP2CoreSymbols.EOR); }
/** * * @see org.semanticweb.owlapi.model.OWLAxiomVisitor#visit(org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom) */ public void visit(OWLNegativeObjectPropertyAssertionAxiom negObjPropertyAssertion) { //assert !negObjPropertyAssertion.getProperty().isAnonymous(); OWLObjectProperty property = negObjPropertyAssertion.getProperty().asOWLObjectProperty(); String propertyName = mapper.getPredicateName(property); OWLNamedIndividual subject = negObjPropertyAssertion.getSubject().asOWLNamedIndividual(); OWLNamedIndividual object = negObjPropertyAssertion.getObject().asOWLNamedIndividual(); String subjectName = mapper.getConstantName(subject); String objectName = mapper.getConstantName(object); writer.print(ASP2CoreSymbols.CLASSICAL_NEGATION); writer.print(propertyName); writer.print(ASP2CoreSymbols.BRACKET_OPEN); writer.print(subjectName); writer.print(ASP2CoreSymbols.ARG_SEPERATOR); writer.print(objectName); writer.print(ASP2CoreSymbols.BRACKET_CLOSE); writer.print(ASP2CoreSymbols.EOR); }
public int rewriteNegativeObjectPropertyAssertions(OWLDataFactory factory,OWLAxioms axioms,int replacementIndex) { // now object property inclusion manager added all non-simple properties to axioms.m_complexObjectPropertyExpressions // now that we know which roles are non-simple, we can decide which negative object property assertions have to be // expressed as concept assertions so that transitivity rewriting applies properly. All new concepts for the concept // assertions must be normalised, because we are done with the normal normalisation phase. Set<OWLIndividualAxiom> redundantFacts=new HashSet<OWLIndividualAxiom>(); Set<OWLIndividualAxiom> additionalFacts=new HashSet<OWLIndividualAxiom>(); for (OWLIndividualAxiom axiom : axioms.m_facts) { if (axiom instanceof OWLNegativeObjectPropertyAssertionAxiom) { OWLNegativeObjectPropertyAssertionAxiom negAssertion=(OWLNegativeObjectPropertyAssertionAxiom)axiom; OWLObjectPropertyExpression prop=negAssertion.getProperty().getSimplified(); if (axioms.m_complexObjectPropertyExpressions.contains(prop)) { // turn not op(a b) into // C(a) and not C or forall op not{b} OWLIndividual individual=negAssertion.getObject(); // neg. op assertions cannot contain anonymous individuals OWLClass individualConcept=factory.getOWLClass(IRI.create("internal:nom#"+individual.asOWLNamedIndividual().getIRI().toString())); OWLClassExpression notIndividualConcept=factory.getOWLObjectComplementOf(individualConcept); OWLClassExpression allNotIndividualConcept=factory.getOWLObjectAllValuesFrom(prop,notIndividualConcept); OWLClassExpression definition=factory.getOWLClass(IRI.create("internal:def#"+(replacementIndex++))); axioms.m_conceptInclusions.add(new OWLClassExpression[] { factory.getOWLObjectComplementOf(definition), allNotIndividualConcept }); additionalFacts.add(factory.getOWLClassAssertionAxiom(definition,negAssertion.getSubject())); additionalFacts.add(factory.getOWLClassAssertionAxiom(individualConcept,individual)); redundantFacts.add(negAssertion); } } } axioms.m_facts.addAll(additionalFacts); axioms.m_facts.removeAll(redundantFacts); return replacementIndex; }
public Boolean visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { // see OWL 2 Syntax, Sec 11.2 // No axiom in Ax of the following form contains anonymous individuals: // SameIndividual, DifferentIndividuals, NegativeObjectPropertyAssertion, and NegativeDataPropertyAssertion. if (axiom.getSubject().isAnonymous()||axiom.getObject().isAnonymous()) { throw new IllegalArgumentException("NegativeObjectPropertyAssertion axioms are not allowed to be used "+"with anonymous individuals (see OWL 2 Syntax Sec 11.2) but the axiom "+axiom+" cotains an anonymous subject or object. "); } OWLClassExpression hasValue=factory.getOWLObjectHasValue(axiom.getProperty(),axiom.getObject()); OWLClassExpression doesNotHaveValue=factory.getOWLObjectComplementOf(hasValue); return reasoner.hasType(axiom.getSubject().asOWLNamedIndividual(),doesNotHaveValue,false); }
@Override public OWLNegativeObjectPropertyAssertionAxiom visit( ElkNegativeObjectPropertyAssertionAxiom axiom) { return owlFactory_.getOWLNegativeObjectPropertyAssertionAxiom( convert(axiom.getProperty()), convert(axiom.getSubject()), convert(axiom.getObject())); }
@Override public T visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { throw new IllegalArgumentException( OWLNegativeObjectPropertyAssertionAxiom.class.getSimpleName() + " cannot be converted to " + getTargetClass().getSimpleName()); }
@Override public Set<ComplexIntegerAxiom> visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { Objects.requireNonNull(axiom); IntegerObjectPropertyExpression propertyExpr = translateObjectPropertyExpression(axiom.getProperty()); Integer subjectId = translateIndividual(axiom.getSubject()); Integer objectId = translateIndividual(axiom.getObject()); ComplexIntegerAxiom ret = getAxiomFactory().createNegativeObjectPropertyAssertionAxiom(propertyExpr, subjectId, objectId, translateAnnotations(axiom.getAnnotations())); return Collections.singleton(ret); }
@Override public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { hashCode = primes[22]; hashCode = hashCode * MULT + axiom.getSubject().hashCode(); hashCode = hashCode * MULT + axiom.getProperty().hashCode(); hashCode = hashCode * MULT + axiom.getObject().hashCode(); hashCode = hashCode * MULT + axiom.getAnnotations().hashCode(); }
@Override public OWLNegativeObjectPropertyAssertionAxiom getAxiomWithoutAnnotations() { if (!isAnnotated()) { return this; } return new OWLNegativeObjectPropertyAssertionAxiomImpl(getSubject(), getProperty(), getObject(), NO_ANNOTATIONS); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } return obj instanceof OWLNegativeObjectPropertyAssertionAxiom; }
@Override public void visit(@Nonnull OWLNegativeObjectPropertyAssertionAxiom axiom) { axiom.getSubject().accept(this); axiom.getProperty().accept(this); axiom.getObject().accept(this); processAxiomAnnotations(axiom); }
@Override protected OWLNegativeObjectPropertyAssertionAxiom readAxiom(BinaryOWLInputStream inputStream, Set<OWLAnnotation> annotations) throws IOException, BinaryOWLParseException { OWLObjectPropertyExpression property = inputStream.readOWLObject(); OWLIndividual subject = inputStream.readOWLObject(); OWLIndividual object = inputStream.readOWLObject(); return inputStream.getDataFactory().getOWLNegativeObjectPropertyAssertionAxiom(property, subject, object, annotations); }
public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { notSupported(axiom); }
public void visit(OWLNegativeObjectPropertyAssertionAxiom object) { visitProperty(object.getProperty()); }
public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { if (axiom.containsAnonymousIndividuals()) throw new IllegalArgumentException("The axiom "+axiom+" contains anonymous individuals, which is not allowed in OWL 2 DL. "); addFact(m_factory.getOWLNegativeObjectPropertyAssertionAxiom(axiom.getProperty().getSimplified(),axiom.getSubject(),axiom.getObject())); m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(axiom.getProperty().getNamedProperty()); }
public void visit(OWLNegativeObjectPropertyAssertionAxiom object) { m_negativeFacts.add(getRoleAtom(object.getProperty(),getIndividual(object.getSubject()),getIndividual(object.getObject()))); }
public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { }
@SuppressWarnings("static-method") public ElkNegativeObjectPropertyAssertionAxiom convert( OWLNegativeObjectPropertyAssertionAxiom owlNegativeObjectPropertyAssertionAxiom) { return new ElkNegativeObjectPropertyAssertionAxiomWrap<OWLNegativeObjectPropertyAssertionAxiom>( owlNegativeObjectPropertyAssertionAxiom); }
@Override public ElkAxiom visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { return CONVERTER.convert(axiom); }
@Override public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { defaultVisit(axiom); }
@Override public OWLAxiom visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { return factory.getOWLNegativeObjectPropertyAssertionAxiom(axiom.getProperty(), axiom.getSubject(), axiom.getObject(), annotations); }
@Override public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { }
@Override public Boolean visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { return true; }
@Override public Boolean visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { return false; }
@Override public Boolean visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { Objects.requireNonNull(axiom); return add(this.df.getOWLNegativeObjectPropertyAssertionAxiom(axiom.getProperty(), axiom.getSubject(), axiom.getObject(), reg(axiom.getAnnotations()))); }
@Override public Boolean visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { Objects.requireNonNull(axiom); return add(this.df.getOWLNegativeObjectPropertyAssertionAxiom(axiom.getProperty(), axiom.getSubject(), axiom.getObject(), empty())); }
@Override public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { ignoreOwlAxiom("NegavtiveObjectPropertyAssertion", axiom); }
@Override public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { aBoxAxiomsNotSupportedWarning(axiom); }
@Override public O visit(OWLNegativeObjectPropertyAssertionAxiom axiom) { return doDefault(axiom); }