Hi Ivan,

thanks again for your fast response!

I suppose the position of the G(raph) in the index pattern shouldn't matter, since the graph part is not position bound, or does it make a difference to create a SPGO or SGPO index, for example?

Besides: in my application I only have one (i.e. the default) graph. Is there a more optimal way to store this, e.g. a Triple structure, while still making use of the existing functions, such as ttlp_mt(...)?


Best regards,
Thomas

Ivan Mikhailov schrieb:
Thomas,

Quads are stored in RDF_QUAD table, as follows:

create table DB.DBA.RDF_QUAD (
  G IRI_ID,
  S IRI_ID,
  P IRI_ID,
  O any,
  primary key (G,S,P,O)
  )
create bitmap index RDF_QUAD_OGPS on DB.DBA.RDF_QUAD (O, G, P, S)
;

(the very beginning of libsrc/Wi/sparql.sql if you build from sources.)

If you performs queries that does not specify fixed graph names, but
specify fixed predicates, the following indexes are quite useful:

create bitmap index RDF_QUAD_PSOG on DB.DBA.RDF_QUAD (P, S, O, G);
create bitmap index RDF_QUAD_POSG on DB.DBA.RDF_QUAD (P, O, S, G);

You can create other indexes as well. Bitmap indexes are preferable, but
if O is the last column then the index can not be bitmap, so it could
be, e.g.
create index RDF_QUAD_PSGO on DB.DBA.RDF_QUAD (P, S, G, O);
but not
create bitmap index RDF_QUAD_PSGO on DB.DBA.RDF_QUAD (P, S, G, O);

Best Regards,

Ivan Mikhailov,
OpenLink Software.


On Fri, 2008-02-22 at 15:46 +0100, Thomas Hornung wrote:
Hi,

are there any special indices that can be turned on for querying RDF data, e.g. subject/object -> predicate? AFAI understand the documentation there is the possibility to use full text indices for literals in the object position ( as mentioned in http://docs.openlinksw.com/virtuoso/rdfsparqlrulefulltext.html), but I couldn't find information on where to tweak other indices.

Does somebody know, if "special" indices are supported or are all indices generated as a default setting.

Best regards,
Thomas




--
--------------------------------------------------------------------------
Dipl.-Inf. Thomas Hornung

Institute of Computer Science
Albert-Ludwigs University
Georges-Koehler-Allee, Building 051, Room 01-028
D-79110 Freiburg im Breisgau

phone:  +49 (761) 203-8128
fax:    +49 (761) 203-8122
e-mail: hornu...@informatik.uni-freiburg.de
web:    http://dbis.informatik.uni-freiburg.de/index.php?person=hornungt/
--------------------------------------------------------------------------


Reply via email to