1

I am wondering if it is possible to get load speed information when using the Java API.

The code I have to load "large" files (few gb) is this:

        try (InputStream in = new FileInputStream(arguments.input)) {
            RDFParser.create()
                    .source(in)
                    .lang(lang)
                    .errorHandler(ErrorHandlerFactory.errorHandlerStrict)
                    .base("http://example.com/")
                    .streamManager()
                    .parse(model);
        }

The loading seems to work but I have no clue about speed, number of triples parsed etc. Is there a way to get such statistics every n-triples or n-seconds? I am not using tdbloader2 as this code is part of a bigger program.

Jasper
  • 619
  • 1
  • 8
  • 18
  • You could put timign code aroudn that code block. When .apsrer returns, parsing is finished. Dont' format to add a "Txn" around the code. Toe count the triples, consider using `parse(StreamRDF)` with an StreamRDFCountingBase that counts triples and passes the stream onto to another stream that loads the model. (`StreamRDFWrapper` to stack streams) – AndyS Dec 04 '19 at 22:38
  • You might want to use the command line and follow the approach as outlined in http://wiki.bitplan.com/index.php/Get_your_own_copy_of_WikiData#Test_with_Apache_Jena – Wolfgang Fahl May 13 '20 at 06:02

0 Answers0