Package org.openrdf.model.impl

Examples of org.openrdf.model.impl.AbstractModel


        return result;
    }

    private static long benchmarkSemarglSesame(File path) throws SAXException, ParseException {
        System.out.println("Semargl-Sesame benchmark");
        AbstractModel model = new LinkedHashModel();
        StreamProcessor streamProcessor = new StreamProcessor(JsonLdParser.connect(SesameSink.connect(new StatementCollector(model))));

        List<File> files = listFiles(path);
        long time = System.nanoTime();
        for (File file : files) {
            streamProcessor.process(file, HTTP_EXAMPLE_COM);
        }
        System.out.println("Model size = " + model.size());
        return System.nanoTime() - time;
    }
View Full Code Here


        return System.nanoTime() - time;
    }

    private static long benchmarkJsonLdJavaSesame(File path) throws SAXException, ParseException {
        System.out.println("JsonLd-Java-Sesame benchmark");
        AbstractModel model = new LinkedHashModel();

        List<File> files = listFiles(path);
        long time = System.nanoTime();
        for (File file : files) {
            try {
                InputStream inputStream = new FileInputStream(file);
                String baseURI = "http://example.org/baseuri/";
                org.openrdf.model.Model statements = Rio.parse(inputStream, baseURI, RDFFormat.JSONLD);
                model.addAll(statements);
            } catch (Exception e) {
                System.out.println("Skipped " + file.getAbsolutePath() + " due to " + e.getMessage());
            }
        }
        System.out.println("Model size = " + model.size());
        return System.nanoTime() - time;
    }
View Full Code Here

TOP

Related Classes of org.openrdf.model.impl.AbstractModel

Copyright © 2018 www.massapicom. 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.