Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLObjectPropertyAssertionAxiom


        OWLNamedIndividual mary = factory.getOWLNamedIndividual(":Mary", pm);
        OWLObjectProperty hasWife = factory
                .getOWLObjectProperty(":hasWife", pm);
        // To specify that :John is related to :Mary via the :hasWife property
        // we create an object property assertion and add it to the ontology
        OWLObjectPropertyAssertionAxiom propertyAssertion = factory
                .getOWLObjectPropertyAssertionAxiom(hasWife, john, mary);
        manager.addAxiom(ontology, propertyAssertion);
        // Now let's specify that :John is aged 51. Get hold of a data property
        // called :hasAge
        OWLDataProperty hasAge = factory.getOWLDataProperty(":hasAge", pm);
View Full Code Here


        // property.
        OWLObjectProperty hasFather = dataFactory.getOWLObjectProperty(IRI
                .create(base + "#hasFather"));
        // Now create the actual assertion (triple), as an object property
        // assertion axiom matthew --> hasFather --> peter
        OWLObjectPropertyAssertionAxiom assertion = dataFactory
                .getOWLObjectPropertyAssertionAxiom(hasFather, matthew, peter);
        // Finally, add the axiom to our ontology and save
        AddAxiom addAxiomChange = new AddAxiom(ont, assertion);
        man.applyChange(addAxiomChange);
        // We can also specify that matthew is an instance of Person. To do this
View Full Code Here

                .create(ontologyIRI + "#hasWife"));
        // Now we need to create the assertion that John hasWife Mary. To do
        // this we need an axiom, in this case an object property assertion
        // axiom. This can be thought of as a "triple" that has a subject, john,
        // a predicate, hasWife and an object Mary
        OWLObjectPropertyAssertionAxiom axiom1 = factory
                .getOWLObjectPropertyAssertionAxiom(hasWife, john, mary);
        // We now need to add this assertion to our ontology. To do this, we
        // apply an ontology change to the ontology via the OWLOntologyManager.
        // First we create the change object that will tell the manager that we
        // want to add the axiom to the ontology
View Full Code Here

    }

    @Test
    public void shouldBuildObjectPropertyAssertion() {
        // given
        OWLObjectPropertyAssertionAxiom expected = df
                .getOWLObjectPropertyAssertionAxiom(op, i, i, annotations);
        BuilderObjectPropertyAssertion builder = new BuilderObjectPropertyAssertion(
                expected, df);
        // when
        OWLObject built = builder.buildObject();
View Full Code Here

                + "#peter"));
        // We need the hasFather property
        OWLObjectProperty hasFather = df.getOWLObjectProperty(IRI
                .create(EXAMPLE_IRI + "#hasFather"));
        // matthew --> hasFather --> peter
        OWLObjectPropertyAssertionAxiom assertion = df
                .getOWLObjectPropertyAssertionAxiom(hasFather, matthew, peter);
        // Finally, add the axiom to our ontology and save
        AddAxiom addAxiomChange = new AddAxiom(o, assertion);
        m.applyChange(addAxiomChange);
        // matthew is an instance of Person
View Full Code Here

        OWLNamedIndividual mary = df.getOWLNamedIndividual(":Mary", pm);
        OWLObjectProperty hasWife = df.getOWLObjectProperty(":hasWife", pm);
        // To specify that :John is related to :Mary via the :hasWife property
        // we create an object property
        // assertion and add it to the ontology
        OWLObjectPropertyAssertionAxiom propertyAssertion = df
                .getOWLObjectPropertyAssertionAxiom(hasWife, john, mary);
        m.addAxiom(o, propertyAssertion);
        // Now let's specify that :John is aged 51.
        // Get hold of a data property called :hasAge
        OWLDataProperty hasAge = df.getOWLDataProperty(":hasAge", pm);
View Full Code Here

        OWLNamedIndividual i = df.getOWLNamedIndividual(IRI.create(ns, "i"));
        OWLObjectProperty p = df.getOWLObjectProperty(IRI.create(ns, "p"));
        OWLDataProperty q = df.getOWLDataProperty(IRI.create(ns, "q"));
        OWLOntology ontology = m.createOntology(ont);
        OWLIndividual ind = df.getOWLAnonymousIndividual();
        OWLObjectPropertyAssertionAxiom ax1 = df
                .getOWLObjectPropertyAssertionAxiom(p, i, ind);
        OWLDataPropertyAssertionAxiom ax2 = df
                .getOWLDataPropertyAssertionAxiom(q, ind, df.getOWLLiteral(5));
        m.addAxiom(ontology, ax1);
        m.addAxiom(ontology, ax2);
View Full Code Here

                // As they will have subject and object inverted, we need to
                // collect them here, otherwise the triple will not be included
                // because the subject will not match
                for (OWLAxiom ax : ontology.getReferencingAxioms(individual)) {
                    if (ax instanceof OWLObjectPropertyAssertionAxiom) {
                        OWLObjectPropertyAssertionAxiom candidate = (OWLObjectPropertyAssertionAxiom) ax;
                        if (candidate.getProperty().isAnonymous()
                                && candidate.getObject().equals(individual)) {
                            axioms.add(candidate);
                        }
                    }
                }
            }
View Full Code Here

        OWLOntology ont = getOWLOntology("ont");
        OWLObjectProperty prop = ObjectProperty(iri("prop"));
        OWLNamedIndividual indA = NamedIndividual(iri("indA"));
        OWLNamedIndividual indB = NamedIndividual(iri("indB"));
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLObjectPropertyAssertionAxiom ax = ObjectPropertyAssertion(prop,
                indA, indB);
        man.addAxiom(ont, ax);
        performAxiomTests(ont, ax);
        assertTrue(ont.getObjectPropertyAssertionAxioms(indA).contains(ax));
        assertTrue(ont.getAxioms(indA, EXCLUDED).contains(ax));
View Full Code Here

        OWLDeclarationAxiom daxiomsub = factory.getOWLDeclarationAxiom(sub); // subject
        OWLDeclarationAxiom daxiomobj = factory.getOWLDeclarationAxiom(obj); // object

        OWLClassAssertionAxiom axiomsub = factory.getOWLClassAssertionAxiom(cls, sub); // Istanza
        OWLClassAssertionAxiom axiomobj = factory.getOWLClassAssertionAxiom(cls, obj); // Istanza
        OWLObjectPropertyAssertionAxiom axiomop = factory.getOWLObjectPropertyAssertionAxiom(op, sub, obj); // Obj
                                                                                                            // prop
                                                                                                            // tra
                                                                                                            // individui
        OWLDataPropertyAssertionAxiom axiomvalue = factory
                .getOWLDataPropertyAssertionAxiom(dp, obj, literal1); // Dataprop all'istanza;
View Full Code Here

TOP

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

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.