Examples of handleNamespace()


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

        writer.startRDF();
        for( int i = 0; i < namespacePrefixes.length; i++ )
        {
            String namespacePrefix = namespacePrefixes[ i ];
            String namespace = namespaces[ i ];
            writer.handleNamespace( namespacePrefix, namespace );
        }
        for( Statement st : graph )
        {
            writer.handleStatement( st );
        }
View Full Code Here

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

        try{
          RepositoryConnection con = model.getConnection();
          try{
            RDFWriter writer = Rio.createWriter(format, outputStream);
            for(Vocabulary v:schema.getPrefixesMap().values()){
              writer.handleNamespace(v.getName(), v.getUri());
            }
            con.export(writer);
      }finally{
            con.close();
          }
View Full Code Here

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

        try{
          RepositoryConnection con = model.getConnection();
          try{
            RDFWriter w = Rio.createWriter(format, writer);
            for(Vocabulary v:schema.getPrefixesMap().values()){
              w.handleNamespace(v.getName(),v.getUri());
            }
            con.export(w);
      }finally{
            con.close();
          }
View Full Code Here

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

        final StringWriter writer = new StringWriter();

        final RDFWriter jsonldWriter = new SesameJSONLDWriter(writer);
        jsonldWriter.startRDF();
        for (final Namespace prefix : statements.getNamespaces()) {
            jsonldWriter.handleNamespace(prefix.getPrefix(), prefix.getName());
        }
        for (final Statement nextStatement : statements) {
            jsonldWriter.handleStatement(nextStatement);
        }
        jsonldWriter.endRDF();
View Full Code Here

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

        Statement st1 = vf.createStatement(uri1, uri2, plainLit);

        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());
View Full Code Here

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

        final ByteArrayOutputStream out = new ByteArrayOutputStream();
        final RDFWriter rdfWriter = rdfWriterFactory.getWriter(out);
        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);
View Full Code Here

Examples of org.openrdf.rio.helpers.BufferedGroupingRDFHandler.handleNamespace()

  private void writeModel(Model model, RDFFormat format, OutputStream out) throws RDFHandlerException {

    final RDFHandler writer = new BufferedGroupingRDFHandler(Rio.createWriter(format, out));
    writer.startRDF();
    writer.handleNamespace("rdf", RDF.NAMESPACE);
    writer.handleNamespace("rdfs", RDFS.NAMESPACE);
    writer.handleNamespace("skos", SKOS.NAMESPACE);
    writer.handleNamespace("dc", DC.NAMESPACE);
    writer.handleNamespace("primal", PRIMAL.NAMESPACE);
View Full Code Here

Examples of org.openrdf.rio.helpers.BufferedGroupingRDFHandler.handleNamespace()

  private void writeModel(Model model, RDFFormat format, OutputStream out) throws RDFHandlerException {

    final RDFHandler writer = new BufferedGroupingRDFHandler(Rio.createWriter(format, out));
    writer.startRDF();
    writer.handleNamespace("rdf", RDF.NAMESPACE);
    writer.handleNamespace("rdfs", RDFS.NAMESPACE);
    writer.handleNamespace("skos", SKOS.NAMESPACE);
    writer.handleNamespace("dc", DC.NAMESPACE);
    writer.handleNamespace("primal", PRIMAL.NAMESPACE);

    for (final Statement st : model) {
View Full Code Here

Examples of org.openrdf.rio.helpers.BufferedGroupingRDFHandler.handleNamespace()

    final RDFHandler writer = new BufferedGroupingRDFHandler(Rio.createWriter(format, out));
    writer.startRDF();
    writer.handleNamespace("rdf", RDF.NAMESPACE);
    writer.handleNamespace("rdfs", RDFS.NAMESPACE);
    writer.handleNamespace("skos", SKOS.NAMESPACE);
    writer.handleNamespace("dc", DC.NAMESPACE);
    writer.handleNamespace("primal", PRIMAL.NAMESPACE);

    for (final Statement st : model) {
      writer.handleStatement(st);
View Full Code Here

Examples of org.openrdf.rio.helpers.BufferedGroupingRDFHandler.handleNamespace()

    final RDFHandler writer = new BufferedGroupingRDFHandler(Rio.createWriter(format, out));
    writer.startRDF();
    writer.handleNamespace("rdf", RDF.NAMESPACE);
    writer.handleNamespace("rdfs", RDFS.NAMESPACE);
    writer.handleNamespace("skos", SKOS.NAMESPACE);
    writer.handleNamespace("dc", DC.NAMESPACE);
    writer.handleNamespace("primal", PRIMAL.NAMESPACE);

    for (final Statement st : model) {
      writer.handleStatement(st);
    }
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.