Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLObjectPropertyExpression


    }

    @Test
    public void testInverseInverseSimplification() {
        OWLObjectProperty p = ObjectProperty(IRI("p"));
        OWLObjectPropertyExpression inv = ObjectInverseOf(p);
        OWLObjectPropertyExpression inv2 = ObjectInverseOf(inv);
        OWLObjectPropertyExpression exp = inv2.getSimplified();
        assertEquals(p, exp);
    }
View Full Code Here


    }

    @Test
    public void testInverseInverseInverseSimplification() {
        OWLObjectProperty p = ObjectProperty(IRI("p"));
        OWLObjectPropertyExpression inv = ObjectInverseOf(p);
        OWLObjectPropertyExpression inv2 = ObjectInverseOf(inv);
        OWLObjectPropertyExpression inv3 = ObjectInverseOf(inv2);
        OWLObjectPropertyExpression exp = inv3.getSimplified();
        assertEquals(inv, exp);
    }
View Full Code Here

        return (OWLObjectPropertyExpression) super.getPredicate();
    }

    @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());
View Full Code Here

        OWLOntology ont = getOWLOntology("testont");
        OWLClass clsAIRI1 = Class(iri("ClsA1"));
        OWLClass clsAIRI2 = Class(iri("ClsA2"));
        OWLClass clsB = Class(iri("ClsB"));
        OWLClass clsC = Class(iri("ClsC"));
        OWLObjectPropertyExpression propA = ObjectProperty(iri("propA"));
        OWLDataPropertyExpression propB = DataProperty(iri("propA"));
        OWLIndividual indA = NamedIndividual(iri("indA"));
        OWLAnnotationProperty annoProp = AnnotationProperty(iri("annoProp"));
        Set<OWLAxiom> axioms1 = new HashSet<>();
        axioms1.add(SubClassOf(clsAIRI1, clsB));
View Full Code Here

    public void testRenameObjectProperty() {
        OWLOntology ont = getOWLOntology("testont");
        OWLClass clsA = Class(iri("ClsA"));
        OWLObjectProperty propA = ObjectProperty(iri("propA"));
        OWLObjectProperty propA2 = ObjectProperty(iri("propA2"));
        OWLObjectPropertyExpression propB = ObjectProperty(iri("propB"))
                .getInverseProperty();
        OWLIndividual indA = NamedIndividual(iri("indA"));
        OWLIndividual indB = NamedIndividual(iri("indB"));
        OWLAnnotationProperty annoProp = AnnotationProperty(iri("annoProp"));
        Set<OWLAxiom> axioms1 = new HashSet<>();
View Full Code Here

        }

        @Override
        public void handleTriple(IRI subject, IRI predicate, IRI object) {
            if (consumer.isObjectProperty(subject)) {
                OWLObjectPropertyExpression property = translateObjectProperty(subject);
                addAxiom(df.getOWLInverseFunctionalObjectPropertyAxiom(
                        property, getPendingAnnotations()));
                consumeTriple(subject, predicate, object);
            }
        }
View Full Code Here

                @Nonnull IRI subject, @Nonnull IRI predicate,
                @Nonnull IRI object, @Nonnull IRI source,
                @Nonnull IRI property, @Nonnull IRI target,
                @Nonnull Set<OWLAnnotation> annos) {
            OWLIndividual sourceInd = consumer.getOWLIndividual(source);
            OWLObjectPropertyExpression prop = consumer
                    .translateObjectPropertyExpression(property);
            OWLIndividual targetInd = consumer.getOWLIndividual(target);
            consumeTriple(subject, predicate, object);
            addAxiom(df.getOWLNegativeObjectPropertyAssertionAxiom(prop,
                    sourceInd, targetInd, annos));
View Full Code Here

    @Override
    public Node<OWLObjectPropertyExpression> getInverseObjectProperties(
            @Nonnull OWLObjectPropertyExpression pe) {
        ensurePrepared();
        OWLObjectPropertyExpression inv = pe.getInverseProperty()
                .getSimplified();
        return getEquivalentObjectProperties(inv);
    }
View Full Code Here

                    }
                }
                // Inverse of pe
                if (axiom.getObject().equals(ind)
                        && !axiom.getSubject().isAnonymous()) {
                    OWLObjectPropertyExpression invPe = axiom.getProperty()
                            .getInverseProperty().getSimplified();
                    if (!invPe.isAnonymous()
                            && inverses.contains(invPe.asOWLObjectProperty())) {
                        if (getIndividualNodeSetPolicy().equals(
                                IndividualNodeSetPolicy.BY_SAME_AS)) {
                            result.addNode(getSameIndividuals(axiom.getObject()
                                    .asOWLNamedIndividual()));
                        } else {
View Full Code Here

            boolean showBottomNode) {
        if (!showBottomNode && cls.isBottomNode()) {
            return;
        }
        printIndent(level);
        OWLObjectPropertyExpression representative = cls
                .getRepresentativeElement();
        System.out.println(getEquivalentObjectProperties(representative));
        for (Node<OWLObjectPropertyExpression> subProp : getSubObjectProperties(
                representative, true)) {
            assert subProp != null;
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLObjectPropertyExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.