Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.AddAxiom


        OWLClassExpression descB = df.getOWLObjectSomeValuesFrom(prop, clsB);
        Set<OWLClassExpression> classExpressions = new HashSet<>();
        classExpressions.add(descA);
        classExpressions.add(descB);
        OWLAxiom ax = df.getOWLDisjointClassesAxiom(classExpressions);
        m.applyChange(new AddAxiom(ontA, ax));
        OWLOntology ontB = roundTrip(ontA);
        assertTrue(ontB.getAxioms().contains(ax));
    }
View Full Code Here


            throws OWLOntologyCreationException {
        OWLClass cls = createClass();
        OWLAxiom ax = Declaration(cls);
        OWLOntology ont = m.createOntology(OWLOntologyDocumentSourceBase
                .getNextDocumentIRI("urn:testontology"));
        m.applyChange(new AddAxiom(ont, ax));
        assertTrue(ont.getClassesInSignature().contains(cls));
    }
View Full Code Here

            throws OWLOntologyCreationException {
        OWLObjectProperty prop = createObjectProperty();
        OWLAxiom ax = Declaration(prop);
        OWLOntology ont = m.createOntology(OWLOntologyDocumentSourceBase
                .getNextDocumentIRI("urn:testontology"));
        m.applyChange(new AddAxiom(ont, ax));
        assertTrue(ont.getObjectPropertiesInSignature().contains(prop));
    }
View Full Code Here

            throws OWLOntologyCreationException {
        OWLDataProperty prop = createDataProperty();
        OWLAxiom ax = Declaration(prop);
        OWLOntology ont = m.createOntology(OWLOntologyDocumentSourceBase
                .getNextDocumentIRI("urn:testontology"));
        m.applyChange(new AddAxiom(ont, ax));
        assertTrue(ont.getDataPropertiesInSignature().contains(prop));
    }
View Full Code Here

            throws OWLOntologyCreationException {
        OWLNamedIndividual ind = createIndividual();
        OWLAxiom ax = Declaration(ind);
        OWLOntology ont = m.createOntology(OWLOntologyDocumentSourceBase
                .getNextDocumentIRI("urn:testontology"));
        m.applyChange(new AddAxiom(ont, ax));
        assertTrue(ont.getIndividualsInSignature().contains(ind));
    }
View Full Code Here

        OWLObjectProperty p = ObjectProperty(IRI(NS + "#p"));
        OWLDataProperty q = DataProperty(IRI(NS + "#q"));
        OWLIndividual i = AnonymousIndividual();
        OWLOntology ontology = m.createOntology(IRI(NS));
        List<AddAxiom> changes = new ArrayList<>();
        changes.add(new AddAxiom(ontology, SubClassOf(c, ObjectHasValue(p, i))));
        changes.add(new AddAxiom(ontology, ClassAssertion(d, i)));
        changes.add(new AddAxiom(ontology, DataPropertyAssertion(q, i,
                Literal("hello"))));
        m.applyChanges(changes);
        RDFXMLDocumentFormat format = new RDFXMLDocumentFormat();
        format.setDefaultPrefix(NS + '#');
        ontology = roundTrip(ontology, format);
View Full Code Here

    }

    @Test
    public void testOntologyChange() {
        AddAxiomData data = new AddAxiomData(mockAxiom);
        AddAxiom change = data.createOntologyChange(mockOntology);
        assertEquals(change.getOntology(), mockOntology);
        assertEquals(change.getAxiom(), mockAxiom);
    }
View Full Code Here

    }

    @Test
    public void testRoundTripChange() {
        AddAxiomData data = new AddAxiomData(mockAxiom);
        AddAxiom change = new AddAxiom(mockOntology, mockAxiom);
        assertEquals(data, change.getChangeData());
    }
View Full Code Here

            for (OWLAxiom ax : ont.getAxioms()) {
                assert ax != null;
                OWLAxiom dupAx = dup.duplicateObject(ax);
                if (!dupAx.equals(ax)) {
                    changes.add(new RemoveAxiom(ont, ax));
                    changes.add(new AddAxiom(ont, dupAx));
                }
            }
        }
        return changes;
    }
View Full Code Here

    @Test
    public void testSaveAndReload() throws Exception {
        OWLOntology ontA = man.createOntology(IRI
                .create("http://rdfxmltests/ontology"));
        for (OWLAxiom ax : getAxioms()) {
            man.applyChange(new AddAxiom(ontA, ax));
        }
        // OWLOntologyAnnotationAxiom anno =
        // getDataFactory().getOWLOntologyAnnotationAxiom(ontA,
        // getDataFactory().getCommentAnnotation(getClassExpression()));
        // man.applyChange(new AddAxiom(ontA, anno));
View Full Code Here

TOP

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

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.