<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>cient Linked-List RDF Indexing in Parliament</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Dave Kolas</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ian Emmons</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mike Dean</string-name>
          <email>mdeang@bbn.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>BBN Technologies</institution>
          ,
          <addr-line>Arlington, VA 22209</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <fpage>17</fpage>
      <lpage>32</lpage>
      <abstract>
        <p>As the number and scale of Semantic Web applications in use increases, so does the need to e ciently store and retrieve RDF data. Current published schemes for RDF data management either fail to embrace the schema exibility inherent in RDF or make restrictive assumptions about application usage models. This paper describes a storage and indexing scheme based on linked lists and memory-mapped les, and presents theoretical and empirical analysis of its strengths and weaknesses versus other techniques. This scheme is currently used in Parliament (formerly DAML DB), a triple store with rule support that has recently been released as open source.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        As the number and scale of Semantic Web applications in use increases, so does
the need to e ciently store and retrieve RDF [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] data. A wide variety of RDF and
OWL [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] applications are currently being developed, and each application's
scenario may demand prioritization of one performance metric or another. Current
published schemes for RDF data management either fail to embrace the schema
exibility inherent in RDF or make restrictive assumptions about application
usage models.
      </p>
      <p>Despite the fact that RDF's graph-based data model is inherently di erent
than relational data models, many published schemes for RDF data storage
involve reductions to a traditional RDBMS [3{7]. This results in the de ciencies
of RDBMS's (in exible schemas, inability to e ciently query variable predicates)
being propagated to RDF storage; arguably, avoiding these de ciencies is one of
the major reasons for adopting an RDF data model. Other published approaches
eschew the mapping to an RDBMS, but su er either inadequate load or query
performance for many applications. In this paper, we argue that the storage
approach in Parliament provides excellent load and query performance with low
space consumption and avoids the pitfalls of many other specialized RDF storage
systems.</p>
      <p>
        Parliament [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] (formerly DAML-DB [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]) is a triple store developed by BBN
that has been in use since 2001. During that time, Parliament has been used for
a number of applications from basic research to production. We have found that
it o ers an excellent tradeo between load and query performance, and compares
favorably to commercial RDF data management systems [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
      <p>
        Recently, BBN has decided to release Parliament as an open source project.
Parliament provides the underlying storage mechanism, while using Jena [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] or
Sesame [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] as an external API. This paper explains in detail the underlying
index structure of Parliament, and compares it to other published approaches.
Our hope is that open-sourced Parliament will provide a fast storage alternative
for RDF applications, create a platform upon which storage mechanism and
query optimizer research can be built, and generally advance the state of the art
in RDF data management.
      </p>
      <p>
        The remainder of this paper is structured as follows. Section 2 addresses
related work. Section 3 describes the index structure within Parliament.
Section 4 explains how the operations on the structure are performed. Section 5
provides both worst case and average case analysis of the indexing mechanism,
and Section 6 provides a small empirical comparison to supplement [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>The related work on RDF data management systems falls into two major
categories: solutions that involve a mapping to a relational database, and those that
do not.
2.1</p>
      <sec id="sec-2-1">
        <title>RDBMS Based Approaches</title>
        <p>A large proportion of the previously published approaches involve a mapping of
the RDF data model into some form of relational storage. These include
triplestable approaches, property tables, and vertical partitioning. There is a strong
temptation to use relational systems to store RDF data since such a great amount
of research has been done on making relational systems e cient. Moreover,
existing RDBMS systems are extremely scalable and robust. Unfortunately, each
of the proposed ways of doing this mapping has de ciencies.</p>
        <p>
          The triples-table approach has been employed in 3store [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ], and is perhaps
the most straightforward mapping of RDF into a relational database system.
Each triple given by (s; p; o) is added to one large table of triples with a column
for the subject, predicate, and object respectively. Indexes are then added for
each of the columns. While this approach is straightforward to implement, it
is not particularly e cient, as noted in later work [
          <xref ref-type="bibr" rid="ref10 ref13 ref14 ref4 ref5">4, 5, 13, 14, 10</xref>
          ]. The primary
problem is that queries with multiple triple patterns result in self-joins on this
one large table, and are ine cient.
        </p>
        <p>
          Property tables were introduced later, and allowed multiple triple patterns
referencing the same subject to be retrieved without an expensive join. This
approach has been used in Jena 2 [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. A similar approach is used in [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. In this
approach, each database table includes a column for a subject and several xed
properties. The intent is that these properties often appear together on the same
subject. While this approach does eliminate many of the expensive self-joins in
a triples table, it still has de ciencies leading to limited scalability. Queries with
triple patterns that span multiple property tables are still expensive. Depending
on the level of correlation between the properties chosen for a particular property
table, the table may be very sparse and thus be less space-e cient than other
approaches. Also, it may be complex to determine which sets of properties are
best joined within the same property table. Multi-valued properties are
problematic in this approach as well. Furthermore, queries with unbound variables in the
property position are very ine cient and may require dynamic table creation.
In a data model without a xed schema, it is common to ask for all present
properties for a particular subject. In the property table approach, this type of
query requires scanning all tables. With property tables, adding new properties
also requires adding new tables, a consideration for applications dealing with
arbitrary RDF content. It is the exibility in schema that di erentiates RDF
from relational approaches, and thus this approach limits the bene t of using
RDF.
        </p>
        <p>
          The vertical partitioning approach suggested in [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] may be viewed as a
specialization of the property table approach, where each property table supports
exactly one property. This approach has several advantages over the general
property table approach. It better supports multi-valued properties, which are
common in Semantic Web data, and does not sacri ce the space taken by NULL's
in a sparsely populated property table. It also does not require the
propertyclustering algorithms for the general property tables. However, like the property
table approach, it fails to e ciently handle queries with variables in the property
position.
2.2
        </p>
      </sec>
      <sec id="sec-2-2">
        <title>Other Indexing Approaches</title>
        <p>The other primary approaches to RDF data storage eliminate the need for a
standard RDBMS and focus instead on indexing speci c to the RDF data model.
This set of approaches tends to better address the query models of the semantic
web, but each su ers its own set of weaknesses.</p>
        <p>
          The RDF store YARS [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ] uses six B+ tree indices to store RDF quads
of a subject, predicate, object, and a \context". In each B+ tree, the key is
a concatenation of the subject, predicate, object, and context, each dictionary
encoded. This allows fast lookup of all possible triple access patterns. Unlike the
RDBMS approaches discussed above, this method does not place any
particular preference on the subject, predicate, or object, meaning that queries with
variable predicates are no di erent than those with variable subjects or objects.
This structure sacri ces space for query performance, repeating each dictionary
encoded triple six times. The design also favors query performance to insertion
speed, a tradeo not necessarily appropriate for all Semantic Web applications.
Our approach is more e cient both in insertion time and space usage, as will
be demonstrated. Other commercial applications use this method as well [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ].
Kowari [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ] is designed similarly, but uses a hybrid of AVL and B trees instead
of B+ trees for indexing.
        </p>
        <p>
          The commercial quad store Virtuoso [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ] adds a graph g element to a triple,
and conceptually stores the quads in a triples table expanded by one column.
While technically rooted in a RDBMS, it closely follows the model of YARS [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ],
but with fewer indices. The quads are stored in two covering indices, g; s; p; o
and o; g; p; s, where the IRI's are dictionary encoded. Several further
optimizations are added, including bitmap indexing and inlining of short literal values.
Thus this approach, like YARS, avoids the pitfalls of other RDBMS based work,
including e cient variable-predicate queries. The pattern of fewer indices tips
the balance slightly towards insertion performance from query performance, but
still favors query performance.
        </p>
        <p>
          Hexastore [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ], one of the most recently published approaches, takes a similar
approach to YARS. While it also uses the dictionary encoding of resources, it
uses a series of sorted pointer lists instead of B+ trees of concatenated keys.
Again, this better supports the usage pattern of Semantic Web applications and
does not force them into a RDBMS query model. Hexastore not only provides
e cient single triple pattern lookups as in YARS, but also allows fast
mergejoins for any pair of two triple patterns. Again, however, it su ers a ve-fold
increase in space for storing statements over a dictionary encoded triples table,
and favors query performance over insertion times. It is our experience that
applications often do require e cient statement insertion, and thus our approach
seeks to balance query performance and insertion time. Since this approach was
published most recently and compares favorably to previous approaches, we will
focus our empirical comparison evaluation on Hexastore.
        </p>
        <p>
          Other commercial triple stores such as OWLIM [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ] have been empirically
shown to perform well, but their indexing structure is proprietary and thus no
theoretical comparison can be made.
3
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Index Structure</title>
      <p>This section explains the three parts of the storage structure of Parliament: the
resource table, the statement table, and the resource dictionary. This description
is simpli ed for the sake of clarity; it does not discuss using quads instead of
triples, optimizations for blank nodes, the rule engine, or some small
implementation details. Parliament can be compiled in either 32 or 64 bit modes, and the
width of the elds described varies accordingly.
3.1</p>
      <sec id="sec-3-1">
        <title>Resource Table</title>
        <p>The Resource Table is a single le of xed-length records, each of which
represents a single resource or literal. The records are sequentially numbered, and
this number serves as the ID of the corresponding resource. This allows direct
access to a record given its ID via simple array indexing. Each record has eight
components:
{ Three statement ID elds representing the rst statements that contain this
resource as a subject, predicate, and object, respectively
{ Three count elds containing the number of statements using this resource
as a subject, predicate, and object, respectively
{ An o set into the string representations le described below, used to retrieve
the string representation of the resource
{ Bit- eld ags encoding various attributes of the resource</p>
        <p>The rst subject, rst predicate, and rst object statement identi ers
provide pointers into the statement table, which is described below. The subject,
predicate, and object counts bene t the nd operations and query optimization,
discussed in Section 4. For the remainder of the paper, these counts will be
referred to as count(resource; pos) for the count of a resource in the given
position. The usage of the o set into the string representations le will be explained
below.
3.2</p>
      </sec>
      <sec id="sec-3-2">
        <title>Statement Table</title>
        <p>The Statement Table is the most important part of Parliament's storage
approach. It is similar to the resource table in that it is a single le of xed-length
records, each of which represents a single statement. The records are sequentially
numbered, and this number serves as the ID of the corresponding statement.
Each record has seven components:
{ Three resource ID elds representing the subject, predicate, and object of
the statement, respectively
{ Three statement ID elds representing the next statements that use the same
resource as a subject, predicate, and object, respectively
{ Bit- eld ags encoding various attributes of the statement</p>
        <p>The three resource ID elds allow a statement ID to be translated into the
triple of resources that represent that statement. The three next statement
pointers allow fast traversal of the statements that share either a subject, predicate,
or object, while still storing each statement only once.</p>
        <p>Figure 1 shows an example knowledge base consisting of ve triples. Each
triple row in the statement list table shows its resource identi er as a number and
the pointers to the next statements as arrows. Omitted arrows indicate pointers
to a special statement identi er, the null statement identi er, which indicates
the end of the linked list.
3.3</p>
      </sec>
      <sec id="sec-3-3">
        <title>Resource Dictionary</title>
        <p>
          Like many other triple stores [
          <xref ref-type="bibr" rid="ref12 ref13 ref5 ref6">13, 5, 6, 12</xref>
          ], Parliament uses a dictionary encoding
for its resources. This dictionary provides a one-to-one, bidirectional mapping
between a resource and its resource ID. The rst component of this dictionary
is the mapping from a resource to its associated identi er. This portion of the
dictionary uses Berkeley DB [
          <xref ref-type="bibr" rid="ref18">18</xref>
          ] to implement a B-tree whose keys are the
resources' string representations and whose values are the corresponding resource
ID's. This means that inserts and lookups require logarithmic time.
        </p>
        <p>The second half of the dictionary is the reverse lookup from a resource ID to
a string representation. This is implemented in a memory-mapped le
containing sequential, variable-length, and null-terminated string representations of
resources. A resource ID is translated into the corresponding string representation
by using the resource ID to index into the resource table, retrieving the string
representation o set, and using this to index into the string representations le
to retrieve the associated string. Thus, looking up a string representation from
a resource identi er is a constant time operation.</p>
        <p>The current approach stores each string representation twice. Future
implementations may eliminate this redundancy.
Three of the four les that comprise a Parliament triple store (the resource
table, the statement table, and the string representations le) are stored and
accessed via a common operating system facility called \memory mapping".
This is independent of the index structure of the store, but is worth mentioning
because it confers a signi cant performance advantage. Most modern operating
systems use memory mapping to implement their own demand-paged virtual
memory subsystem, and so this mechanism for accessing les tends to be highly
optimized and keeps frequently accessed pages in memory.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Triple Store Operations</title>
      <p>The three fundamental operations that a triple store can perform are query,
insertion (assertion), and deletion (retraction). These are discussed below.
4.1</p>
      <sec id="sec-4-1">
        <title>Query</title>
        <p>Parliament performs a lookup of a single triple pattern according to the following
algorithm:
1. If any of the triple pattern elements are bound, Parliament uses the B-tree
to translate the string representations of these resources into resource ID's.
2. If any bound elements are not found in the B-tree, then the query result is
the empty set, and the query algorithm terminates.
3. If none of the elements are bound, then the query result is the entire
statement list. Parliament enumerates this by iterating across all of the records in
the statement table and retrieving the string representations of the elements.
4. If exactly one element is bound, then Parliament looks in the resource table
for the resource table the ID of the rst statement using that resource in the
position the resource appears in the given triple pattern.
5. If two or three elements are bound, then Parliament looks in the resource
table for those resource ID's to retrieve count(resource; pos) for each.
Parliament selects the resource whose count is smallest, and retrieves from the
resource table the ID of the rst statement using that resource in the position
the resource appears in the given triple pattern.
6. Starting with that statement ID, Parliament traverses the linked list of
statement records corresponding to the position of the minimal count resource.
7. If the triple pattern contains exactly one bound resource, then this list of
statements is exactly the answer to the query, and again Parliament retrieves
the string representations of the elements as it enumerates the list to form
the query result.
8. If two or three elements are bound, then as Parliament enumerates the linked
list of statements, it checks whether the resources in the positions of the
non-minimal count resources are the same as the bindings in the given triple
pattern. Whenever a match is found, Parliament retrieves the string
representations of the elements and adds that triple to the query result.</p>
        <p>Whenever Parliament is enumerating statements, it skips over statements
whose \deleted" ag has been set. See Section 4.3 below for details.</p>
        <p>
          Parliament is designed as an embedded triple store and does not include a
SPARQL or other query language processor. Such queries are supported by
accessing Parliament as a storage model from higher-level frameworks such as Jena
or Sesame. Single nd operations (as discussed above) are combined together by
the higher-level framework, with Parliament-speci c extensions for optimization.
In particular, when using Parliament with Jena's query processors [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ], we have
used several di erent algorithms for query planning and execution, which will
be detailed in subsequent publications. The basis of these optimizations is the
ability to quickly access the counts of the resources in the given positions.
4.2
        </p>
      </sec>
      <sec id="sec-4-2">
        <title>Insertion</title>
        <p>To insert a triple (s; p; o), Parliament executes the following algorithm:
1. Parliament uses the B-tree to translate the string representations of the three
resources into resource ID's.
2. If all three elements are found in the B-tree, then Parliament performs a
query for the triple pattern (s; p; o). Note that this is necessarily a fully
bound query pattern. If the triple is found, then no insertion is required,
and the algorithm terminates.
3. If any elements are not found in the B-tree, then Parliament creates new
resources for each of them as follows:
(a) Parliament appends the string representation of the resource to the end
of the string representations le. If the le is not large enough to contain
the string, then the le is enlarged rst. The o set of the beginning of
the string is noted for use in the next step.
(b) Parliament appends a new record to the end of the resource table. If
the le is not large enough to contain the new record, then the le is
enlarged rst. The number of the record is saved as the new resource ID
for use in the steps below, and the o set from the string representations
le is written to the appropriate eld in this record. The record's counts
are initialized to zero, and the rst statement ID's are set to null.
(c) Parliament inserts a new entry into the B-tree. The entry contains the
resource's string representation as its key and the new resource ID as its
value.
4. Parliament now has three valid resource ID's representing the triple, and
knows that the triple is not present in the statement table.
5. Parliament appends a new record to the end of the statement table. If the
le is not large enough to contain the new record, then the le is enlarged
rst. The number of the record is saved as the new statement ID for use in
the steps below, and the three resource ID's obtained above are written to
the appropriate elds in this record. The record's next statement ID's are
all set to null.
6. For each of the three resources, Parliament inserts the new statement record
at the head of that resource's linked list for the corresponding triple position
as follows:
(a) The resource record's rst statement ID for the resource's position is
written into the corresponding next statement ID eld in the new
statement record. Note that if this resource was newly inserted for this
statement, then this step will write a null into the next statement ID eld.
(b) The ID of the new statement is written into the resource record's rst
statement ID for the resource's position.
4.3</p>
      </sec>
      <sec id="sec-4-3">
        <title>Deletion</title>
        <p>The index structure of Parliament's statement table is not conducive to the
e cient removal of a statement record from the three linked lists of which it is
a member. These linked lists are singly linked, and so there is no way to remove
a record except to traverse all three lists from the beginning.</p>
        <p>Due to these di culties, Parliament \deletes" statements by marking them
with a ag in the bit eld portion of the statement record. Thus, the algorithm
consists of a nd (as in the case of an insertion, this is a fully bound query
pattern) followed by setting the ag on the found record. In the future, we may
utilize doubly linked lists so that the space occupied by deleted statements can be
reclaimed e ciently. However, in our work to date deletion has been infrequent
enough that this has been deemed a lower priority enhancement.
5</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Theoretical Analysis</title>
      <p>
        As is readily apparent, the presented approach su ers some unfortunate worst
case performance, but the average case performance is quite good. This is
consistent with empirical results presented in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] and this paper. We will address
both nd operations on a single triple pattern and triple insertions.
5.1
      </p>
      <sec id="sec-5-1">
        <title>Worst Case Analysis</title>
        <p>The worst-case performance for a single triple pattern lookup is dependent on
how many of the elements in the pattern (s; p; o) are bound. If zero elements are
bound, the triple pattern results in a total scan of the statement list, resulting
in O(n). Since all triples are the expected result, this is the best possible worst
case performance. If one element is bound, the chain for that particular element
will be traversed with time O(count(bound; pos)). Again exactly the triples that
answer the pattern are traversed.</p>
        <p>Things change slightly for the cases where two or three of the (s; p; o)
elements are bound. If two elements are bound, the shorter of the two lists will be
traversed. This triple pattern can be returned in</p>
        <p>O(min(count(bound1; pos1); count(bound2; pos2)))
However, this could be O(n) if all triples use the two bound elements. If all
three elements are bound, the shortest of the three lists will be traversed. This
shortest list will be longest when the set of statements is exactly the three-way
cross product of the set of resources. In this case, if the number of resources is
m, then the number of statements is m3 and every list is of length m2. Thus the
list length is n2=3, and a nd operation for three bound elements is O(n2=3).</p>
        <p>Since an insertion rst requires a nd on the triple to be inserted, it incurs
the worst-case cost of a nd with three bound elements, O(n2=3). It also incurs
the cost of inserting any nodes in the triple that were not previously known into
the dictionary, but this logarithmic time O(log m) is overshadowed by the worst
case nd time. After that, adding the triple to the head of the lists is done in
O(1) constant time. Thus the worst-case of the insertion operation is O(n2=3).</p>
        <p>Here we note that this worst-case performance is indeed worse than other
previously published approaches, which are logarithmic. However, the scenarios
that produce these worst-case results are quite rare in practice, as will be shown
in the following section.
5.2</p>
      </sec>
      <sec id="sec-5-2">
        <title>Average Case Analysis</title>
        <p>While the worst-case performance is worse than other approaches, analyzing the
relevant qualities of several example data sets leads us to believe that the average
case performance is actually quite good.</p>
        <p>The most relevant feature of a data set with respect to its performance within
this indexing scheme is the length of the various statement lists for a particular
subject, predicate, or object. For instance, the worst-case time of the insert
operation and the nd operation with three bound elements is O(n2=3), but this
is associated with the case that the set of triples is the cross-product of the
subjects, predicates, and objects, which is a highly unlikely real world situation.
Since these bounds are derived from the shortest statement list, analysis of the
average list lengths in a data set is a key measure to how this scheme will perform
in the real world.
{ Due to the previous, insert operations should generally be quite fast.
{ The predicate list is only likely to be used for nd operations when only
the predicate is bound, and thus only when all statements with the given
predicate must be touched to be returned anyway.
{ Find operations with two bound elements, which have the most troubling
theoretical worst-case performance, necessarily include either a bound
subject or bound object. As a result, these too should generally be quite fast.</p>
        <p>These conclusions collectively suggest real world performance that is much
more impressive than the worst-case analysis would imply, and this is shown
empirically in the following section.
6</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Empirical Analysis</title>
      <p>
        Since Hexastore [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] is the most recently published work in this area, and its
indexing structure out performed several of the other approaches, we have focused
our empirical evaluation on Parliament as compared to Hexastore. At the time of
our evaluation, only the prototype Python version of Hexastore was available for
comparison. Future work will compare against the newly released version. This
limitation resulted in the relatively small size of this empirical evaluation; we
could not go beyond the size of main memory without the comparison becoming
unfair to Hexastore. Parliament was tested with 850 million triples in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
      <p>
        Evaluation was performed on a MacBook Pro laptop with a 2.6 GHz dual
core CPU, 4 GB of RAM, and a 7200 RPM SATA HD, running Mac OS X
10.5.7. This platform was most convenient for execution of both systems. While
Hexastore's evaluation focused on only query performance, we feel it is important
to include insertion performance and memory utilization as well, as there are
many Semantic Web applications for which these factors are signi cant. We have
focused on the Lehigh University Benchmark [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ], as it was used in the Hexastore
evaluation and contains insertion time metrics as well. We have evaluated LUBM
queries 1, 2, 3, 4, and 9. Since the version of Hexastore used does not perform
inference, we were forced to modify queries 4 and 9 such that none was required.
      </p>
      <p>The insertion performance graph is shown in Figure 2. The throughput of
Parliament stays fairly stable at approximately 35k statements per second. This
throughput is 3 to 7 times larger than that of Hexastore, which starts at
approximately 9k statements per second, and declines to less than 5k statements per
second as the total number of triples increases. Parliament's throughput results
include both persisting the data to disk (the Python version of Hexastore is
entirely memory-based) and forward chaining for its RDFS inference capabilities.</p>
      <p>Figures 3, 4, 5, 6, and 7 show the relative query performance of Parliament
and Hexastore on LUBM queries 1, 2, 3, 4, and 9 respectively.</p>
      <p>Queries 1, 3, and 4 produce results where both systems appear to be following
the same growth pattern, though Hexastore performs slightly better on queries 1
and 3 and Parliament performs better on query 4. Parliament also demonstrates
more variability in the query execution times, which is likely a result of the
dependency on the operating system's memory mapping functionality.
40 
) 35 
 
d
n
o
c
e
s
 r 30 
0 
3.5 
)s 2.5 
 
d
n
o
c
e
s
llii
m
 (
e
e
s
n
o
p
s
e
R
m
i
 T1.5 
3 
2 
1 
0 
0.0 
0.5 
1.0 
1.5 
2.0 
2.5 
3.0 
3.5 
4.0 </p>
      <p>4.5 
Millions of Statements Loaded </p>
      <sec id="sec-6-1">
        <title>Parliament </title>
      </sec>
      <sec id="sec-6-2">
        <title>HexaStore </title>
        <p>Parliament 
HexaStore 
1400 
1200 
Parliament 
HexaStore 
20 
18 
16 </p>
        <p>Query 4 (modi ed) Response Time
0.0 
0.5 
1.0 
1.5  2.0  2.5  3.0 
Millions of Statements Loaded 
3.5 
4.0 
4.5 
Fig. 7. LUBM</p>
        <p>Query 9 (modi ed) Response Time</p>
        <p>Parliament 
HexaStore 
Parliament 
HexaStore </p>
        <p>Queries 2 and 9 show Parliament and Hexastore following di erent growth
curves, with Parliament performing better in query 9 and Hexastore performing
better in query 2. This is more likely the result of di ering query plans within the
two systems than a strength or de ciency of the storage structure, but without
insight into the query planner of Hexastore we cannot verify this claim.</p>
        <p>Finally, Table 2 shows an estimate of memory used by Hexastore and
Parliament with all 4.3M statements loaded. These numbers are as reported by Mac
OS X, but as is often the case with virtual memory management, the
memory metrics are only useful as course estimates. However, they show what was
expected; Parliament's storage scheme requires signi cantly less storage space.</p>
        <p>Overall, we conclude that Parliament maintains very comparable query
performance to Hexastore, while signi cantly outperforming Hexastore with respect
to insertion throughput and required space.
7</p>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>Conclusions</title>
      <p>In this paper, we have shown the storage and indexing scheme based on linked
lists and memory mapping used in Parliament. This scheme is designed to
balance insertion performance, query performance, and space usage. We found that
while the worst-case performance does not compare favorably with other
approaches, average case analysis indicates good performance. Experiments
demonstrate that Parliament maintains excellent query performance while signi cantly
increasing insertion throughput and decreasing space requirements compared to
Hexastore. Future work will include experiments focusing on di erent query
optimization strategies for Parliament, explanations and analysis of Parliament's
internal rule engine, and further optimizations to the storage structure.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Klyne</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Carroll</surname>
          </string-name>
          , J., eds.:
          <article-title>Resource Description Framework (RDF): Concepts and Abstract Syntax</article-title>
          . W3C
          <string-name>
            <surname>Recommendation</surname>
          </string-name>
          (
          <year>February 2004</year>
          ) http://www.w3.org/TR/2004/REC-rdf-concepts-
          <volume>20040210</volume>
          /.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Dean</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schrieber</surname>
          </string-name>
          , G., eds.:
          <string-name>
            <surname>OWL Web Ontology Language Reference. W3C Recommendation</surname>
          </string-name>
          (
          <year>February 2004</year>
          ) http://www.w3.org/TR/2004/REC-owlref-
          <volume>20040210</volume>
          /.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Harris</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shadbolt</surname>
          </string-name>
          , N.:
          <article-title>Sparql query processing with conventional relational database systems</article-title>
          .
          <source>In: Lecture Notes in Computer Science</source>
          . Springer (
          <year>2005</year>
          )
          <volume>235</volume>
          {
          <fpage>244</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Wilkinson</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sayers</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kuno</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reynolds</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Database</surname>
          </string-name>
          , J.:
          <article-title>E cient rdf storage and retrieval in jena2</article-title>
          .
          <source>In: EXPLOITING HYPERLINKS 349</source>
          .
          <article-title>(</article-title>
          <year>2003</year>
          )
          <volume>35</volume>
          {
          <fpage>43</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Abadi</surname>
            ,
            <given-names>D.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Marcus</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Madden</surname>
            ,
            <given-names>S.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hollenbach</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Scalable semantic web data management using vertical partitioning</article-title>
          .
          <source>In: VLDB '07: Proceedings of the 33rd international conference on Very large data bases</source>
          ,
          <source>VLDB Endowment</source>
          (
          <year>2007</year>
          )
          <volume>411</volume>
          {
          <fpage>422</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Chong</surname>
            ,
            <given-names>E.I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Das</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eadon</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Srinivasan</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>An e cient sql-based rdf querying scheme</article-title>
          .
          <source>In: VLDB '05: Proceedings of the 31st international conference on Very large data bases</source>
          ,
          <source>VLDB Endowment</source>
          (
          <year>2005</year>
          )
          <volume>1216</volume>
          {
          <fpage>1227</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Erling</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mikhailov</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Rdf support in the virtuoso dbms</article-title>
          . In Auer, S.,
          <string-name>
            <surname>Bizer</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          , Muller,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Zhdanova</surname>
          </string-name>
          , A.V., eds.:
          <source>The Social Semantic Web</source>
          <year>2007</year>
          ,
          <source>Proceedings of the 1st Conference on Social Semantic Web (CSSW)</source>
          ,
          <source>September 26-28</source>
          ,
          <year>2007</year>
          , Leipzig, Germany. Volume
          <volume>113</volume>
          of LNI.,
          <source>GI</source>
          (
          <year>2007</year>
          )
          <volume>59</volume>
          {
          <fpage>68</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>8. BBN Technologies: Parliament http://parliament.semwebcentral.org/.</mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Dean</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Neves</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          : DAML DB http://www.daml.org/
          <year>2001</year>
          /09/damldb/.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Rohlo</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dean</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Emmons</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ryder</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sumner</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>An evaluation of triplestore technologies for large data stores</article-title>
          .
          <source>In: On the Move to Meaningful Internet Systems</source>
          <year>2007</year>
          :
          <article-title>OTM 2007 Workshops</article-title>
          , Vilamoura, Portugal, Springer (
          <year>2007</year>
          )
          <volume>1105</volume>
          { 1114 LNCS 4806.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Carroll</surname>
            ,
            <given-names>J.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dickinson</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dollin</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reynolds</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Seaborne</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wilkinson</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Jena: implementing the semantic web recommendations</article-title>
          .
          <source>In: WWW Alt. '04: Proceedings of the 13th international World Wide Web conference on Alternate track papers &amp; posters</source>
          , New York, NY, USA, ACM (
          <year>2004</year>
          )
          <volume>74</volume>
          {
          <fpage>83</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Broekstra</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kampman</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Harmelen</surname>
            ,
            <given-names>F.V.</given-names>
          </string-name>
          :
          <article-title>Sesame: A generic architecture for storing and querying rdf and rdf schema</article-title>
          .
          <source>In: Lecture notes in computer science</source>
          . Volume
          <volume>2342</volume>
          ., Springer (
          <year>2002</year>
          )
          <volume>54</volume>
          {
          <fpage>68</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Weiss</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Karras</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bernstein</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Hexastore: sextuple indexing for semantic web data management</article-title>
          .
          <source>Proc. VLDB Endow</source>
          .
          <volume>1</volume>
          (
          <issue>1</issue>
          ) (
          <year>2008</year>
          )
          <volume>1008</volume>
          {
          <fpage>1019</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Wood</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gearon</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Adams</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Kowari: A platform for semantic web storage and analysis</article-title>
          . In:
          <article-title>XTech2005: XML, the Web and beyond</article-title>
          , Amsterdam (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Harth</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Decker</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Optimized index structures for querying rdf from the web</article-title>
          .
          <source>Web Congress, Latin American</source>
          <volume>0</volume>
          (
          <year>2005</year>
          )
          <volume>71</volume>
          {
          <fpage>80</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Franz</surname>
          </string-name>
          , Inc.: AllegroGraph http://www.franz.com/products/allegrograph/.
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Kiryakov</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ognyanov</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Manov</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Owlim | a pragmatic semantic repository for owl</article-title>
          .
          <source>In: Lecture Notes in Computer Science</source>
          . Volume
          <volume>3807</volume>
          /
          <year>2005</year>
          . Springer (
          <year>2005</year>
          )
          <volume>182</volume>
          {
          <fpage>192</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Olson</surname>
            ,
            <given-names>M.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bostic</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Seltzer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Berkeley db</article-title>
          .
          <source>In: ATEC '99: Proceedings of the annual conference on USENIX Annual Technical Conference</source>
          , Berkeley, CA, USA, USENIX Association (
          <year>1999</year>
          )
          <volume>43</volume>
          {
          <fpage>43</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Dean</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Toward a science of knowledge base performance analysis</article-title>
          .
          <source>In: Invited Talk, 4th International Workshop on Scalable Semantic Web Knowledge Base Systems (SSWS2008)</source>
          , Karlsruhe, Germany (
          <year>October 2008</year>
          ) slide 20 http://asio.bbn.com/
          <year>2008</year>
          /10/iswc2008/mdean-ssws-2008
          <source>-10-27</source>
          .ppt.
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Guo</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Qasem</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pan</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          , He in, J.:
          <article-title>A requirements driven framework for benchmarking semantic web knowledge base systems</article-title>
          .
          <source>IEEE Transactions on Knowledge and Data Engineering</source>
          <volume>19</volume>
          (
          <issue>2</issue>
          ) (
          <year>2007</year>
          )
          <volume>297</volume>
          {
          <fpage>309</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>