Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLDataProperty


    @Test
    public void testRenameDataProperty() {
        OWLOntology ont = getOWLOntology("testont");
        OWLClass clsA = Class(iri("ClsA"));
        OWLDataProperty propA = DataProperty(iri("propA"));
        OWLDataProperty propA2 = DataProperty(iri("propA2"));
        OWLDataPropertyExpression propB = DataProperty(iri("propB"));
        OWLIndividual indA = NamedIndividual(iri("indA"));
        OWLAnnotationProperty annoProp = AnnotationProperty(iri("annoProp"));
        Set<OWLAxiom> axioms1 = new HashSet<>();
        axioms1.add(SubDataPropertyOf(propA, propB));
        axioms1.add(EquivalentDataProperties(propA, propB));
        axioms1.add(DisjointDataProperties(propA, propB));
        axioms1.add(DataPropertyDomain(propA, clsA));
        axioms1.add(DataPropertyRange(propA, TopDatatype()));
        axioms1.add(FunctionalDataProperty(propA));
        axioms1.add(DataPropertyAssertion(propA, indA, Literal(33)));
        axioms1.add(NegativeDataPropertyAssertion(propA, indA, Literal(44)));
        axioms1.add(AnnotationAssertion(annoProp, propA.getIRI(), Literal("X")));
        ont.getOWLOntologyManager().addAxioms(ont, axioms1);
        Set<OWLAxiom> axioms2 = new HashSet<>();
        axioms2.add(SubDataPropertyOf(propA2, propB));
        axioms2.add(EquivalentDataProperties(propA2, propB));
        axioms2.add(DisjointDataProperties(propA2, propB));
        axioms2.add(DataPropertyDomain(propA2, clsA));
        axioms2.add(DataPropertyRange(propA2, TopDatatype()));
        axioms2.add(FunctionalDataProperty(propA2));
        axioms2.add(DataPropertyAssertion(propA2, indA, Literal(33)));
        axioms2.add(NegativeDataPropertyAssertion(propA2, indA, Literal(44)));
        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


    @Test
    public void testRenameIndividual() {
        OWLOntology ont = getOWLOntology("testont");
        OWLClass clsA = Class(iri("ClsA"));
        OWLDataProperty propA = DataProperty(iri("propA"));
        OWLObjectProperty propB = ObjectProperty(iri("propB"));
        OWLNamedIndividual indA = NamedIndividual(iri("indA"));
        OWLNamedIndividual indB = NamedIndividual(iri("indA"));
        OWLAnnotationProperty annoProp = AnnotationProperty(iri("annoProp"));
        Set<OWLAxiom> axioms1 = new HashSet<>();
        axioms1.add(ClassAssertion(clsA, indA));
        axioms1.add(DataPropertyAssertion(propA, indA, Literal(33)));
        axioms1.add(NegativeDataPropertyAssertion(propA, indA, Literal(44)));
        axioms1.add(AnnotationAssertion(annoProp, propA.getIRI(), Literal("X")));
        axioms1.add(ObjectPropertyAssertion(propB, indA, indB));
        axioms1.add(NegativeObjectPropertyAssertion(propB, indA, indB));
        ont.getOWLOntologyManager().addAxioms(ont, axioms1);
        Set<OWLAxiom> axioms2 = new HashSet<>();
        axioms2.add(ClassAssertion(clsA, indB));
        axioms2.add(DataPropertyAssertion(propA, indB, Literal(33)));
        axioms2.add(NegativeDataPropertyAssertion(propA, indB, Literal(44)));
        axioms2.add(AnnotationAssertion(annoProp, propA.getIRI(), Literal("X")));
        axioms2.add(ObjectPropertyAssertion(propB, indB, indB));
        axioms2.add(NegativeObjectPropertyAssertion(propB, indB, indB));
        OWLEntityRenamer entityRenamer = new OWLEntityRenamer(
                ont.getOWLOntologyManager(), singleton(ont));
        List<OWLOntologyChange> changes = entityRenamer.changeIRI(indA,
View Full Code Here

        assertNotNull(obj);
    }

    @Test
    public void testEqualsPositiveDisjointDataProperties() {
        OWLDataProperty a = DP(IRI());
        OWLDataProperty b = DP(IRI());
        OWLDataProperty c = DP(IRI());
        OWLObject objA = testSubject.getOWLDisjointDataPropertiesAxiom(a, b, c);
        OWLObject objB = testSubject.getOWLDisjointDataPropertiesAxiom(a, b, c);
        assertEquals(objA, objB);
    }
View Full Code Here

        assertEquals(objA, objB);
    }

    @Test
    public void testEqualsNegativeDisjointDataProperties() {
        OWLDataProperty a = DP(IRI());
        OWLDataProperty b = DP(IRI());
        OWLObject objA = testSubject.getOWLDisjointDataPropertiesAxiom(a, b);
        OWLDataProperty c = DP(IRI());
        OWLObject objB = testSubject.getOWLDisjointDataPropertiesAxiom(a, b, c);
        assertFalse(objA.equals(objB));
    }
View Full Code Here

        assertFalse(objA.equals(objB));
    }

    @Test
    public void testHashCodeDisjointDataProperties() {
        OWLDataProperty a = DP(IRI());
        OWLDataProperty b = DP(IRI());
        OWLDataProperty c = DP(IRI());
        OWLObject objA = testSubject.getOWLDisjointDataPropertiesAxiom(a, b, c);
        OWLObject objB = testSubject.getOWLDisjointDataPropertiesAxiom(a, b, c);
        assertEquals(objA.hashCode(), objB.hashCode());
    }
View Full Code Here

        assertEquals(objA.hashCode(), objB.hashCode());
    }

    @Test
    public void testAsSubAxiomsEquivalentDataProperties() {
        OWLDataProperty a = DP(IRI());
        OWLDataProperty b = DP(IRI());
        OWLDataPropertyExpression[] properties = { a, b };
        OWLEquivalentDataPropertiesAxiom objA = testSubject
                .getOWLEquivalentDataPropertiesAxiom(properties);
        assertEquals(2, objA.asSubDataPropertyOfAxioms().size());
    }
View Full Code Here

        assertNotNull(obj);
    }

    @Test
    public void testEqualsPositiveEquivalentDataProperties() {
        OWLDataProperty a = DP(IRI());
        OWLDataProperty b = DP(IRI());
        OWLDataProperty c = DP(IRI());
        OWLObject objA = testSubject.getOWLEquivalentDataPropertiesAxiom(a, b,
                c);
        OWLObject objB = testSubject.getOWLEquivalentDataPropertiesAxiom(a, b,
                c);
        assertEquals(objA, objB);
View Full Code Here

        assertEquals(objA, objB);
    }

    @Test
    public void testEqualsNegativeEquivalentDataProperties() {
        OWLDataProperty a = DP(IRI());
        OWLDataProperty b = DP(IRI());
        OWLObject objA = testSubject.getOWLEquivalentDataPropertiesAxiom(a, b);
        OWLDataProperty c = DP(IRI());
        OWLObject objB = testSubject.getOWLEquivalentDataPropertiesAxiom(a, b,
                c);
        assertFalse(objA.equals(objB));
    }
View Full Code Here

        assertFalse(objA.equals(objB));
    }

    @Test
    public void testHashCodeEquivalentDataProperties() {
        OWLDataProperty a = DP(IRI());
        OWLDataProperty b = DP(IRI());
        OWLDataProperty c = DP(IRI());
        OWLObject objA = testSubject.getOWLEquivalentDataPropertiesAxiom(a, b,
                c);
        OWLObject objB = testSubject.getOWLEquivalentDataPropertiesAxiom(a, b,
                c);
        assertEquals(objA.hashCode(), objB.hashCode());
View Full Code Here

        assertEquals(restA.hashCode(), restB.hashCode());
    }

    @Test
    public void testCreationDataExact() {
        OWLDataProperty prop = DP(IRI());
        int cardinality = 3;
        OWLDataCardinalityRestriction restA = testSubject
                .getOWLDataExactCardinality(cardinality, prop,
                        testSubject.getTopDatatype());
        assertNotNull(restA);
View Full Code Here

TOP

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

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.