Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Marmotta Wiki" for 
change notification.

The "ImportData" page has been changed by SergioFernandez:
https://wiki.apache.org/marmotta/ImportData?action=diff&rev1=1&rev2=2

  
  The files copied in the root on that directory would be imported into the 
default context. But sub-folders would be taken into account to select the 
target context name. For instance, if you copy a RDF file into 
`/path/to/marmotta/home/import/foo/bar`, the data would be imported into a 
context named `http://host/marmotta/context/foo/bar`. 
  
+ == Import data via the client library ==
+ 
+ The [[http://marmotta.incubator.apache.org/client-library.html|client 
library]] could be also used to import data. For example, using Java you would 
need something like:
+ 
+ {{{
+ String path = "/path/to/file.rdf";
+ String context = "http://example.org/context";;
+ ClientConfiguration configuration = new 
ClientConfiguration("http://host/marmotta/";);
+ ImportClient importClient = new ImportClient(configuration);
+ InputStream is = new FileInputStream(new File(path));
+ RDFFormat format = Rio.getParserFormatForFileName(path);
+ importClient.uploadDataset(is, format.getDefaultMIMEType(), context);
+ }}}
+ 
+ ''(import and so on have been intentionally removed from the snippet)''
+ 

Reply via email to