1.17 RDF Support for Materialized Join Views

The most frequently used joins in RDF queries are subject-subject and subject-object joins. To enhance the RDF query performance, you can create materialized join views on those two columns.

Materialized join views can be created on a single RDF graph, or on more than one graphs by creating an RDF graph collection with the 'ALLOW_DUP=T' option, and then creating the materialized join view on that RDF graph collection. All materialized views are owned by the network owner. (To create a materialized join view, use the SEM_APIS.CREATE_MATERIALIZED_VIEW procedure.)

The materialized views are compressed by default, and in-memory can be enabled if the IMDB option is installed. Two materialized views are created on subject-subject join (SS-join) and subject-object join (SO-join) between two tables named, for example, T0 and T1, and all G,S,P,O values are fetched by a deterministic function using the IDs. The values can optionally be defined as a virtual column. In other words, only G,S,P,O IDs for both T0 and T1 are real columns, and the rest are virtual columns. It is recommended that the virtual columns be used with in-memory virtual column enabled, so that the values are materialized in memory if the IMDB option is installed.

A bitmap index can be created on a single column in the materialized view. The materialized view columns are named as follows in each table in the join:

  • Graph ID: G
  • Subject ID: S
  • Predicate ID: P
  • Object ID: O
  • Graph name: GV
  • Subject name: SV
  • Predicate name: PV
  • Object name: OV
  • value type: $RDFVTYP
  • literal type: $RDFLTYP
  • language type: $RDFLANG
  • order_type: $RDFORDT
  • order_num: $RDFORDN
  • order_date: $RDFORDD

For example, if a materialized view named MVX is created, the following join views are created:

SS-join (MVX$SS) and SO-join (MVX$SO)

MVX$SS(T0G, T0S, T0P, T0O, T1G, T1S, T1P, T1O,
  T0GV, T0G$RDFVTYP, T0G$RDFLTYP, T0G$RDFLANG, T0G$RDFORDT, T0G$RDFORDN, T0G$RDFORDD
  T0SV, T0S$RDFVTYP, T0S$RDFLTYP, T0S$RDFLANG, T0S$RDFORDT, T0S$RDFORDN, T0S$RDFORDD
  T0PV, T0P$RDFVTYP, T0P$RDFLTYP, T0P$RDFLANG, T0P$RDFORDT, T0P$RDFORDN, T0P$RDFORDD
  T0OV, T0O$RDFVTYP, T0O$RDFLTYP, T0O$RDFLANG, T0O$RDFORDT, T0O$RDFORDN, T0O$RDFORDD
  T1GV, T1G$RDFVTYP, T1G$RDFLTYP, T1G$RDFLANG, T1G$RDFORDT, T1G$RDFORDN, T1G$RDFORDD
  T1SV, T1S$RDFVTYP, T1S$RDFLTYP, T1S$RDFLANG, T1S$RDFORDT, T1S$RDFORDN, T1S$RDFORDD
  T1PV, T1P$RDFVTYP, T1P$RDFLTYP, T1P$RDFLANG, T1P$RDFORDT, T1P$RDFORDN, T1P$RDFORDD
  T1OV, T1O$RDFVTYP, T1O$RDFLTYP, T1O$RDFLANG, T1O$RDFORDT, T1O$RDFORDN, T1O$RDFORDD)

The same column names for the MVX$SO join view are specified as well.

When a bitmap index is created on a SS-join view, the index is named <MView name><index column name>_I0$. Similarly, the index is named <MView name><index column name>_I1$ for SO-join view. For example, if an index is created on a column T0P in the materialized view MVX, then the index name would be MVXT0P_I0$ for the SS-join view and MVXT0P_I1$ for the SO-join view.