Package org.semanticweb.owlapi.io

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


        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

    @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

                + "    <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

                + "      </swrl:AtomList>\n"
                + "    </swrl:head>\n"
                + "    <swrla:isRuleEnabled rdf:datatype=\"http://www.w3.org/2001/XMLSchema#boolean\">true</swrla:isRuleEnabled>\n"
                + "    <rdfs:comment rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\">: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

        try {
            // Load an example ontology. In this case, we'll just load the pizza
            // ontology.
            OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
            OWLOntology ontology = manager
                    .loadOntologyFromOntologyDocument(new StringDocumentSource(
                            KOALA));
            System.out.println("Loaded ontology: " + ontology.getOntologyID());
            // We need a reasoner to do our query answering
            OWLReasoner reasoner = createReasoner(ontology);
            // Entities are named using IRIs. These are usually too long for use
View Full Code Here

@SuppressWarnings("javadoc")
public class BlankNodeTestCase extends TestBase {

    @Test
    public void testBlankNodes() throws OWLOntologyCreationException {
        m.loadOntologyFromOntologyDocument(new StringDocumentSource(
                "_:foo <http://example.com/> _:bar .",
                OWLOntologyDocumentSourceBase
                        .getNextDocumentIRI("string:ontology"),
                new TurtleDocumentFormat(), null));
    }
View Full Code Here

        }
        m.saveOntology(ont, format, target);
        handleSaved(target, format);
        OWLOntology ont2 = OWLManager.createOWLOntologyManager()
                .loadOntologyFromOntologyDocument(
                        new StringDocumentSource(target.toString(),
                                OWLOntologyDocumentSourceBase
                                        .getNextDocumentIRI("string:ontology"),
                                format, null),
                        new OWLOntologyLoaderConfiguration()
                                .setReportStackTraces(true));
View Full Code Here

    @Nonnull
    protected OWLOntology loadOntologyFromString(@Nonnull String input)
            throws OWLOntologyCreationException {
        return OWLManager.createOWLOntologyManager()
                .loadOntologyFromOntologyDocument(
                        new StringDocumentSource(input));
    }
View Full Code Here

    }

    @Nonnull
    protected OWLOntology loadOntologyFromString(@Nonnull String input,
            @Nonnull IRI i, @Nonnull OWLDocumentFormat f) {
        StringDocumentSource documentSource = new StringDocumentSource(input,
                i, f, null);
        try {
            return OWLManager.createOWLOntologyManager()
                    .loadOntologyFromOntologyDocument(documentSource);
        } catch (OWLOntologyCreationException e) {
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.io.StringDocumentSource

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.