com.bigdata.rdf.rio
Class BasicRioLoader

java.lang.Object
  extended by com.bigdata.rdf.rio.BasicRioLoader
All Implemented Interfaces:
IRioLoader
Direct Known Subclasses:
PresortRioLoader

public class BasicRioLoader
extends Object
implements IRioLoader

Parses data but does not load it into the indices.

Version:
$Id: BasicRioLoader.java 6045 2012-02-27 17:33:44Z thompsonbry $
Author:
Bryan Thompson

Field Summary
protected  String defaultGraph
           
protected static org.apache.log4j.Logger log
          Note: This logger was historically associated with the IRioLoader interface and it is still named for that interface.
 long stmtsAdded
           
 
Constructor Summary
BasicRioLoader(ValueFactory valueFactory)
           
 
Method Summary
 void addRioLoaderListener(RioLoaderListener l)
          Register a listener.
protected  void before()
          Invoked before parse (default is NOP).
protected  void cleanUp()
          Invoked from finally clause after parse regardless of success or failure.
protected  void error(Exception ex)
          Invoked if the parse fails (default is NOP).
 long getInsertRate()
           
 long getInsertTime()
           
protected  RDFParser getParser(RDFFormat rdfFormat)
          Choose the parser based on the RDFFormat specified to the constructor.
 long getStatementsAdded()
           
 void loadRdf(InputStream is, String baseURI, RDFFormat rdfFormat, String defaultGraph, RDFParserOptions options)
          Parse RDF data.
 void loadRdf(Reader reader, String baseURI, RDFFormat rdfFormat, String defaultGraph, RDFParserOptions options)
          Parse RDF data.
protected  void loadRdf2(Object source, String baseURI, RDFFormat rdfFormat, String defaultGraph, RDFParserOptions options)
          Core implementation.
 RDFHandler newRDFHandler()
          Note: YOU MUST override this method to install a different RDFHandler.
protected  void notifyListeners()
           
 void removeRioLoaderListener(RioLoaderListener l)
          Remove a listener.
protected  void success()
          Invoked after successful parse (default is NOP).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final transient org.apache.log4j.Logger log
Note: This logger was historically associated with the IRioLoader interface and it is still named for that interface.


stmtsAdded

public long stmtsAdded

defaultGraph

protected String defaultGraph
Constructor Detail

BasicRioLoader

public BasicRioLoader(ValueFactory valueFactory)
Method Detail

getStatementsAdded

public final long getStatementsAdded()
Specified by:
getStatementsAdded in interface IRioLoader

getInsertTime

public final long getInsertTime()
Specified by:
getInsertTime in interface IRioLoader

getInsertRate

public final long getInsertRate()
Specified by:
getInsertRate in interface IRioLoader

addRioLoaderListener

public final void addRioLoaderListener(RioLoaderListener l)
Description copied from interface: IRioLoader
Register a listener.

Specified by:
addRioLoaderListener in interface IRioLoader
Parameters:
l - The listener.

removeRioLoaderListener

public final void removeRioLoaderListener(RioLoaderListener l)
Description copied from interface: IRioLoader
Remove a listener.

Specified by:
removeRioLoaderListener in interface IRioLoader
Parameters:
l - The listener.

notifyListeners

protected final void notifyListeners()

getParser

protected final RDFParser getParser(RDFFormat rdfFormat)
Choose the parser based on the RDFFormat specified to the constructor.

Returns:
The parser.

loadRdf

public final void loadRdf(InputStream is,
                          String baseURI,
                          RDFFormat rdfFormat,
                          String defaultGraph,
                          RDFParserOptions options)
                   throws Exception
Description copied from interface: IRioLoader
Parse RDF data.

Specified by:
loadRdf in interface IRioLoader
Parameters:
is - The source from which the data will be read.
rdfFormat - The interchange format.
defaultGraph - The default graph.
options - Options to be applied to the RDFParser.
Throws:
Exception

loadRdf

public final void loadRdf(Reader reader,
                          String baseURI,
                          RDFFormat rdfFormat,
                          String defaultGraph,
                          RDFParserOptions options)
                   throws Exception
Description copied from interface: IRioLoader
Parse RDF data.

Specified by:
loadRdf in interface IRioLoader
Parameters:
reader - The source from which the data will be read.
baseURI - The base URL for those data.
rdfFormat - The interchange format.
defaultGraph - The default graph.
options - Options to be applied to the RDFParser.
Throws:
Exception

loadRdf2

protected void loadRdf2(Object source,
                        String baseURI,
                        RDFFormat rdfFormat,
                        String defaultGraph,
                        RDFParserOptions options)
                 throws Exception
Core implementation.

Parameters:
source - A Reader or InputStream.
baseURI -
rdfFormat -
options -
Throws:
Exception

before

protected void before()
Invoked before parse (default is NOP).


success

protected void success()
Invoked after successful parse (default is NOP).


error

protected void error(Exception ex)
Invoked if the parse fails (default is NOP).


cleanUp

protected void cleanUp()
Invoked from finally clause after parse regardless of success or failure.


newRDFHandler

public RDFHandler newRDFHandler()
Note: YOU MUST override this method to install a different RDFHandler. The default is the BasicRDFHandler which does NOTHING.



Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.