1

I would like to export the results of my SPARQL query from Blazegraph into a file. However, it exports only the first page of the results. When I try to display all results, my browser crashes.

How can I fix this?

I'm running Blazegraph 2.1.2 on a local cluster.

honk
  • 9,137
  • 11
  • 75
  • 83
Fabian_G
  • 431
  • 4
  • 16
  • How did you do the export? And what did you try to display all results? Such information might help readers in order to help you. Please consider [editing](http://stackoverflow.com/posts/38437787/edit) your question in order to provide some details. – honk Jul 20 '16 at 19:16

2 Answers2

1

To export results you can rely on curl and query your SPARQL endpoint through command line like this:

curl -X POST http://localhost:9999/bigdata/namespace/YOUR_NAMESPACE/sparql --data-urlencode 'query=SELECT * WHERE{ ?s p ?o } LIMIT 1' --data-urlencode 'format=json' > outputfile

You have to specify your endpoint's address of course and your query as you want. This is just an example but it may give you an idea.

Also you can modify your expected output format (CSV, XML, JSON, etc) and include headers if you want.

Here you can read more about it.

honk
  • 9,137
  • 11
  • 75
  • 83
antorqs
  • 619
  • 3
  • 18
  • Thanks aquiros, that works! Blazegraph's web interface does provide an export-results feature (at least mine does). – Fabian_G Jul 28 '16 at 08:05
  • I haven't tried yet the 2.1.2 version so maybe that's it. I'm updating my answer. If it worked for you please consider accepting it. @Fabian_G – antorqs Jul 28 '16 at 08:33
0

If you want to download all your graph you should use a CONSTRUCT query:

curl --X POST \
  --url 'https://{host}/bigdata/namespace/{namespace}/sparql' \
  --data-urlencode 'query=CONSTRUCT { ?s ?p ?o } where { ?s ?p ?o }' \
  --header 'Accept: application/x-turtle' > outputfile.ttl

In this case I am exporting it in a turtle format.

Marcelo Machado
  • 1,179
  • 2
  • 13
  • 33