Examples of handleNamespace()


Examples of org.openrdf.rio.RDFHandler.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.RDFHandler.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.RDFHandler.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.RDFHandler.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.RDFHandler.handleNamespace()

    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);
    }
    writer.endRDF();
View Full Code Here

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

        OutputStreamWriter writer = new OutputStreamWriter(out, charset);
        RDFWriter rdf = factory.getWriter(writer);
        try {
          rdf.startRDF();
          for (Map.Entry<String, String> ns : model.getNamespaces().entrySet()) {
            rdf.handleNamespace(ns.getKey(), ns.getValue());
          }
          for (Statement st : model) {
            rdf.handleStatement(st);
          }
          rdf.endRDF();
View Full Code Here

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

        RDFFormat format = Rio.getWriterFormatForFileName(file.getName());
        RDFWriter writer = Rio.createWriter(format, out);

        writer.startRDF();
        for (Map.Entry<String, String> ns : config.getNamespaces().entrySet()) {
          writer.handleNamespace(ns.getKey(), ns.getValue());
        }
        for (Statement st : config) {
          writer.handleStatement(st);
        }
        writer.endRDF();
View Full Code Here

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

      // Report namespace prefixes
      for (Map.Entry<String, String> ns : result.getNamespaces().entrySet()) {
        String prefix = ns.getKey();
        String namespace = ns.getValue();
        if (trimNamespaces == false || firstNamespaces.contains(namespace)) {
          writer.handleNamespace(prefix, namespace);
        }
      }

      // Report staements
      for (Statement st : firstStatements) {
View Full Code Here

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

      // rdfWriter.setBaseURI(requestURL);

      rdfWriter.startRDF();

      for (Map.Entry<String, String> ns : model.getNamespaces().entrySet()) {
        rdfWriter.handleNamespace(ns.getKey(), ns.getValue());
      }

      for (Statement st : model) {
        rdfWriter.handleStatement(st);
      }
View Full Code Here

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

            try{
              RepositoryConnection con = model.getConnection();
              try{
                RDFWriter w = Rio.createWriter(RDFFormat.TURTLE, sw);
                for(Vocabulary v:schema.getPrefixesMap().values()){
                  w.handleNamespace(v.getName(), v.getUri());
                }
                con.export(w);
          }finally{
                con.close();
              }
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.