Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLClassAssertionAxiom


    }

    @Test
    public void shouldBuildClassAssertion() {
        // given
        OWLClassAssertionAxiom expected = df.getOWLClassAssertionAxiom(ce, i,
                annotations);
        BuilderClassAssertion builder = new BuilderClassAssertion(expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
View Full Code Here


    public boolean equals(Object obj) {
        if (super.equals(obj)) {
            if (!(obj instanceof OWLClassAssertionAxiom)) {
                return false;
            }
            OWLClassAssertionAxiom other = (OWLClassAssertionAxiom) obj;
            return other.getIndividual().equals(individual)
                    && other.getClassExpression().equals(classExpression);
        }
        return false;
    }
View Full Code Here

        return AxiomType.CLASS_ASSERTION;
    }

    @Override
    protected int compareObjectOfSameType(OWLObject object) {
        OWLClassAssertionAxiom otherAx = (OWLClassAssertionAxiom) object;
        int diff = getIndividual().compareTo(otherAx.getIndividual());
        if (diff != 0) {
            return diff;
        } else {
            return getClassExpression().compareTo(otherAx.getClassExpression());
        }
    }
View Full Code Here

        AddAxiom addAxiomChange = new AddAxiom(o, assertion);
        m.applyChange(addAxiomChange);
        // matthew is an instance of Person
        OWLClass personClass = df.getOWLClass(IRI.create(EXAMPLE_IRI
                + "#Person"));
        OWLClassAssertionAxiom ax = df.getOWLClassAssertionAxiom(personClass,
                matthew);
        // Add this axiom to our ontology - with a convenience method
        m.addAxiom(o, ax);
    }
View Full Code Here

        PrefixManager pm = new DefaultPrefixManager(null, null, base);
        OWLClass person = df.getOWLClass(":Person", pm);
        OWLNamedIndividual mary = df.getOWLNamedIndividual(":Mary", pm);
        // create a ClassAssertion to specify that :Mary is an instance of
        // :Person
        OWLClassAssertionAxiom classAssertion = df.getOWLClassAssertionAxiom(
                person, mary);
        OWLOntology o = m.createOntology(IRI.create(base));
        // Add the class assertion
        m.addAxiom(o, classAssertion);
        // Dump the ontology
View Full Code Here

        // <http://example.com/owl/families/Mary>)
        OWLNamedIndividual mary = dataFactory
                .getOWLNamedIndividual(":Mary", pm);
        // Now create a ClassAssertion to specify that :Mary is an instance of
        // :Person
        OWLClassAssertionAxiom classAssertion = dataFactory
                .getOWLClassAssertionAxiom(person, mary);
        // We need to add the class assertion to the ontology that we want
        // specify that :Mary is a :Person
        OWLOntology ontology = manager.createOntology(IRI.create(base));
        // Add the class assertion
View Full Code Here

        // person class
        OWLClass personClass = dataFactory.getOWLClass(IRI.create(base
                + "#Person"));
        // Now we will create out Class Assertion to specify that matthew is an
        // instance of Person (or rather that Person has matthew as an instance)
        OWLClassAssertionAxiom ax = dataFactory.getOWLClassAssertionAxiom(
                personClass, matthew);
        // Add this axiom to our ontology. We can use a short cut method -
        // instead of creating the AddAxiom change ourselves, it will be created
        // automatically and the change applied
        man.addAxiom(ont, ax);
View Full Code Here

        // Now add all of our domain and range axioms
        manager.addAxioms(ont, domainsAndRanges);
        // Class assertion axioms //We can also explicitly say than an
        // individual is an instance of a given class. To do this we use a Class
        // assertion axiom.
        OWLClassAssertionAxiom classAssertionAx = factory
                .getOWLClassAssertionAxiom(person, john);
        // Add the axiom directly using the addAxiom convenience method on
        // OWLOntologyManager
        manager.addAxiom(ont, classAssertionAx);
        // Inverse property axioms //We can specify the inverse property of
View Full Code Here

    public void testClassAssertionAxiomAccessors() {
        OWLOntology ont = getOWLOntology("ont");
        OWLClass clsA = Class(iri("clsA"));
        OWLNamedIndividual indA = NamedIndividual(iri("indA"));
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLClassAssertionAxiom ax = ClassAssertion(clsA, indA);
        man.addAxiom(ont, ax);
        performAxiomTests(ont, ax);
        assertTrue(ont.getClassAssertionAxioms(indA).contains(ax));
        assertTrue(ont.getClassAssertionAxioms(clsA).contains(ax));
        assertTrue(ont.getAxioms(indA, EXCLUDED).contains(ax));
View Full Code Here

            OWLDatatype dt=axiom.getDatatype();
            OWLDataIntersectionOf dr1=factory.getOWLDataIntersectionOf(factory.getOWLDataComplementOf(dataRange),dt);
            OWLDataIntersectionOf dr2=factory.getOWLDataIntersectionOf(factory.getOWLDataComplementOf(dt),dataRange);
            OWLDataUnionOf union=factory.getOWLDataUnionOf(dr1,dr2);
            OWLClassExpression c=factory.getOWLDataSomeValuesFrom(freshDataProperty,union);
            OWLClassAssertionAxiom ax=factory.getOWLClassAssertionAxiom(c,freshIndividual);
            Tableau tableau=reasoner.getTableau(ax);
            return !tableau.isSatisfiable(true,true,null,null,null,null,null,ReasoningTaskDescription.isAxiomEntailed(axiom));
        }
        else
            return false;
View Full Code Here

TOP

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

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.