Package org.openrdf.repository

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


        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


        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

        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

        RepositoryConnection conPlaylist = respPlaylist.getTriples().getConnection();
        conPlaylist.begin();
        Assert.assertTrue(conPlaylist.size() > 0);

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

        // run a SPARQL test to see if the returned data is correct
        InputStream sparql = this.getClass().getResourceAsStream("youtube-playlist.sparql");
        BooleanQuery testLabel = conPlaylist.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
        Assert.assertTrue("SPARQL test query failed", testLabel.evaluate());
View Full Code Here

        Assert.assertTrue("SPARQL test query failed", testLabel.evaluate());


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

        conPlaylist.commit();
View Full Code Here

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

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

        connection.commit();
View Full Code Here

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

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

        connection.commit();
View Full Code Here

        LOGGER.info("dumping triple store in format " + format.getName() + " to output stream");
        RDFHandler h = Rio.createWriter(format, out);
        RepositoryConnection rc = getRepository().getConnection();
        try {
            rc.begin();
            rc.export(h);
        } finally {
            rc.rollback();
            rc.close();
        }
    }
View Full Code Here

        OutputStream out = new FileOutputStream(file);
        try {
            RDFHandler h = Rio.createWriter(format, out);
            RepositoryConnection rc = getRepository().getConnection();
            try {
                rc.export(h);
            } finally {
                rc.close();
            }
        } finally {
            out.close();
View Full Code Here

            OutputStream gzipOut = new GZIPOutputStream(out);
            try {
                RDFHandler h = Rio.createWriter(format, gzipOut);
                RepositoryConnection rc = getRepository().getConnection();
                try {
                    rc.export(h);
                } finally {
                    rc.close();
                }
            } finally {
                gzipOut.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.