Best way to query a store with SELECT and serialize the result (as rdf or json)

25 views
Skip to first unread message

Flyon

unread,
May 8, 2012, 12:41:40 PM5/8/12
to arc-dev
It looks like ARC2 serializers are only using so called 'Index'
results, but a SELECT query is not returning that.
So if I want to select all triples in my store and print them as JSON,
how can I do that?

This selects them all,
$res = $this->store->query("SELECT ?s ?p ?o WHERE { ?s ?p ?o } ");
but then this wont work
$json = $this->store->toRDFJSON($res,$this->prefixes);

This is does the trick, but is a verrrry heavy query
$this->store->query("DESCRIBE ?s ?p ?o WHERE { ?s ?p ?o } ");

so ... does anyone know if there is a build-in way to build 'index'
from a select query with 3 variables?

or another way to use SELECT restults to serialize into some format?
Reply all
Reply to author
Forward
0 new messages