|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.openrdf.sesame.sailimpl.memory.RdfSource
An implementation of the RdfSource interface from the RDF Sail API that stores its data in main memory and that can use a file for persistent storage.
Caveat: Namespace prefix assignment is not guaranteed to be correct.
| Field Summary | |
static String |
COMPRESS_FILE_KEY
Key used to specify whether any data that is written to the file should be compressed. |
static String |
DATA_FORMAT_KEY
Key used to specify the format of the data in the file. |
static String |
FILE_KEY
Key used to specify a file for persistent storage. |
| Constructor Summary | |
RdfSource()
Creates a new RdfSource. |
|
| Method Summary | |
BNode |
createBNode()
Creates a new bNode. |
BNode |
createBNode(String nodeId)
creates a new bNode with the given node identifier. |
Literal |
createLiteral(String value)
Creates a new literal with the supplied value. |
Literal |
createLiteral(String value,
String language)
Creates a new literal with the supplied value and language attribute. |
Literal |
createLiteral(String value,
URI datatype)
Creates a new literal with the supplied value and datatype. |
Statement |
createStatement(Resource subject,
URI predicate,
Value object)
Creates a new statement with the supplied subject, predicate and object. |
URI |
createURI(String uri)
Creates a new URI from the supplied string-representation. |
URI |
createURI(String namespace,
String localName)
Creates a new URI that will get the supplied namespace and local name. |
NamespaceIterator |
getNamespaces()
Gets the prefix and name of all namespaces. |
StatementIterator |
getStatements(Resource subj,
URI pred,
Value obj)
Gets all statements with a specific subject, predicate and/or object. |
ValueFactory |
getValueFactory()
Gets a ValueFactory object that can be used to create URI-, blank node- and literal objects. |
boolean |
hasStatement(Resource subj,
URI pred,
Value obj)
Checks whether some statement with a specific subject, predicate and/or object is present in the repository. |
void |
initialize()
Initializes this repository. |
void |
initialize(File file,
RDFFormat dataFormat,
boolean compressFile)
Initializes this repository, using the specified file for persistent storage. |
void |
initialize(Map configParams)
Initializes this RdfSource. |
Query |
optimizeQuery(Query qc)
Gives the RdfSource the oportunity to optimize a Query to its specific storage model. |
void |
shutDown()
Allow the SAIL to synchronize any stale data. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String FILE_KEY
public static final String DATA_FORMAT_KEY
public static final String COMPRESS_FILE_KEY
| Constructor Detail |
public RdfSource()
| Method Detail |
public void initialize(Map configParams)
throws SailInitializationException
| key | value |
| file | The fully qualified name of the file that should be used for persistent data storage, e.g. c:\rdfdata\data.rdf. |
| dataFormat | The format of the data in the file. Legal values are "rdfxml", "ntriples" and "turtle". These are the values that are returned by the constants of class RDFFormat. |
| compressFile | Flag indicating whether the data that is written to the file (if any) should be compressed. Compressions can seriously reduce the size of the often verbose RDF data file. Compression is enabled when this parameter has the value "yes". |
| syncDelay | The time (in milliseconds) to wait after a transaction was commited before writing the changed data to file. Setting this variable to 0 will force a file sync immediately after each commit. A negative value will deactivate file synchronization until the Sail is shut down. A positive value will postpone the synchronization for at least that amount of milliseconds. If in the meantime a new transaction is started, the file synchronization will be rescheduled to wait for another syncDelay ms. This way, bursts of transaction events can be combined in one file sync, improving performance. |
initialize in interface SailconfigParams - The configuration parameters.
SailInitializationException - If this RdfRepository could not be
initialized using the supplied parameters.RDFFormat
public void initialize()
throws SailInitializationException
SailInitializationException
public void initialize(File file,
RDFFormat dataFormat,
boolean compressFile)
throws SailInitializationException
file - The file to use for persistent storage.dataFormat - The format of the data in the file. Legal values are
RDFFormat.RDFXML, RDFFormat.NTRIPLES and
RDFFormat.TURTLE.compressFile - Flag indicating whether the data in the file
is/should be compressed.
SailInternalException - If the initialization failed.
SailInitializationExceptionpublic void shutDown()
Sail
shutDown in interface Sailpublic ValueFactory getValueFactory()
RdfSource
getValueFactory in interface RdfSource
public StatementIterator getStatements(Resource subj,
URI pred,
Value obj)
RdfSource
getStatements in interface RdfSourcesubj - subject of patternpred - predicate of patternobj - object of pattern
public boolean hasStatement(Resource subj,
URI pred,
Value obj)
RdfSource
hasStatement in interface RdfSourcesubj - subject of statementpred - predicate of statementobj - object of statement
public Query optimizeQuery(Query qc)
RdfSource
optimizeQuery in interface RdfSourceqc - The Query to optimize.
public NamespaceIterator getNamespaces()
RdfSource
getNamespaces in interface RdfSourcepublic URI createURI(String uri)
ValueFactory
createURI in interface ValueFactoryuri - A string-representation of a URI.
public URI createURI(String namespace,
String localName)
ValueFactory
createURI in interface ValueFactorynamespace - A namespace.localName - A legal local name. A legal local name adheres to the
definition of an NCName as specified at
http://www.w3.org/TR/REC-xml-names/#NT-NCName.public BNode createBNode()
ValueFactory
createBNode in interface ValueFactorypublic BNode createBNode(String nodeId)
ValueFactory
createBNode in interface ValueFactorynodeId - the bnode identifier
public Literal createLiteral(String value)
ValueFactory
createLiteral in interface ValueFactoryvalue - The literal's value.
public Literal createLiteral(String value,
String language)
ValueFactory
createLiteral in interface ValueFactoryvalue - The literal's value.language - The literal's language attribute, or null if the
literal doesn't have a language.
public Literal createLiteral(String value,
URI datatype)
ValueFactory
createLiteral in interface ValueFactoryvalue - The literal's value.datatype - The literal's datatype, or null if the literal
doesn't have a datatype.
public Statement createStatement(Resource subject,
URI predicate,
Value object)
ValueFactory
createStatement in interface ValueFactorysubject - The statement's subject.predicate - The statement's predicate.object - The statement's object.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||