concept SIREn in category lucene

appears as: SIREn
Lucene in Action, Second Edition

This is an excerpt from Manning's book Lucene in Action, Second Edition.

A publicly accessible demonstration of SIREn is running at http://sindice.com, covering more than 50 million crawled structured documents, resulting in over 1 billion entity, predicate, and object triples. SIREn is a powerful alternative to the more common RDF triplestores, typically backed by relational databases and thus often limited when it comes to full-text search.

One of the challenges when indexing RDF is the fact that there’s no fixed schema: anyone can create new terms in their descriptions. This raises important challenges. As you’ll see, SIREn first attempted to use a simplistic mapping of RDF subject, predicate, object triples to documents, where each predicate was a new field. But this led to performance challenges, because the number of fields is unbounded. To solve this, payloads (covered in section 6.5) were used to efficiently encode the tuple information, and the resulting architecture provides a highly scalable schema free RDF search.

SIREn perhaps sets the record for making use of Lucene’s customization APIs: it has created a number of Lucene extensions, including tokenizers (TupleTokenizer), token filters (URINormalisationFilter, SirenPayloadFilter), analyzers (TupleAnalzyer, SPARQLQueryAnalyzer), queries (CellQuery, TupleQuery), and its own query parser to handle SPARQL RDF queries (a standard query language for RDF content, defined by the W3C (World Wide Web Consortium). SIREn’s analysis chain is a good example of using a token’s type to record custom information per token, which is then consumed downstream by another token filter to create the right payloads. SIREn even includes integration with Solr. Such a componentized approach gives SIREn its open architecture, allowing developers to choose components to create their semantic web search application. Advanced stuff ahead!

Listing 13.4. Integration of SIREn through Solr schema.xml
<fieldType name="tuple" class="solr.TextField"> <analyzer type="index" class="org.sindice.solr.plugins.analysis.TupleAnalyzer" words="stopwords.txt"/> <analyzer type="query" class="org.sindice.solr.plugins.analysis.SPARQLQueryAnalyzer" words="stopwords.txt"/> </fieldType> ... <fields> <field name="content" type="tuple" indexed="true" stored="false"/> ... Other field definition ... </fields>

Lucene has long offered these capabilities, but as you’ll see in the next section, its native capabilities aren’t intended for large semistructured document collections with different schemas. For this reason we developed SIREn, a Lucene extension to overcome these shortcomings and efficiently index and query RDF, as well as any textual document with an arbitrary number of metadata fields. Among other things, we developed custom tokenizers, token filters, queries, and scorers.

SIREn is today in use not only in Sindice.com but also within enterprise data integration projects where it serves as a large-scale schema-free semantic search engine to query across large volumes of documents and database records.