Package org.semanticweb.owlapi.change

Examples of org.semanticweb.owlapi.change.OWLOntologyChangeRecord


     *         {@code OWLOntologyChange}'s {@link OWLOntology}. Not {@code null}
     *         .
     */
    @Nonnull
    public OWLOntologyChangeRecord getChangeRecord() {
        return new OWLOntologyChangeRecord(ont.getOntologyID(), getChangeData());
    }
View Full Code Here


    @Nonnull
    private final OWLAxiom mockAxiom = mock(OWLAxiom.class);

    @Test
    public void testEquals() {
        OWLOntologyChangeRecord record1 = new OWLOntologyChangeRecord(
                mockOntologyID, mockChangeData);
        OWLOntologyChangeRecord record2 = new OWLOntologyChangeRecord(
                mockOntologyID, mockChangeData);
        assertEquals(record1, record2);
    }
View Full Code Here

        assertEquals(record1, record2);
    }

    @Test
    public void testGettersNotNull() {
        OWLOntologyChangeRecord record = new OWLOntologyChangeRecord(
                mockOntologyID, mockChangeData);
        assertNotNull(record.getOntologyID());
    }
View Full Code Here

        assertNotNull(record.getOntologyID());
    }

    @Test
    public void testGetterEqual() {
        OWLOntologyChangeRecord record = new OWLOntologyChangeRecord(
                mockOntologyID, mockChangeData);
        assertEquals(mockOntologyID, record.getOntologyID());
        assertEquals(mockChangeData, record.getData());
    }
View Full Code Here

    }

    @Test(expected = UnknownOWLOntologyException.class)
    public void testCreateOntologyChange() {
        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
        OWLOntologyChangeRecord changeRecord = new OWLOntologyChangeRecord(
                mockOntologyID, mockChangeData);
        changeRecord.createOntologyChange(manager);
    }
View Full Code Here

            throws OWLOntologyCreationException {
        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
        OWLOntology ontology = manager.createOntology();
        OWLOntologyID ontologyID = ontology.getOntologyID();
        AddAxiomData addAxiomData = new AddAxiomData(mockAxiom);
        OWLOntologyChangeRecord changeRecord = new OWLOntologyChangeRecord(
                ontologyID, addAxiomData);
        OWLOntologyChange change = changeRecord.createOntologyChange(manager);
        assertNotNull(change);
        assertEquals(change.getOntology().getOntologyID(), ontologyID);
        assertEquals(mockAxiom, change.getAxiom());
    }
View Full Code Here

                    @Override
                    public String getName() {
                        return super.getName();
                    }
                }.getName());
        assertEquals("OWLOntologyChangeRecord", new OWLOntologyChangeRecord(
                mock(OWLOntologyID.class), mock(OWLOntologyChangeData.class)) {

            private static final long serialVersionUID = 1L;

            @Override
View Full Code Here

                        throw new RuntimeException("Document IRI is not a local file IRI");
                    }
                    List<OWLOntologyChange> ontologyChangeList = changesByOntology.get(ontology);
                    List<OWLOntologyChangeData> infoList = new ArrayList<OWLOntologyChangeData>();
                    for (OWLOntologyChange change : ontologyChangeList) {
                        OWLOntologyChangeRecord changeRecord = change.getChangeRecord();
                        infoList.add(changeRecord.getData());
                    }
                    File file = new File(docIRI.toURI());
                    BinaryOWLOntologyDocumentSerializer serializer = new BinaryOWLOntologyDocumentSerializer();
                    serializer.appendOntologyChanges(file, new OntologyChangeDataList(infoList,
                                                                                      System.currentTimeMillis(),
View Full Code Here

        try {
            OWLOntologyManager notesOntologyManager = notesOntology.getOWLOntologyManager();
            if(notesOntologyManager.getOntologyFormat(notesOntology) instanceof BinaryOWLOntologyDocumentFormat) {
                List<OWLOntologyChangeData> infoList = new ArrayList<OWLOntologyChangeData>();
                for(OWLOntologyChange change : changes) {
                    OWLOntologyChangeRecord rec = change.getChangeRecord();
                    OWLOntologyChangeData info = rec.getData();
                    infoList.add(info);
                }
                BinaryOWLOntologyDocumentSerializer serializer = new BinaryOWLOntologyDocumentSerializer();
                serializer.appendOntologyChanges(notesOntologyDocument, new OntologyChangeDataList(infoList, System.currentTimeMillis()));
            }
View Full Code Here

        try {
            OWLOntologyManager notesOntologyManager = notesOntology.getOWLOntologyManager();
            if(notesOntologyManager.getOntologyFormat(notesOntology) instanceof BinaryOWLOntologyDocumentFormat) {
                List<OWLOntologyChangeData> infoList = new ArrayList<OWLOntologyChangeData>();
                for(OWLOntologyChange change : changes) {
                    OWLOntologyChangeRecord rec = change.getChangeRecord();
                    OWLOntologyChangeData info = rec.getData();
                    infoList.add(info);
                }
                BinaryOWLOntologyDocumentSerializer serializer = new BinaryOWLOntologyDocumentSerializer();
                serializer.appendOntologyChanges(notesOntologyDocument, new OntologyChangeDataList(infoList, System.currentTimeMillis()));
            }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.change.OWLOntologyChangeRecord

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.