Streaming version of CONSTRUCT

We have an application that is based around, among other things, efficient
retrieval of tree-shaped RDF graphs.  We tried programming this using
SELECT combined with OPTIONAL clauses, but the resultant cartesian
products made that  approach completely infeasible for large datasets.

Our solution was to return an iterator that generates a tree-shaped graph
at each iteration.  The closest notion to this in SPARQL is the
CONSTRUCT clause -- using SPARQL, we could specify a tree-shaped template,
and return back a graph containing our trees.  However, this would
also have very bad performance, because in our applications, there
may be 10,000 trees, but we only want to see the first few (10-20).
And then maybe a few more.

The problem with CONSTRUCT as currently defined is that it
only returns a single graph.  If it were redefined to return a
stream of graphs (one per template), then we could get exactly the 
efficiency we are
looking for.

Also, it would be nice if LIMIT were defined to apply to CONSTRUCT
as well as select.  Syntactially, it appears to be legal, but the spec 
appears
not to define what it does.   In this case, LIMIT should specify a bound 
on how
many times the template can be instantiated. 

Cheers, Bob
-- 

Bob MacGregor
Chief Scientist

	
	Siderean Software Inc
390 North Sepulveda Blvd., Suite 2070
<http://maps.yahoo.com/py/maps.py?Pyt=Tmap&addr=5155+Rosecrans+Ave&csz=Hawthorne%2C+Ca+90250&country=us> 
El Segundo, CA 90245
bmacgregor@siderean.com <mailto:bmacgregor@siderean.com> 	
tel: 	+1-310 647-4266
fax: 	+1-310-647-3470

 

 

 

 

Received on Sunday, 20 February 2005 23:14:36 UTC