You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@marmotta.apache.org by Thang Chi Duong <sv...@gmail.com> on 2013/08/21 13:40:49 UTC

Import RDF file from local

Hi,
Is it possible to import a file locally ? For example, after log in to the
server,can I use "curl" to upload the an RDF file ? The file is located on
the server also. Or is there a way to use the import web service to upload
a local file ?

I know "curl" can be used to set the configuration parameter as mentioned
in http://marmotta.incubator.apache.org/platform/security-module.html

Best regards,
Thang

Re: Import RDF file from local

Posted by Sergio Fernández <wi...@apache.org>.
Regarding that, MARMOTTA-145 would be useful. Hope to find time one of 
these days to implement it...

On 21/08/13 14:09, Jakob Frank wrote:
> Hi Thang,
>
> sure you can use curl to import/upload a rdf-file to Apache Marmotta.
>
> The admin-ui of the platform is using REST webservices to interact
> with the server, so everything you can do in the admin-UI you can also
> do using curl (although often a little more complicated)
>
> To upload a rdf-file you can use the following curl command:
>
> curl -X POST -H "Content-Type: text/turtle; charset=utf-8"
> -d@rdf-file.ttl ${MARMOTTA_URL}/import/upload
>
> replace ${MARMOTTA_URL} with the base-url of your Marmotta instance,
> and make sure to send the correct content-type!
> If you want to import the data into a specific named graph (e.g.
> http://example/context), append ?context=http://example/context to the
> URL.
>
> If your Marmotta instance settings require username/password you have
> to provide them as curl-option: --user admin:pass123
>
> Best,
> Jakob
>
> On 21 August 2013 13:40, Thang Chi Duong <sv...@gmail.com> wrote:
>> Hi,
>> Is it possible to import a file locally ? For example, after log in to the
>> server,can I use "curl" to upload the an RDF file ? The file is located on
>> the server also. Or is there a way to use the import web service to upload a
>> local file ?
>>
>> I know "curl" can be used to set the configuration parameter as mentioned in
>> http://marmotta.incubator.apache.org/platform/security-module.html
>>
>> Best regards,
>> Thang
>>

-- 
Sergio Fernández

Re: Import RDF file from local

Posted by Jakob Frank <ja...@apache.org>.
Hi Thang,

sure you can use curl to import/upload a rdf-file to Apache Marmotta.

The admin-ui of the platform is using REST webservices to interact
with the server, so everything you can do in the admin-UI you can also
do using curl (although often a little more complicated)

To upload a rdf-file you can use the following curl command:

curl -X POST -H "Content-Type: text/turtle; charset=utf-8"
-d@rdf-file.ttl ${MARMOTTA_URL}/import/upload

replace ${MARMOTTA_URL} with the base-url of your Marmotta instance,
and make sure to send the correct content-type!
If you want to import the data into a specific named graph (e.g.
http://example/context), append ?context=http://example/context to the
URL.

If your Marmotta instance settings require username/password you have
to provide them as curl-option: --user admin:pass123

Best,
Jakob

On 21 August 2013 13:40, Thang Chi Duong <sv...@gmail.com> wrote:
> Hi,
> Is it possible to import a file locally ? For example, after log in to the
> server,can I use "curl" to upload the an RDF file ? The file is located on
> the server also. Or is there a way to use the import web service to upload a
> local file ?
>
> I know "curl" can be used to set the configuration parameter as mentioned in
> http://marmotta.incubator.apache.org/platform/security-module.html
>
> Best regards,
> Thang
>