Examples of RDFXMLParser


Examples of com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser

  parser.getOptions().setStrictErrorMode();

        try {
            java.lang.reflect.Field arpfField = parser.getClass().getDeclaredField("arpf");
            arpfField.setAccessible(true);
            RDFXMLParser arpf = (RDFXMLParser) arpfField.get(parser);
            java.lang.reflect.Field saxParserField = arpf.getClass().getDeclaredField("saxParser");
            saxParserField.setAccessible(true);
            org.apache.xerces.parsers.SAXParser saxParser = (org.apache.xerces.parsers.SAXParser) saxParserField.get(arpf);
            saxParser.setFeature("http://xml.org/sax/features/external-general-entities", false);
        } catch (NoSuchFieldException|IllegalAccessException|SAXException e) {
            throw new RuntimeException("should not be here");
View Full Code Here

Examples of org.jrdf.parser.rdfxml.RdfXmlParser

        this.mapFactory = newMapFactory;
    }

    public void parse(Graph graph, GraphPerformance performance) throws GraphException {
        InputStream stream = getResource();
        Parser parser = new RdfXmlParser(graph.getElementFactory(), mapFactory);
        long startTime = System.currentTimeMillis();
        parse(stream, parser);
        performance.outputResult(graph, startTime, "Testing Parsing Performance (" + PATH + "): ");
    }
View Full Code Here

Examples of org.openrdf.rio.rdfxml.RDFXMLParser

        } catch (final IOException e) {
          System.err.println(e);
          e.printStackTrace();
        }
      } else if (parserType == SesameParserType.RDFXML) {
        final RDFXMLParser parser = new RDFXMLParser();
        parser.setRDFHandler(handler);
        try {
          parser.parse(isr, "");
        } catch (final RDFParseException e) {
          System.err.println(e);
          e.printStackTrace();
        } catch (final RDFHandlerException e) {
          System.err.println(e);
          e.printStackTrace();
        } catch (final IOException e) {
          System.err.println(e);
          e.printStackTrace();
        }
      } else if (parserType == SesameParserType.TURTLE) {
        final TurtleParser parser = new TurtleParser();
        parser.setRDFHandler(handler);
        try {
          parser.parse(isr, "");
        } catch (final RDFParseException e) {
          System.err.println(e);
          e.printStackTrace();
        } catch (final RDFHandlerException e) {
          System.err.println(e);
View Full Code Here

Examples of org.openrdf.rio.rdfxml.RDFXMLParser

            final boolean verifyDataType,
            final boolean stopAtFirstError,
            final ExtractionContext extractionContext,
            final ExtractionResult extractionResult
    ) {
        final RDFXMLParser parser = new RDFXMLParser();
        configureParser(parser, verifyDataType, stopAtFirstError, extractionContext, extractionResult);
        return parser;
    }
View Full Code Here

Examples of org.openrdf.rio.rdfxml.RDFXMLParser

                stream.close();
            }
        } else {
            RDFParser parser = null;
            if ("rdfxml".equals(lang)) {
                parser = new RDFXMLParser(r.getValueFactory());
            } else if ("n3".equals(lang) || "turtle".equals(lang)) {
                parser = new TurtleParser(r.getValueFactory());
            } else if ("ntriples".equals(lang)) {
                parser = new NTriplesParser(r.getValueFactory());
            }
View Full Code Here

Examples of org.openrdf.rio.rdfxml.RdfXmlParser

      {
    parser = new TurtleParser();
    }
      else if(format.equals(RDFFormat.RDFXML))
    {
    parser = new RdfXmlParser();
    }
      else if(format.equals(RDFFormat.NTRIPLES))
      {
    parser = new NTriplesParser();
      }
View Full Code Here

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

    @Test
    public void testMultipleVersionLoadChangeIRI() throws Exception {
        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(i139, v2);
        OWLOntology initialOntology = m
                .createOntology(initialUniqueOWLOntologyID);
        OWLParser initialParser = new RDFXMLParser();
        initialParser.parse(new StringDocumentSource(INPUT), initialOntology,
                config);
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(i139, v2);
        try {
            m.createOntology(secondUniqueOWLOntologyID);
            fail("Did not receive expected OWLOntologyDocumentAlreadyExistsException");
View Full Code Here

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

    @Test
    public void testMultipleVersionLoadNoChange() throws Exception {
        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(i139, v1);
        OWLOntology initialOntology = m
                .createOntology(initialUniqueOWLOntologyID);
        OWLParser parser = new RDFXMLParser();
        parser.parse(new StringDocumentSource(INPUT), initialOntology, config);
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(i139, v1);
        try {
            m.createOntology(secondUniqueOWLOntologyID);
            fail("Did not receive expected OWLOntologyAlreadyExistsException");
        } catch (OWLOntologyAlreadyExistsException e) {
View Full Code Here

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

    @Test
    public void testMultipleVersionLoadsExplicitOntologyIDs() 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());
        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.rdf.rdfxml.parser.RDFXMLParser

    @Test
    public void testMultipleVersionLoadsNoOntologyIDFirstTime()
            throws Exception {
        OWLOntology initialOntology = m.createOntology();
        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
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.