Examples of handleStatement()


Examples of org.openrdf.rio.RDFWriter.handleStatement()

                w.startRDF();

                CloseableIteration<? extends Statement, SailException> iter = c.getStatements(null, null, null, false);
                try {
                    while (iter.hasNext()) {
                        w.handleStatement(iter.next());
                    }
                } finally {
                    iter.close();
                }
View Full Code Here

Examples of org.openrdf.rio.RDFWriter.handleStatement()

            String namespace = namespaces[ i ];
            writer.handleNamespace( namespacePrefix, namespace );
        }
        for( Statement st : graph )
        {
            writer.handleStatement( st );
        }
        writer.endRDF();
    }

}
View Full Code Here

Examples of org.openrdf.rio.RDFWriter.handleStatement()

    try {
      RDFWriter writer = Rio.createWriter(RDFFormat.NTRIPLES, export);

      writer.startRDF();
      for (Statement st : statements) {
        writer.handleStatement(st);
      }
      writer.endRDF();
    }
    finally {
      export.close();
View Full Code Here

Examples of org.openrdf.rio.RDFWriter.handleStatement()

        jsonldWriter.startRDF();
        for (final Namespace prefix : statements.getNamespaces()) {
            jsonldWriter.handleNamespace(prefix.getPrefix(), prefix.getName());
        }
        for (final Statement nextStatement : statements) {
            jsonldWriter.handleStatement(nextStatement);
        }
        jsonldWriter.endRDF();

        // System.out.println(writer.toString());
View Full Code Here

Examples of org.openrdf.rio.RDFWriter.handleStatement()

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        RDFWriter rdfWriter = rdfWriterFactory.getWriter(out);
        rdfWriter.getWriterConfig().set(JSONLDSettings.JSONLD_MODE, JSONLDMode.COMPACT);
        rdfWriter.handleNamespace("ex", exNs);
        rdfWriter.startRDF();
        rdfWriter.handleStatement(st1);
        rdfWriter.endRDF();

        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        RDFParser rdfParser = rdfParserFactory.getParser();
        ParserConfig config = new ParserConfig();
View Full Code Here

Examples of org.openrdf.rio.RDFWriter.handleStatement()

        final StringWriter writer = new StringWriter();

        final RDFWriter jsonldWriter = new SesameJSONLDWriter(writer);
        jsonldWriter.startRDF();
        for (final Statement nextStatement : statements) {
            jsonldWriter.handleStatement(nextStatement);
        }
        jsonldWriter.endRDF();

        // System.out.println(writer.toString());
View Full Code Here

Examples of org.openrdf.rio.RDFWriter.handleStatement()

        final WriterConfig writerConfig = rdfWriter.getWriterConfig();
        writerConfig.set(BasicWriterSettings.RDF_LANGSTRING_TO_LANG_LITERAL, true);
        writerConfig.set(BasicWriterSettings.XSD_STRING_TO_PLAIN_LITERAL, true);
        rdfWriter.handleNamespace("ex", ex);
        rdfWriter.startRDF();
        rdfWriter.handleStatement(st1);
        rdfWriter.handleStatement(st2);
        rdfWriter.handleStatement(st3);
        rdfWriter.handleStatement(st4);
        rdfWriter.handleStatement(st5);
        rdfWriter.handleStatement(st6);
View Full Code Here

Examples of org.openrdf.rio.RDFWriter.handleStatement()

        writerConfig.set(BasicWriterSettings.RDF_LANGSTRING_TO_LANG_LITERAL, true);
        writerConfig.set(BasicWriterSettings.XSD_STRING_TO_PLAIN_LITERAL, true);
        rdfWriter.handleNamespace("ex", ex);
        rdfWriter.startRDF();
        rdfWriter.handleStatement(st1);
        rdfWriter.handleStatement(st2);
        rdfWriter.handleStatement(st3);
        rdfWriter.handleStatement(st4);
        rdfWriter.handleStatement(st5);
        rdfWriter.handleStatement(st6);
        rdfWriter.endRDF();
View Full Code Here

Examples of org.openrdf.rio.RDFWriter.handleStatement()

        writerConfig.set(BasicWriterSettings.XSD_STRING_TO_PLAIN_LITERAL, true);
        rdfWriter.handleNamespace("ex", ex);
        rdfWriter.startRDF();
        rdfWriter.handleStatement(st1);
        rdfWriter.handleStatement(st2);
        rdfWriter.handleStatement(st3);
        rdfWriter.handleStatement(st4);
        rdfWriter.handleStatement(st5);
        rdfWriter.handleStatement(st6);
        rdfWriter.endRDF();
View Full Code Here

Examples of org.openrdf.rio.RDFWriter.handleStatement()

        rdfWriter.handleNamespace("ex", ex);
        rdfWriter.startRDF();
        rdfWriter.handleStatement(st1);
        rdfWriter.handleStatement(st2);
        rdfWriter.handleStatement(st3);
        rdfWriter.handleStatement(st4);
        rdfWriter.handleStatement(st5);
        rdfWriter.handleStatement(st6);
        rdfWriter.endRDF();

        final ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
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.