How to do a SPARQL update statement via the Stardog CLI?

0 views
Skip to first unread message

Jacobus Geluk

unread,
Mar 21, 2014, 1:00:16 PM3/21/14
to sta...@clarkparsia.com
The stardoq "query execute" CLI command does not like SPARQL INSERT statements it seems. And "stardog data" does not have an option to take a SPARQL Update statement either. So I can only use curl/wget?

Mike Grove

unread,
Mar 21, 2014, 1:25:22 PM3/21/14
to stardog
On Fri, Mar 21, 2014 at 1:00 PM, Jacobus Geluk <jacobu...@gmail.com> wrote:
The stardoq "query execute" CLI command does not like SPARQL INSERT statements it seems. And "stardog data" does not have an option to take a SPARQL Update statement either. So I can only use curl/wget?

What about it doesn't like your insert query?  Using 2.1.2, with an update query example from the spec, it worked fine:

mhgrove:dist mhgrove$ ./bin/stardog query foo "PREFIX dc: <http://purl.org/dc/elements/1.1/>
> INSERT DATA
> { 
>   <http://example/book1> dc:title 'A new book' ;
>                          dc:creator 'A.N.Other' .
> }"
Update query processed successfully.

If you have literals in the query, which use quotes ("), and you're wrapping the query in quotes, the shell can munge the query by mismatching the quote characters.  So if you're using " for the literals, you have to use ' to wrap the query in the shell, or vice versa, otherwise it the string you are passing in won't make it in tact.

Cheers,

Mike
 

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Jacobus Geluk

unread,
Mar 21, 2014, 2:55:31 PM3/21/14
to sta...@clarkparsia.com
You're right, I had some obscure typo in my query. Thanks!
Reply all
Reply to author
Forward
0 new messages