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=3&rev2=4

  RDF data can be imported into Marmotta in different ways:
  
- == Import data via the UI ==
+ == Import data via the Admin UI ==
  
  This is maybe the easiest way to do it. Just just need to access the Admin UI 
([[http://host/marmotta/core/admin/import.html|http://host/marmotta/core/admin/import.html]]),
 and then provide the file or URL with the file your would like to import. 
Based on the file name, the wizard should automatically detect details such as 
the RDF format that is encoded; but you customize those details, such as the 
target context name where you would like to import the data.
+ 
+ == 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)''
  
  == Import data via the Web Service ==
  
@@ -26, +42 @@

  
  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