Package org.semanticweb.owlapi.rdf.rdfxml.parser

Examples of org.semanticweb.owlapi.rdf.rdfxml.parser.RDFXMLParser


     * {@link org.semanticweb.owlapi.rio.RioParserImpl#parse(org.semanticweb.owlapi.io.OWLOntologyDocumentSource, org.semanticweb.owlapi.model.OWLOntology)}
     */
    @Test
    public void testParsePrimerMinimalSubset() throws Exception {
        OWLOntology owlapiOntologyPrimer = m.createOntology();
        RDFXMLParser owlapiParser = new RDFXMLParser();
        OWLDocumentFormat owlapiOntologyFormat = owlapiParser.parse(
                getStream("/rioParserTest1-minimal.rdf"), owlapiOntologyPrimer,
                config);
        assertEquals(4, owlapiOntologyPrimer.getAxiomCount());
        assertEquals(new RDFXMLDocumentFormat(), owlapiOntologyFormat);
        RioParserImpl rioParser = new RioParserImpl(
View Full Code Here


    }

    private void parseOnto(
            @Nonnull OWLOntologyDocumentSource initialDocumentSource,
            @Nonnull OWLOntology initialOntology) throws IOException {
        OWLParser initialParser = new RDFXMLParser();
        initialParser.parse(initialDocumentSource, initialOntology, config);
    }
View Full Code Here

        OWLOntologyDocumentSource initialDocumentSource = getDocument();
        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(jb), Optional.of(v2));
        OWLOntology initialOntology = manager
                .createOntology(initialUniqueOWLOntologyID);
        OWLParser initialParser = new RDFXMLParser();
        initialParser.parse(initialDocumentSource, initialOntology, config);
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(jb), Optional.of(v2));
        try {
            manager.createOntology(secondUniqueOWLOntologyID);
        } catch (OWLOntologyAlreadyExistsException e) {
View Full Code Here

                Optional.of(v1));
        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(jb), Optional.of(v1));
        OWLOntology initialOntology = manager
                .createOntology(initialUniqueOWLOntologyID);
        OWLParser parser = new RDFXMLParser();
        parser.parse(documentSource, initialOntology, config);
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(jb), Optional.of(v1));
        try {
            manager.createOntology(secondUniqueOWLOntologyID);
        } catch (OWLOntologyAlreadyExistsException e) {
View Full Code Here

        OWLOntologyDocumentSource documentSource = getDocument();
        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(jb), Optional.of(v1));
        OWLOntology initialOntology = manager
                .createOntology(initialUniqueOWLOntologyID);
        OWLParser parser = new RDFXMLParser();
        parser.parse(documentSource, initialOntology, config);
        assertEquals(jb, initialOntology.getOntologyID().getOntologyIRI().get());
        assertEquals(v1, initialOntology.getOntologyID().getVersionIRI().get());
        OWLOntologyDocumentSource secondDocumentSource = getDocument();
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(jb), Optional.of(v2));
        OWLOntology secondOntology = manager
                .createOntology(secondUniqueOWLOntologyID);
        OWLParser secondParser = new RDFXMLParser();
        secondParser.parse(secondDocumentSource, secondOntology, config);
        assertEquals(jb, secondOntology.getOntologyID().getOntologyIRI().get());
        assertEquals(v2, secondOntology.getOntologyID().getVersionIRI().get());
    }
View Full Code Here

    @Test
    public void testMultipleVersionLoadsNoOntologyIDFirstTime()
            throws Exception {
        OWLOntologyDocumentSource documentSource = getDocument();
        OWLOntology initialOntology = manager.createOntology();
        OWLParser parser = new RDFXMLParser();
        parser.parse(documentSource, initialOntology, config);
        assertEquals(IRI("http://test.example.org/ontology/0139"),
                initialOntology.getOntologyID().getOntologyIRI().get());
        assertEquals(v1, initialOntology.getOntologyID().getVersionIRI().get());
        OWLOntologyDocumentSource secondDocumentSource = getDocument();
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(jb), Optional.of(v2));
        OWLOntology secondOntology = manager
                .createOntology(secondUniqueOWLOntologyID);
        OWLParser secondParser = new RDFXMLParser();
        secondParser.parse(secondDocumentSource, secondOntology, config);
        assertEquals(jb, secondOntology.getOntologyID().getOntologyIRI().get());
        assertEquals(v2, secondOntology.getOntologyID().getVersionIRI().get());
    }
View Full Code Here

        OWLOntologyDocumentSource documentSource = getDocument();
        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(jb), Optional.<IRI> absent());
        OWLOntology initialOntology = manager
                .createOntology(initialUniqueOWLOntologyID);
        OWLParser parser = new RDFXMLParser();
        parser.parse(documentSource, initialOntology, config);
        assertEquals(jb, initialOntology.getOntologyID().getOntologyIRI().get());
        // FIXME: versionIRI is null for some reason even though it was in the
        // document
        assertEquals(v1, initialOntology.getOntologyID().getVersionIRI().get());
        OWLOntologyDocumentSource secondDocumentSource = getDocument();
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(jb), Optional.of(v2));
        OWLOntology secondOntology = manager
                .createOntology(secondUniqueOWLOntologyID);
        OWLParser secondParser = new RDFXMLParser();
        // NOTE: The following call throws the OWLOntologyRenameException before
        // the patch to TypeOntologyHandler and TPVersionIRIHandler
        secondParser.parse(secondDocumentSource, secondOntology, config);
        assertEquals(jb, secondOntology.getOntologyID().getOntologyIRI().get());
        assertEquals(v2, secondOntology.getOntologyID().getVersionIRI().get());
    }
View Full Code Here

        OWLOntologyDocumentSource secondDocumentSource = getDocument();
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(jb), Optional.of(v2));
        OWLOntology secondOntology = manager
                .createOntology(secondUniqueOWLOntologyID);
        OWLParser secondParser = new RDFXMLParser();
        // the following throws the exception
        secondParser.parse(secondDocumentSource, secondOntology, config);
        assertEquals(jb, secondOntology.getOntologyID().getOntologyIRI().get());
        assertEquals(v2, secondOntology.getOntologyID().getVersionIRI().get());
    }
View Full Code Here

        OWLOntologyDocumentSource documentSource = getDocument();
        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(jb), Optional.of(v1));
        OWLOntology initialOntology = manager
                .createOntology(initialUniqueOWLOntologyID);
        OWLParser parser = new RDFXMLParser();
        parser.parse(documentSource, initialOntology, config);
        assertEquals(jb, initialOntology.getOntologyID().getOntologyIRI().get());
        assertEquals(v1, initialOntology.getOntologyID().getVersionIRI().get());
    }
View Full Code Here

                + "  <owl:Ontology rdf:about=\"http://example.org/rdfxmlparserbug\"/>"
                + "  <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

Related Classes of org.semanticweb.owlapi.rdf.rdfxml.parser.RDFXMLParser

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.