Examples of OWLXMLDocumentFormat


Examples of org.semanticweb.owlapi.formats.OWLXMLDocumentFormat

    @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

Examples of org.semanticweb.owlapi.formats.OWLXMLDocumentFormat

    public void testWriteReadConvertedOWL() throws Exception {
        OBODoc oboDoc = parseOBOFile("namespace-id-rule.obo");
        OWLOntology owlOntology = convert(oboDoc);
        OWLOntologyManager manager = owlOntology.getOWLOntologyManager();
        StringDocumentTarget documentTarget = new StringDocumentTarget();
        manager.saveOntology(owlOntology, new OWLXMLDocumentFormat(),
                documentTarget);
        String owlString = documentTarget.toString();
        OWLOntologyDocumentSource documentSource = new StringDocumentSource(
                owlString);
        OWLOntology reloadedOwl = OWLManager.createOWLOntologyManager()
View Full Code Here

Examples of org.semanticweb.owlapi.formats.OWLXMLDocumentFormat

    }

    @Test
    public void shouldPreserveOrderingInOWLXMLRoundTrip()
            throws OWLOntologyCreationException, OWLOntologyStorageException {
        roundTrip(new OWLXMLDocumentFormat());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.OWLXMLDocumentFormat

                df.getOWLDatatype(XSDVocabulary.STRING.getIRI()), y));
        Set<SWRLAtom> head = new TreeSet<>();
        head.add(df.getSWRLClassAtom(a, x));
        SWRLRule rule = df.getSWRLRule(body, head);
        ontology.getOWLOntologyManager().addAxiom(ontology, rule);
        ontology = roundTrip(ontology, new OWLXMLDocumentFormat());
        OWLOntology onto2 = roundTrip(ontology, new OWLXMLDocumentFormat());
        equal(ontology, onto2);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.OWLXMLDocumentFormat

    @Test
    public void shouldDoCompleteRoundtripWithAnnotationsOWLXML()
            throws Exception {
        OWLOntology ontology = prepareOntology();
        OWLXMLDocumentFormat f = new OWLXMLDocumentFormat();
        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

Examples of org.semanticweb.owlapi.formats.OWLXMLDocumentFormat

    @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

Examples of org.semanticweb.owlapi.formats.OWLXMLDocumentFormat

        return target.toString();
    }

    @Nonnull
    protected StringDocumentTarget writeOWL(@Nonnull OWLOntology ontology) {
        return writeOWL(ontology, new OWLXMLDocumentFormat());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.OWLXMLDocumentFormat

    }

    protected static void renderOWL(@Nonnull OWLOntology owlOntology)
            throws OWLOntologyStorageException {
        OWLOntologyManager manager = owlOntology.getOWLOntologyManager();
        manager.saveOntology(owlOntology, new OWLXMLDocumentFormat(),
                new StringDocumentTarget());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.OWLXMLDocumentFormat

        // }
        // Now save a copy to another location in OWL/XML format (i.e. disregard
        // the format that the ontology was loaded in).
        File f = folder.newFile("owlapiexample_example1.xml");
        IRI documentIRI2 = IRI.create(f);
        manager.saveOntology(ontology, new OWLXMLDocumentFormat(), documentIRI2);
        // Remove the ontology from the manager
        manager.removeOntology(ontology);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.OWLXMLDocumentFormat

        // save it (in a variety of formats). RDF/XML is the default format
        // System.out.println("RDF/XML: ");
        manager.saveOntology(ont, new StringDocumentTarget());
        // OWL/XML
        // System.out.println("OWL/XML: ");
        manager.saveOntology(ont, new OWLXMLDocumentFormat(),
                new StringDocumentTarget());
        // Manchester Syntax
        // System.out.println("Manchester syntax: ");
        manager.saveOntology(ont, new ManchesterSyntaxDocumentFormat(),
                new StringDocumentTarget());
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.