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

项目:Wolpertinger    文件:DebugTranslation.java   
/**
 *
 * @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);
}
项目:Wolpertinger    文件:NaiveTranslation.java   
/**
 *
 * @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);
}
项目:HermiT-android    文件:ObjectPropertyInclusionManager.java   
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;
}
项目:HermiT-android    文件:EntailmentChecker.java   
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);
}
项目:elk-reasoner    文件:AbstractElkObjectConverter.java   
@Override
public OWLNegativeObjectPropertyAssertionAxiom visit(
        ElkNegativeObjectPropertyAssertionAxiom axiom) {
    return owlFactory_.getOWLNegativeObjectPropertyAssertionAxiom(
            convert(axiom.getProperty()), convert(axiom.getSubject()),
            convert(axiom.getObject()));
}
项目:elk-reasoner    文件:AbstractOwlAxiomConverterVisitor.java   
@Override
public T visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
    throw new IllegalArgumentException(
            OWLNegativeObjectPropertyAssertionAxiom.class.getSimpleName()
                    + " cannot be converted to "
                    + getTargetClass().getSimpleName());
}
项目:Hermit_1.3.8_android    文件:ObjectPropertyInclusionManager.java   
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;
}
项目:Hermit_1.3.8_android    文件:EntailmentChecker.java   
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);
}
项目:jcel    文件:AxiomTranslator.java   
@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);
}
项目:owlapi-gwt    文件:HashCode.java   
@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();
}
项目:owlapi-gwt    文件:OWLNegativeObjectPropertyAssertionAxiomImpl.java   
@Override
public OWLNegativeObjectPropertyAssertionAxiom getAxiomWithoutAnnotations() {
    if (!isAnnotated()) {
        return this;
    }
    return new OWLNegativeObjectPropertyAssertionAxiomImpl(getSubject(),
            getProperty(), getObject(), NO_ANNOTATIONS);
}
项目:owlapi-gwt    文件:OWLNegativeObjectPropertyAssertionAxiomImpl.java   
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (!super.equals(obj)) {
        return false;
    }
    return obj instanceof OWLNegativeObjectPropertyAssertionAxiom;
}
项目:owlapi-gwt    文件:AbstractEntityRegistrationManager.java   
@Override
public void visit(@Nonnull OWLNegativeObjectPropertyAssertionAxiom axiom) {
    axiom.getSubject().accept(this);
    axiom.getProperty().accept(this);
    axiom.getObject().accept(this);
    processAxiomAnnotations(axiom);
}
项目:binaryowl    文件:OWLNegativeObjectPropertyAssertionAxiomSerializer.java   
@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);
}
项目:jopa    文件:IntegrityConstraintParser.java   
public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
    notSupported(axiom);
}
项目:HermiT-android    文件:BuiltInPropertyManager.java   
public void visit(OWLNegativeObjectPropertyAssertionAxiom object) {
    visitProperty(object.getProperty());
}
项目:HermiT-android    文件:OWLNormalization.java   
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());
}
项目:HermiT-android    文件:OWLAxiomsExpressivity.java   
public void visit(OWLNegativeObjectPropertyAssertionAxiom object) {
    visitProperty(object.getProperty());
}
项目:HermiT-android    文件:OWLClausification.java   
public void visit(OWLNegativeObjectPropertyAssertionAxiom object) {
    m_negativeFacts.add(getRoleAtom(object.getProperty(),getIndividual(object.getSubject()),getIndividual(object.getObject())));
}
项目:HermiT-android    文件:ReducedABoxOnlyClausification.java   
public void visit(OWLNegativeObjectPropertyAssertionAxiom object) {
    m_negativeFacts.add(getRoleAtom(object.getProperty(),getIndividual(object.getSubject()),getIndividual(object.getObject())));
}
项目:HermiT-android    文件:EntailmentChecker.java   
public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
}
项目:elk-reasoner    文件:OwlConverter.java   
@SuppressWarnings("static-method")
public ElkNegativeObjectPropertyAssertionAxiom convert(
        OWLNegativeObjectPropertyAssertionAxiom owlNegativeObjectPropertyAssertionAxiom) {
    return new ElkNegativeObjectPropertyAssertionAxiomWrap<OWLNegativeObjectPropertyAssertionAxiom>(
            owlNegativeObjectPropertyAssertionAxiom);
}
项目:elk-reasoner    文件:OwlAxiomConverterVisitor.java   
@Override
public ElkAxiom visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
    return CONVERTER.convert(axiom);
}
项目:elk-reasoner    文件:FailingOwlAxiomVisitor.java   
@Override
public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
    defaultVisit(axiom);
}
项目:Hermit_1.3.8_android    文件:BuiltInPropertyManager.java   
public void visit(OWLNegativeObjectPropertyAssertionAxiom object) {
    visitProperty(object.getProperty());
}
项目:Hermit_1.3.8_android    文件:OWLNormalization.java   
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());
}
项目:Hermit_1.3.8_android    文件:OWLAxiomsExpressivity.java   
public void visit(OWLNegativeObjectPropertyAssertionAxiom object) {
    visitProperty(object.getProperty());
}
项目:Hermit_1.3.8_android    文件:OWLClausification.java   
public void visit(OWLNegativeObjectPropertyAssertionAxiom object) {
    m_negativeFacts.add(getRoleAtom(object.getProperty(),getIndividual(object.getSubject()),getIndividual(object.getObject())));
}
项目:Hermit_1.3.8_android    文件:ReducedABoxOnlyClausification.java   
public void visit(OWLNegativeObjectPropertyAssertionAxiom object) {
    m_negativeFacts.add(getRoleAtom(object.getProperty(),getIndividual(object.getSubject()),getIndividual(object.getObject())));
}
项目:Hermit_1.3.8_android    文件:EntailmentChecker.java   
public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
}
项目:owltools    文件:AxiomAnnotationTools.java   
@Override
public OWLAxiom visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
    return factory.getOWLNegativeObjectPropertyAssertionAxiom(axiom.getProperty(), axiom.getSubject(), axiom.getObject(), annotations);
}
项目:owltools    文件:CardinalityContraintsTools.java   
@Override
public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
}
项目:Wolpertinger    文件:OWLNormalization.java   
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());
}
项目:born    文件:CycleDetector.java   
@Override
public Boolean visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
    return true;
}
项目:born    文件:ElAxiomFilter.java   
@Override
public Boolean visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
    return false;
}
项目:born    文件:AnnotationProcessor.java   
@Override
public Boolean visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
    Objects.requireNonNull(axiom);
    return add(this.df.getOWLNegativeObjectPropertyAssertionAxiom(axiom.getProperty(), axiom.getSubject(),
            axiom.getObject(), reg(axiom.getAnnotations())));
}
项目:born    文件:AnnotationCreator.java   
@Override
public Boolean visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
    Objects.requireNonNull(axiom);
    return add(this.df.getOWLNegativeObjectPropertyAssertionAxiom(axiom.getProperty(), axiom.getSubject(),
            axiom.getObject(), empty()));
}
项目:semantika    文件:TMappingProcessor.java   
@Override
public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom)
{
   ignoreOwlAxiom("NegavtiveObjectPropertyAssertion", axiom);
}
项目:OWL2SPARQL    文件:OWLAxiomToSPARQLConverter.java   
@Override
public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
    aBoxAxiomsNotSupportedWarning(axiom);
}
项目:owlapi-gwt    文件:OWLObjectVisitorExAdapter.java   
@Override
public O visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
    return doDefault(axiom);
}