Examples of OWLObjectProperty


Examples of org.semanticweb.owlapi.model.OWLObjectProperty

        OWLOntology o = OWLManager.createOWLOntologyManager().createOntology();
        // SubObjectPropertyOf( ObjectPropertyChain( a:hasFather a:hasBrother )
        // a:hasUncle ) The brother of someone's father is that person's uncle.
        // SubObjectPropertyOf( ObjectPropertyChain( a:hasChild a:hasUncle )
        // a:hasBrother ) The uncle of someone's child is that person's brother.
        OWLObjectProperty father = df
                .getOWLObjectProperty(IRI("urn:test:hasFather"));
        OWLObjectProperty brother = df
                .getOWLObjectProperty(IRI("urn:test:hasBrother"));
        OWLObjectProperty child = df
                .getOWLObjectProperty(IRI("urn:test:hasChild"));
        OWLObjectProperty uncle = df
                .getOWLObjectProperty(IRI("urn:test:hasUncle"));
        o.getOWLOntologyManager()
                .addAxiom(o, df.getOWLDeclarationAxiom(father));
        o.getOWLOntologyManager().addAxiom(o,
                df.getOWLDeclarationAxiom(brother));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLObjectProperty

    }

    @Test
    public void shouldNotCauseViolations() throws OWLOntologyCreationException {
        OWLOntology o = OWLManager.createOWLOntologyManager().createOntology();
        OWLObjectProperty father = df
                .getOWLObjectProperty(IRI("urn:test:hasFather"));
        OWLObjectProperty brother = df
                .getOWLObjectProperty(IRI("urn:test:hasBrother"));
        OWLObjectProperty child = df
                .getOWLObjectProperty(IRI("urn:test:hasChild"));
        OWLObjectProperty uncle = df
                .getOWLObjectProperty(IRI("urn:test:hasUncle"));
        o.getOWLOntologyManager()
                .addAxiom(o, df.getOWLDeclarationAxiom(father));
        o.getOWLOntologyManager().addAxiom(o,
                df.getOWLDeclarationAxiom(brother));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLObjectProperty

    @Test
    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<>();
        axioms1.add(SubObjectPropertyOf(propA, propB));
        axioms1.add(EquivalentObjectProperties(propA, propB));
        axioms1.add(DisjointObjectProperties(propA, propB));
        axioms1.add(ObjectPropertyDomain(propA, clsA));
        axioms1.add(ObjectPropertyRange(propA, clsA));
        axioms1.add(FunctionalObjectProperty(propA));
        axioms1.add(InverseFunctionalObjectProperty(propA));
        axioms1.add(SymmetricObjectProperty(propA));
        axioms1.add(AsymmetricObjectProperty(propA));
        axioms1.add(TransitiveObjectProperty(propA));
        axioms1.add(ReflexiveObjectProperty(propA));
        axioms1.add(IrreflexiveObjectProperty(propA));
        axioms1.add(ObjectPropertyAssertion(propA, indA, indB));
        axioms1.add(NegativeObjectPropertyAssertion(propA, indA, indB));
        axioms1.add(AnnotationAssertion(annoProp, propA.getIRI(), Literal("X")));
        ont.getOWLOntologyManager().addAxioms(ont, axioms1);
        Set<OWLAxiom> axioms2 = new HashSet<>();
        axioms2.add(SubObjectPropertyOf(propA2, propB));
        axioms2.add(EquivalentObjectProperties(propA2, propB));
        axioms2.add(DisjointObjectProperties(propA2, propB));
        axioms2.add(ObjectPropertyDomain(propA2, clsA));
        axioms2.add(ObjectPropertyRange(propA2, clsA));
        axioms2.add(FunctionalObjectProperty(propA2));
        axioms2.add(InverseFunctionalObjectProperty(propA2));
        axioms2.add(SymmetricObjectProperty(propA2));
        axioms2.add(AsymmetricObjectProperty(propA2));
        axioms2.add(TransitiveObjectProperty(propA2));
        axioms2.add(ReflexiveObjectProperty(propA2));
        axioms2.add(IrreflexiveObjectProperty(propA2));
        axioms2.add(ObjectPropertyAssertion(propA2, indA, indB));
        axioms2.add(NegativeObjectPropertyAssertion(propA2, indA, indB));
        axioms2.add(AnnotationAssertion(annoProp, propA2.getIRI(), Literal("X")));
        OWLEntityRenamer entityRenamer = new OWLEntityRenamer(
                ont.getOWLOntologyManager(), singleton(ont));
        List<OWLOntologyChange> changes = entityRenamer.changeIRI(propA,
                propA2.getIRI());
        ont.getOWLOntologyManager().applyChanges(changes);
        assertEquals(ont.getAxioms(), axioms2);
        List<OWLOntologyChange> changes2 = entityRenamer.changeIRI(
                propA2.getIRI(), propA.getIRI());
        ont.getOWLOntologyManager().applyChanges(changes2);
        assertEquals(ont.getAxioms(), axioms1);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.