Examples of StringDocumentSource


Examples of org.semanticweb.owlapi.io.StringDocumentSource

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

Examples of org.semanticweb.owlapi.io.StringDocumentSource

        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

Examples of org.semanticweb.owlapi.io.StringDocumentSource

@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

Examples of org.semanticweb.owlapi.io.StringDocumentSource

        }
        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

Examples of org.semanticweb.owlapi.io.StringDocumentSource

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

Examples of org.semanticweb.owlapi.io.StringDocumentSource

    }

    @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

Examples of org.semanticweb.owlapi.io.StringDocumentSource

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

Examples of org.semanticweb.owlapi.io.StringDocumentSource

    protected OWLOntology loadOntologyFromString(
            @Nonnull StringDocumentTarget input, OWLDocumentFormat f)
            throws OWLOntologyCreationException {
        return OWLManager.createOWLOntologyManager()
                .loadOntologyFromOntologyDocument(
                        new StringDocumentSource(input.toString(),
                                OWLOntologyDocumentSourceBase
                                        .getNextDocumentIRI("string:ontology"),
                                f, null));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.io.StringDocumentSource

            @Nonnull StringDocumentTarget o,
            @Nonnull OWLOntologyLoaderConfiguration c)
            throws OWLOntologyCreationException {
        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
        return manager.loadOntologyFromOntologyDocument(
                new StringDocumentSource(o), c);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.io.StringDocumentSource

                + "  <owl:Thing rdf:about=\"http://example.com/#1#2\">"
                + "    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#NamedIndividual\"/>"
                + "  </owl:Thing>" + "</rdf:RDF>";
        OWLOntology ontology = m.createOntology();
        RDFXMLParser parser = new RDFXMLParser();
        parser.parse(new StringDocumentSource(rdfContent), ontology, config);
    }
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.