Examples of RDFXMLWriter


Examples of org.jrdf.writer.rdfxml.RdfXmlWriter

        throws Exception {
        long startTime = System.currentTimeMillis();
        Writer out = new FileWriter(new File(dirHandler.getDir(), "foo.rdf"));
        try {
            registry.clear();
            RdfWriter writer = new RdfXmlWriter(registry, new RdfNamespaceMapImpl());
            writer.write(graph, out);
        } finally {
            out.close();
        }
        performance.outputResult(graph, startTime, "Testing RDF/XML Write Performance:");
    }
View Full Code Here

Examples of org.jrdf.writer.rdfxml.RdfXmlWriter

    }

    private static void tryWriteRdfXml(File file, Graph graph) throws Exception {
        final BlankNodeRegistry nodeRegistry = new MemBlankNodeRegistryImpl();
        final RdfNamespaceMap map = new RdfNamespaceMapImpl();
        final RdfWriter writer = new RdfXmlWriter(nodeRegistry, map);
        final OutputStream fileOutputStream = new FileOutputStream(file);
        try {
            writer.write(graph, fileOutputStream);
        } finally {
            fileOutputStream.close();
        }
    }
View Full Code Here

Examples of org.openrdf.rio.rdfxml.RDFXMLWriter

            boolean willFollowAnother,
            PrintStream ps
    ) throws RDFHandlerException {
        final RDFWriter rdfWriter;
        if(format == VocabularyFormat.RDFXML) {
            rdfWriter = new RDFXMLWriter(ps);
            if(willFollowAnother)
                ps.print("\n");
                ps.print(RDF_XML_SEPARATOR);
                ps.print("\n");
        } else if(format == VocabularyFormat.NTriples) {
View Full Code Here

Examples of org.openrdf.rio.rdfxml.RDFXMLWriter

     * @throws RepositoryException
     */
    protected String dumpModelToRDFXML() throws RepositoryException {
        StringWriter w = new StringWriter();
        try {
            conn.export(new RDFXMLWriter(w));
            return w.toString();
        } catch (RDFHandlerException ex) {
            throw new RuntimeException(ex);
        }
    }
View Full Code Here

Examples of org.openrdf.rio.rdfxml.RDFXMLWriter

    {
        RDFHandler rdfxmlWriter;
        try
        {
            File exportFile = new File( localRepository.getParentFile(), fileName );
            rdfxmlWriter = new RDFXMLWriter( new FileOutputStream( exportFile ) );
        }
        catch ( IOException e )
        {
            // fail( e.getMessage() );
            return;
View Full Code Here

Examples of org.openrdf.rio.rdfxml.RDFXMLWriter

    {
        RDFHandler rdfxmlWriter;
        try
        {
            File exportFile = new File( localRepository.getParentFile(), fileName );
            rdfxmlWriter = new RDFXMLWriter( new FileOutputStream( exportFile ) );
        }
        catch ( IOException e )
        {
            return;
        }
View Full Code Here

Examples of org.openrdf.rio.rdfxml.RDFXMLWriter

        }

        RDFHandler rdfxmlWriter;
        try
        {
            rdfxmlWriter = new RDFXMLWriter( new FileOutputStream( localRepository+"/rdf-repository-export.xml" ) );
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException( e.getMessage() );
        }
View Full Code Here

Examples of org.openrdf.rio.rdfxml.RdfXmlWriter

    StringWriter stringWriter = new StringWriter();
    RdfDocumentWriter rdfDocumentWriter;
    if (format == RDFFormat.NTRIPLES) {
      rdfDocumentWriter = new NTriplesWriter(stringWriter);
    } else if (format == RDFFormat.RDFXML) {
      rdfDocumentWriter = new RdfXmlWriter(stringWriter);
    } else {
      rdfDocumentWriter = new TurtleWriter(stringWriter);
    }
   
    try {
View Full Code Here

Examples of org.restlet.ext.rdf.internal.xml.RdfXmlWriter

    public GraphHandler createWriter(MediaType mediaType, Writer writer)
            throws IOException {
        if (MediaType.TEXT_RDF_N3.equals(getMediaType())) {
            return new RdfN3Writer(writer);
        } else if (MediaType.TEXT_XML.equals(getMediaType())) {
            return new RdfXmlWriter(writer);
        } else if (MediaType.APPLICATION_ALL_XML.includes(getMediaType())) {
            return new RdfXmlWriter(writer);
        } else if (MediaType.TEXT_PLAIN.equals(getMediaType())) {
            return new RdfNTriplesWriter(writer);
        } else if (MediaType.TEXT_RDF_NTRIPLES.equals(getMediaType())) {
            return new RdfNTriplesWriter(writer);
        } else if (MediaType.APPLICATION_RDF_TURTLE.equals(getMediaType())) {
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.