Package org.apache.jena.riot.system

Examples of org.apache.jena.riot.system.StreamRDF


            try {
                Graph g = GraphFactory.createDefaultGraph() ;
                HttpEntity entity = response.getEntity() ;
                MediaType mt = MediaType.create(response.getFirstHeader(HttpNames.hContentType).getValue()) ;
                mt.getCharset() ;
                StreamRDF dest = StreamRDFLib.graph(g) ;
                InputStream in = entity.getContent() ;
                LangRIOT parser = createParser(in, baseIRI, dest) ;
                parser.parse() ;
                in.close() ;
                this.graph = g ;
View Full Code Here


public class NTriplesWriter extends WriterGraphRIOTBase
{
    public static void write(OutputStream out, Iterator<Triple> iter)
    {
        StreamRDF s = StreamRDFLib.writer(out) ;
        s.start() ;
        StreamRDFLib.triplesToStream(s, iter) ;
        s.finish();
    }
View Full Code Here

        s.finish();
    }
   
    public static void write(Writer out, Iterator<Triple> iter)
    {
        StreamRDF s = StreamRDFLib.writer(out) ;
        s.start() ;
        StreamRDFLib.triplesToStream(s, iter) ;
        s.finish();
    }
View Full Code Here

public class NQuadsWriter extends WriterDatasetRIOTBase
{
    public static void write(OutputStream out, Iterator<Quad> iter)
    {
        StreamRDF s = StreamRDFLib.writer(out) ;
        s.start() ;
        StreamRDFLib.quadsToStream(s, iter) ;
        s.finish();
    }
View Full Code Here

        s.finish();
    }
   
    public static void write(Writer out, Iterator<Quad> iter)
    {
        StreamRDF s = StreamRDFLib.writer(out) ;
        s.start() ;
        StreamRDFLib.quadsToStream(s, iter) ;
        s.finish();
    }
View Full Code Here

    }
   
    private DatasetGraph parseToDataset(String string)
    {
        DatasetGraph dsg = DatasetLib.createDatasetGraphMem() ;
        StreamRDF dest = StreamRDFLib.dataset(dsg) ;
        parse(dest, string) ;
        return dsg ;
    }
View Full Code Here

    private Graph parseAsRDFJSON (ByteArrayOutputStream bout)
    {
        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray()) ;
        Graph graph = GraphFactory.createGraphMem() ;
        StreamRDF dest = StreamRDFLib.graph(graph) ;
        LangRIOT parser = RiotReader.createParserRdfJson(bin, dest) ;
        parser.parse() ;
        return graph ;
    }
View Full Code Here

       
        NodeToLabel labels = SyntaxLabels.createNodeToLabel() ;
        if ( labelsAsGiven )
            labels = NodeToLabel.createBNodeByLabelEncoded() ;
       
        StreamRDF s = StreamRDFLib.sinkNull() ;
        if ( ! modLangParse.toBitBucket() )
            s = StreamRDFLib.writer(output) ;
       
        // add dest output
        if ( destOut != null)
View Full Code Here

                log.debug("  ->"+target) ;
            existedBefore = target.exists() ;
            Graph g = target.graph() ;
            if ( overwrite && existedBefore )
                clearGraph(target) ;
            StreamRDF sink = StreamRDFLib.graph(g) ;
            incomingData(action, sink);
            action.commit() ;
            return existedBefore ;
        } catch (RiotException ex) {
            // Parse error
View Full Code Here

     * @return whether the target existed beforehand.
     */
   
    protected static boolean addDataIntoNonTxn(HttpAction action, boolean overwrite) {
        Graph graphTmp = GraphFactory.createGraphMem() ;
        StreamRDF dest = StreamRDFLib.graph(graphTmp) ;

        try { incomingData(action, dest); }
        catch (RiotException ex) {
            errorBadRequest(ex.getMessage()) ;
            return false ;
View Full Code Here

TOP

Related Classes of org.apache.jena.riot.system.StreamRDF

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.