2 Replies Latest reply on Dec 12, 2013 9:45 AM by marc980813

    NoSQL loading RDF files directly in a named graph


      Hi all,

         I would like to directly upload a file of type turle or RDF/XML into a specific named Graph.

      to do so I used DatasetGraphNoSql.load(importFileName, Lang.TURTLE , conn, graphName);

      but it still loads the results in the default named Graph.

         Of course if my file is of type NQUADS it works.

         To solve the problem, I move in a second step the default Graph into the named Graph using :

      move default to <http://www.w3.org/wine#>

         And by the way, there is a typo in the documentation ( http://localhost:7001/joseki/update.html ): it is not move into but move to, same thing with copy ....


      Any hint on how to do a direct load?


      Thank you


        • 1. Re: NoSQL loading RDF files directly in a named graph

          Hi Marc,


          The DatasetGraphNoSql.load(importFileName, Lang.TURTLE , conn, baseURI) will load the triples into the default graph when dealing with files that are handling multiple named graphs. The last parameter in this operation refers to the base URI to use when converting relative to absolute URIs.


          If you want to load an RDF file directly into a specified named graph you can create a Model instance for this named graph and read the data using the model.read(InputStream, lang) API as in the following code snippet:


          String graphName = "http://www.w3.org/wine#"

          String lang = "TURTLE";

          OracleModelNoSql model = OracleModelNoSql.createOracleModelNoSql(graphName, conn);


          // You can also specify the DOP and Batch Size to use parallel load for this model




          Inputstream in = new FileInputStream(new File(importFileName));

          model.read(in, lang);






          • 2. Re: NoSQL loading RDF files directly in a named graph

            Hi Gaby,

               Many thanks! This is exactly what I was looking for