Package org.openrdf.repository

Examples of org.openrdf.repository.RepositoryConnection.export()


              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();
              }
            }catch(RepositoryException ex){
              throw new RuntimeException(ex);
View Full Code Here


    con1.add(ciaScheme, ciaScheme.toExternalForm(), RDFFormat.forFileName(ciaScheme.toExternalForm()));
    con1.add(ciaFacts, ciaFacts.toExternalForm(), RDFFormat.forFileName(ciaFacts.toExternalForm()));

    StringWriter writer = new StringWriter();
    RDFWriter rdfWriter = rdfWriterFactory.getWriter(writer);
    con1.export(rdfWriter);

    con1.close();

    Repository rep2 = new SailRepository(new MemoryStore());
    rep2.initialize();
View Full Code Here

          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();
          }
        }catch(RepositoryException ex){
          throw new RuntimeException(ex);
View Full Code Here

          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();
          }
        }catch(RepositoryException ex){
          throw new RuntimeException(ex);
View Full Code Here

        RepositoryConnection conLMFVideo = respLMFVideo.getTriples().getConnection();
        conLMFVideo.begin();
        Assert.assertTrue(conLMFVideo.size() > 0);

        conLMFVideo.export(Rio.createWriter(RDFFormat.TURTLE, System.out));


        // run a SPARQL test to see if the returned data is correct
        InputStream sparql = this.getClass().getResourceAsStream("vimeo-video.sparql");
        BooleanQuery testLabel = conLMFVideo.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
View Full Code Here

        BooleanQuery testLabel = conLMFVideo.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
        Assert.assertTrue("SPARQL test query failed", testLabel.evaluate());

        if(log.isDebugEnabled()) {
            StringWriter out = new StringWriter();
            conLMFVideo.export(Rio.createWriter(RDFFormat.TURTLE, out));
            log.debug("DATA:");
            log.debug(out.toString());
        }

        conLMFVideo.commit();
View Full Code Here

        RepositoryConnection conChannel = respChannel.getTriples().getConnection();
        conChannel.begin();
        Assert.assertTrue(conChannel.size() > 0);

        conChannel.export(Rio.createWriter(RDFFormat.TURTLE, System.out));


        // run a SPARQL test to see if the returned data is correct
        InputStream sparql = this.getClass().getResourceAsStream("vimeo-channel.sparql");
        BooleanQuery testLabel = conChannel.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
View Full Code Here

        BooleanQuery testLabel = conChannel.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
        Assert.assertTrue("SPARQL test query failed", testLabel.evaluate());

        if(log.isDebugEnabled()) {
            StringWriter out = new StringWriter();
            conChannel.export(Rio.createWriter(RDFFormat.TURTLE, out));
            log.debug("DATA:");
            log.debug(out.toString());
        }

        conChannel.commit();
View Full Code Here

        BooleanQuery testLabel = conArticle.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
        Assert.assertTrue("SPARQL test query failed", testLabel.evaluate());

        if(log.isDebugEnabled()) {
            StringWriter out = new StringWriter();
            conArticle.export(Rio.createWriter(RDFFormat.TURTLE, out));
            log.debug("DATA:");
            log.debug(out.toString());
        }

        conArticle.commit();
View Full Code Here

                RepositoryConnection con = response.getTriples().getConnection();
                con.begin();

                ByteArrayOutputStream out = new ByteArrayOutputStream();
                RDFHandler handler = new RDFXMLPrettyWriter(out);
                con.export(handler);

                con.commit();
                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.