Examples of StringDocumentSource


Examples of org.semanticweb.owlapi.io.StringDocumentSource

        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(i139,
                absent);
        OWLOntology initialOntology = m
                .createOntology(initialUniqueOWLOntologyID);
        OWLParser parser = new RDFXMLParser();
        parser.parse(new StringDocumentSource(INPUT), initialOntology, config);
        assertEquals(i139, initialOntology.getOntologyID().getOntologyIRI());
        assertEquals(v1, initialOntology.getOntologyID().getVersionIRI());
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(i139, v2);
        OWLOntology secondOntology = m
                .createOntology(secondUniqueOWLOntologyID);
        OWLParser secondParser = new RDFXMLParser();
        secondParser.parse(new StringDocumentSource(INPUT), secondOntology,
                config);
        assertEquals(i139, secondOntology.getOntologyID().getOntologyIRI());
        assertEquals(v2, secondOntology.getOntologyID().getVersionIRI());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.io.StringDocumentSource

        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(i139, v2);
        OWLOntology secondOntology = m
                .createOntology(secondUniqueOWLOntologyID);
        OWLParser secondParser = new RDFXMLParser();
        // the following throws the exception
        secondParser.parse(new StringDocumentSource(INPUT), secondOntology,
                config);
        assertEquals(i139, secondOntology.getOntologyID().getOntologyIRI());
        assertEquals(v2, secondOntology.getOntologyID().getVersionIRI());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.io.StringDocumentSource

    public void testSingleVersionLoadNoChange() throws Exception {
        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(i139, v1);
        OWLOntology initialOntology = m
                .createOntology(initialUniqueOWLOntologyID);
        OWLParser parser = new RDFXMLParser();
        parser.parse(new StringDocumentSource(INPUT), initialOntology, config);
        assertEquals(i139, initialOntology.getOntologyID().getOntologyIRI());
        assertEquals(v1, initialOntology.getOntologyID().getVersionIRI());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.io.StringDocumentSource

        try {
            ontology.getOWLOntologyManager().saveOntology(ontology,
                    new RDFXMLDocumentFormat(), target);
            return OWLManager.createOWLOntologyManager()
                    .loadOntologyFromOntologyDocument(
                            new StringDocumentSource(target));
        } catch (OWLException e) {
            throw new OWLRuntimeException(e);
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.io.StringDocumentSource

        // .create("http://owl.cs.manchester.ac.uk/co-ode-files/ontologies/pizza.owl");
        // OWLOntology pizzaOntology = manager
        // .loadOntologyFromOntologyDocument(iri);
        // in this test, we load from a string instead
        return manager
                .loadOntologyFromOntologyDocument(new StringDocumentSource(
                        KOALA));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.io.StringDocumentSource

        // OWLOntology ontology = manager
        // .loadOntologyFromOntologyDocument(documentIRI);
        // but in this test we don't rely on a remote ontology and load it from
        // a string
        OWLOntology ontology = manager
                .loadOntologyFromOntologyDocument(new StringDocumentSource(
                        KOALA));
        // Print out all of the classes which are contained in the signature of
        // the ontology. These are the classes that are referenced by axioms in
        // the ontology.
        // for (OWLClass cls : ontology.getClassesInSignature()) {
View Full Code Here

Examples of org.semanticweb.owlapi.io.StringDocumentSource

    }

    @Nonnull
    private static OWLOntology loadPizzaOntology(@Nonnull OWLOntologyManager m)
            throws OWLOntologyCreationException {
        return m.loadOntologyFromOntologyDocument(new StringDocumentSource(
                KOALA));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.io.StringDocumentSource

        StringDocumentTarget target = new StringDocumentTarget();
        m.saveOntology(o, target);
        // remove the ontology from the manager, so it can be loaded again
        m.removeOntology(o);
        // create a document source from a string
        StringDocumentSource documentSource = new StringDocumentSource(target);
        // load the ontology from a document source
        OWLOntology o2 = m.loadOntologyFromOntologyDocument(documentSource);
        assertNotNull(o2);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.io.StringDocumentSource

    @Nonnull
    OWLOntology o(@Nonnull String in) {
        try {
            return OWLManager.createOWLOntologyManager()
                    .loadOntologyFromOntologyDocument(
                            new StringDocumentSource(in));
        } catch (OWLOntologyCreationException e) {
            throw new OWLRuntimeException(e);
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.io.StringDocumentSource

                + "    <swrla:isRuleEnabled rdf:datatype=\"http://www.w3.org/2001/XMLSchema#boolean\"\n"
                + "    >true</swrla:isRuleEnabled>\n"
                + "    <rdfs:comment rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\"\n"
                + "    >:i62, :i61</rdfs:comment>\n" + "  </swrl:Imp>\n"
                + "</rdf:RDF>";
        OWLOntology ontology = loadOntologyFromString(new StringDocumentSource(
                input, IRI.create("test"), new RDFXMLDocumentFormat(), null));
        assertTrue(ontology
                .getAxioms(AxiomType.SWRL_RULE)
                .toString()
                .contains(
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.