com.hp.hpl.jena.query.larq
Class IndexBuilderModel

java.lang.Object
  extended by com.hp.hpl.jena.rdf.listeners.StatementListener
      extended by com.hp.hpl.jena.query.larq.IndexBuilderModel
All Implemented Interfaces:
com.hp.hpl.jena.rdf.model.ModelChangedListener
Direct Known Subclasses:
IndexBuilderLiteral, IndexBuilderSubject

public abstract class IndexBuilderModel
extends com.hp.hpl.jena.rdf.listeners.StatementListener

Root class for index creation from a graph or model. This class can be used as a Model listener to index while loading data. It also provides the ability to index from a StmtIterator. Once completed, the index builder should be closed for writing, then the getIndex() called. To update the index once closed, the application should create a new index builder. Any index readers (e.g. IndexLARQ objects) need to be recreated and registered.


Constructor Summary
IndexBuilderModel()
          Create an in-memory index
IndexBuilderModel(java.io.File fileDir)
          Create an on-disk index
IndexBuilderModel(org.apache.lucene.index.IndexWriter existingWriter)
          Manage a Lucene index that has already been created
IndexBuilderModel(java.lang.String fileDir)
          Create an on-disk index
 
Method Summary
 void addedStatement(com.hp.hpl.jena.rdf.model.Statement s)
          ModelListener interface : statement added to the model
 void closeWriter()
          Close the index - no more updates possible
 void flushWriter()
          Flush the index, optimizing it, to allow a reader to be created
 IndexLARQ getIndex()
          Get a search index used by LARQ.
abstract  void indexStatement(com.hp.hpl.jena.rdf.model.Statement s)
          Update index based on one statement
 void indexStatements(com.hp.hpl.jena.rdf.model.StmtIterator sIter)
          Index all the statements from a StmtIterator
 void removedStatement(com.hp.hpl.jena.rdf.model.Statement s)
          ModelListener interface : statement taken out of the model
 void unindexStatement(com.hp.hpl.jena.rdf.model.Statement s)
          Remove index information
 
Methods inherited from class com.hp.hpl.jena.rdf.listeners.StatementListener
addedStatements, addedStatements, addedStatements, addedStatements, notifyEvent, removedStatements, removedStatements, removedStatements, removedStatements
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexBuilderModel

public IndexBuilderModel()
Create an in-memory index


IndexBuilderModel

public IndexBuilderModel(org.apache.lucene.index.IndexWriter existingWriter)
Manage a Lucene index that has already been created


IndexBuilderModel

public IndexBuilderModel(java.io.File fileDir)
Create an on-disk index


IndexBuilderModel

public IndexBuilderModel(java.lang.String fileDir)
Create an on-disk index

Method Detail

removedStatement

public void removedStatement(com.hp.hpl.jena.rdf.model.Statement s)
ModelListener interface : statement taken out of the model

Specified by:
removedStatement in interface com.hp.hpl.jena.rdf.model.ModelChangedListener
Overrides:
removedStatement in class com.hp.hpl.jena.rdf.listeners.StatementListener

unindexStatement

public void unindexStatement(com.hp.hpl.jena.rdf.model.Statement s)
Remove index information


addedStatement

public void addedStatement(com.hp.hpl.jena.rdf.model.Statement s)
ModelListener interface : statement added to the model

Specified by:
addedStatement in interface com.hp.hpl.jena.rdf.model.ModelChangedListener
Overrides:
addedStatement in class com.hp.hpl.jena.rdf.listeners.StatementListener

indexStatements

public void indexStatements(com.hp.hpl.jena.rdf.model.StmtIterator sIter)
Index all the statements from a StmtIterator


indexStatement

public abstract void indexStatement(com.hp.hpl.jena.rdf.model.Statement s)
Update index based on one statement


flushWriter

public void flushWriter()
Flush the index, optimizing it, to allow a reader to be created


closeWriter

public void closeWriter()
Close the index - no more updates possible


getIndex

public IndexLARQ getIndex()
Get a search index used by LARQ.



Copyright ? 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP Copyright ? 2010 Talis Systems Ltd. Copyright ? 2010, 2011 Epimorphics Ltd.