SPARQL results are HTTP-streamed back from Fuseki (and in TDB
programmatically), as long as you don't use ORDER and select a
streamable serialization format like JSON (not JSON-LD)

That is exactly what I do in
  https://github.com/openphacts/openphacts-irs
to populate an ElasticSearch instance, by generating SPARQL queries to select
certain properties, then iterating
over the JSON response in a streaming way.

As I register one JSON document in ES per SPARQL result (or more
correctly, per subject URI), then I use the bulk loading feature of ES
to chunk of 1000 in one HTTP request to ES.

I don't know which search engine you have, but I guess you could do
something similar.


If you do it through TDBs API then you should not need to worry about
the serialization as you can just use the Iterator normally.


Note that Jena also has its own text-search integration with Solr
and/or ElasticSearch which could be of interest -
https://jena.apache.org/documentation/query/text-query.html

(in my case I need to customize lots of ElasticSearch indexes (and
need the option to populate from Virtuoso instead of Jena)  and so
have rather done it with the streaming script.)


On 10 March 2015 at 14:58, Fabio Ricci <[email protected]> wrote:
> Dear community
>
> does anyone know how to query RDF Data with SPARQL in huge graphs using Jena
> so, that a portion of rdf triples is processed - say 1000 triples at a time
> ?
>
> I need this in order to INDEX triples in a search engine, need therefore to
> access every triple but not all at a time ...
>
> Thank you in advance
> Regards
> Fabio



-- 
Stian Soiland-Reyes
Apache Taverna (incubating), Apache Commons RDF (incubating)
http://orcid.org/0000-0001-9842-9718

Reply via email to