Package org.semanticweb.owlapi.formats

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat


        OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(manager);
        OBOFormatParser p = new OBOFormatParser();
        OBODoc obodoc = p.parse(new URL(iri));
        OWLOntology ontology = bridge.convert(obodoc);
        IRI outputStream = IRI.create(outFile);
        OWLDocumentFormat format = new RDFXMLDocumentFormat();
        LOG.info("saving to {} fmt={}", outputStream, format);
        manager.saveOntology(ontology, format, outputStream);
    }
View Full Code Here


        OBOFormatParser p = new OBOFormatParser();
        OBODoc obodoc = p.parse(new URL(iri));
        obodoc.addDefaultOntologyHeader(defaultOnt);
        OWLOntology ontology = bridge.convert(obodoc);
        IRI outputStream = IRI.create(outFile);
        OWLDocumentFormat format = new RDFXMLDocumentFormat();
        LOG.info("saving to {} fmt={}", outputStream, format);
        manager.saveOntology(ontology, format, outputStream);
    }
View Full Code Here

    @Parameters(name = "{0}")
    public static Collection<Object[]> data() {
        return Arrays.asList(new Object[][] {
                { new FunctionalSyntaxDocumentFormat() },
                { new OWLXMLDocumentFormat() }, { new RDFXMLDocumentFormat() },
                { new TurtleDocumentFormat() }, });
    }
View Full Code Here

        OWLAnnotationProperty p = AnnotationProperty(IRI("http://test.org/MissingDeclaration.owl#p"));
        OWLOntology ontology = createOntology(p);
        assertTrue(ontology.containsAnnotationPropertyInSignature(p.getIRI(),
                EXCLUDED));
        assertEquals(1, ontology.getAxiomCount());
        RDFXMLDocumentFormat format = new RDFXMLDocumentFormat();
        format.setAddMissingTypes(false);
        ontology = loadOntologyStrict(saveOntology(ontology, format));
        assertFalse(ontology.containsAnnotationPropertyInSignature(p.getIRI(),
                EXCLUDED));
        assertEquals(0, ontology.getAxiomCount());
    }
View Full Code Here

        rule = dataFactory.getSWRLRule(body, head);
    }

    @Test
    public void shouldPreserveOrderingInRDFXMLRoundTrip() throws Exception {
        roundTrip(new RDFXMLDocumentFormat());
    }
View Full Code Here

        OWLOntology ont = createOntology();
        assertTrue(ont.getAxioms(AxiomType.SUBCLASS_OF).isEmpty());
        OWLDocumentFormat format = ont.getOWLOntologyManager()
                .getOntologyFormat(ont);
        assertTrue(format instanceof RDFXMLDocumentFormat);
        RDFXMLDocumentFormat rdfxmlFormat = (RDFXMLDocumentFormat) format;
        Set<RDFTriple> triples = rdfxmlFormat.getOntologyLoaderMetaData()
                .getUnparsedTriples();
        assertEquals(1, triples.size());
    }
View Full Code Here

    @Test
    public void shouldDoCompleteRoundtripWithAnnotationsRDFXML()
            throws Exception {
        OWLOntology ontology = prepareOntology();
        OWLDocumentFormat f = new RDFXMLDocumentFormat();
        OWLOntology ontology2 = loadOntologyFromString(saveOntology(ontology, f));
        equal(ontology, ontology2);
        for (OWLAxiom r : ontology2.getAxioms(AxiomType.SWRL_RULE)) {
            assertFalse(r.getAnnotations(df.getRDFSLabel()).isEmpty());
        }
View Full Code Here

    @Test
    public void shouldDoCompleteRoundtripWithAnnotationsDatatypeRDFXML()
            throws Exception {
        OWLOntology ontology = prepareOntology1();
        OWLDocumentFormat f = new RDFXMLDocumentFormat();
        OWLOntology ontology2 = loadOntologyFromString(saveOntology(ontology, f));
        equal(ontology, ontology2);
        for (OWLAxiom r : ontology2.getAxioms(AxiomType.DATATYPE_DEFINITION)) {
            assertFalse(r.getAnnotations(df.getRDFSLabel()).isEmpty());
        }
View Full Code Here

    public OWLOntology createOWLOntology(OWLOntologyManager manager,
            OWLOntologyID ontologyID, IRI documentIRI,
            OWLOntologyCreationHandler handler) {
        OWLOntology ont = super.createOWLOntology(manager, ontologyID,
                documentIRI, handler);
        handler.setOntologyFormat(ont, new RDFXMLDocumentFormat());
        return ont;
    }
View Full Code Here

public class ExistingOutputStreamTestCase extends TestBase {

    @Test
    public void testOutputStreamRemainsOpen() throws Exception {
        OWLOntology ontology = m.createOntology();
        saveOntology(ontology, new RDFXMLDocumentFormat());
        saveOntology(ontology, new OWLXMLDocumentFormat());
        saveOntology(ontology, new TurtleDocumentFormat());
        saveOntology(ontology, new FunctionalSyntaxDocumentFormat());
        saveOntology(ontology, new ManchesterSyntaxDocumentFormat());
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

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.