exporting query results from command line in several formats

6 views
Skip to first unread message

Samy Deghou

unread,
Sep 1, 2016, 5:59:10 AM9/1/16
to Stardog
The user interface provides a nice export functions (to export the results in CSV,TSV,JSON or XML).

How do you do this on the command line ?


Zachary Whitley

unread,
Sep 1, 2016, 6:18:49 AM9/1/16
to sta...@clarkparsia.com

On Sep 1, 2016, at 5:59 AM, Samy Deghou <samy....@gmail.com> wrote:

The user interface provides a nice export functions (to export the results in CSV,TSV,JSON or XML).

How do you do this on the command line ?


--
-- --
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
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.

Pavel Klinov

unread,
Sep 1, 2016, 6:27:19 AM9/1/16
to sta...@clarkparsia.com
Hi Samy,

The data export command [1] takes the -f (--format) parameter.

Cheers,
Pavel


On Thu, Sep 1, 2016 at 11:59 AM, Samy Deghou <samy....@gmail.com> wrote:
The user interface provides a nice export functions (to export the results in CSV,TSV,JSON or XML).

How do you do this on the command line ?


--
-- --
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

Samy Deghou

unread,
Sep 1, 2016, 6:40:04 AM9/1/16
to sta...@clarkparsia.com
Thanks for the fast replies and the link to the page.

I came across that page a coupe of weeks, but this is a function to export a graph (or full DB), right ? Not the results of a query ? It is still not entirely clear to me how you export the results of a specific query

I was expecting something like:

stardog data export --format TSV  --query "SELECT * WHERE {?s ?p ?o }" <MY-DB>

but the --query option is not available.

Do you have a work around maybe using constructs ?
This does not seem to work:

./bin/stardog data export --format RDF/XML --named-graph "construct{?s ?p ?o} where {?s ?o ?p} " smatDB




---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+unsubscribe@clarkparsia.com.

Pavel Klinov

unread,
Sep 1, 2016, 6:50:00 AM9/1/16
to sta...@clarkparsia.com
If you want results of a query, you should use the "query" command [1].

It also takes the --format parameter.

Cheers,
Pavel

Reply all
Reply to author
Forward
0 new messages