public class DataStore
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DataStore.StoreType
The different store types supported by RDFox.
|
static class |
DataStore.UpdateType |
| Modifier and Type | Field and Description |
|---|---|
protected Dictionary |
m_dictionary |
protected long |
m_storePtr |
| Constructor and Description |
|---|
DataStore(DataStore.StoreType dataStoreType) |
DataStore(DataStore.StoreType dataStoreType,
boolean nativeEqualityReasoning) |
DataStore(DataStore.StoreType dataStoreType,
boolean nativeEqualityReasoning,
boolean cacheResources,
boolean cacheGroundTerms) |
DataStore(java.io.File file) |
DataStore(java.io.File file,
boolean nativeEqualityResouning) |
DataStore(java.io.File file,
boolean nativeEqualityResouning,
boolean cacheResources,
boolean cacheGroundTerms) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTriples(GroundTerm[] triples)
Adds the specified triples to the store without performing reasoning.
|
void |
addTriples(GroundTerm[] triples,
DataStore.UpdateType updateType)
Adds the specified triples to the store without performing reasoning.
|
void |
addTriples(Resource[] triples)
Adds the specified triples to the store without performing reasoning.
|
void |
addTriples(Resource[] triples,
DataStore.UpdateType updateType)
Adds the specified triples to the store without performing reasoning.
|
void |
addTriplesByResourceIDs(int[] triples)
Adds the specified triples to the store without performing reasoning.
|
void |
addTriplesByResourceIDs(int[] triples,
DataStore.UpdateType updateType)
Adds the specified triples to the store without performing reasoning.
|
void |
applyReasoning()
Performs reasoning with the rules and data currently loaded into the store.
|
void |
applyReasoning(boolean incrementally)
Performs reasoning with the rules and data currently loaded into the store.
|
void |
clearRulesAndMakeFactsExplicit()
Removes all rules and makes the current facts EDBs.
|
TupleIterator |
compileQuery(java.lang.String query)
Compiles a query.
|
TupleIterator |
compileQuery(java.lang.String query,
Prefixes prefixes)
Compiles a query.
|
TupleIterator |
compileQuery(java.lang.String query,
Prefixes prefixes,
Parameters parameters)
Compiles a query.
|
TupleIterator |
compileQuery(java.lang.String query,
Prefixes prefixes,
Parameters parameters,
TripleStatus tripleStatusMask,
TripleStatus expectedValue)
Compiles a query.
|
void |
dispose()
Disposes the store.
|
protected void |
ensureValidState() |
void |
finalize() |
Dictionary |
getDictionary()
Retrieves the dictionary object for the current store
|
long |
getTriplesCount() |
void |
importOntology(org.semanticweb.owlapi.model.OWLOntology rootOntology)
Imports the triples and the datalog fragment of the ontology into the store.
|
void |
importOntology(org.semanticweb.owlapi.model.OWLOntology rootOntology,
DataStore.UpdateType updateType)
Imports the triples and the datalog fragment of the ontology into the store.
|
void |
importOntology(org.semanticweb.owlapi.model.OWLOntology rootOntology,
DataStore.UpdateType updateType,
boolean useTreeDecomposition)
Imports the triples and the datalog fragment of the ontology into the store.
|
protected void |
importOntology(org.semanticweb.owlapi.model.OWLOntology rootOntology,
DataStore.UpdateType updateType,
boolean addRules,
boolean addTriples,
boolean useTreeDecomposition)
Imports the triples and the datalog fragment of the ontology into the store.
|
void |
importRules(java.io.File[] files)
Imports rules from the specified files.
|
void |
importRules(java.io.File[] files,
DataStore.UpdateType updateType)
Imports rules from the specified files.
|
void |
importRules(java.io.File[] files,
DataStore.UpdateType updateType,
boolean useTreeDecomposition)
Imports rules from the specified files.
|
void |
importRules(org.semanticweb.owlapi.model.OWLOntology rootOntology)
Imports the datalog fragment of the ontology into the store.
|
void |
importRules(org.semanticweb.owlapi.model.OWLOntology rootOntology,
DataStore.UpdateType updateType)
Imports the datalog fragment of the ontology into the store.
|
void |
importRules(org.semanticweb.owlapi.model.OWLOntology rootOntology,
DataStore.UpdateType updateType,
boolean useTreeDecomposition)
Imports the datalog fragment of the ontology into the store.
|
void |
importRules(java.lang.String rules)
Imports the datalog rules into the store.
|
void |
importRules(java.lang.String rules,
DataStore.UpdateType updateType)
Imports the datalog rules into the store.
|
void |
importRules(java.lang.String rules,
DataStore.UpdateType updateType,
boolean useTreeDecomposition,
Prefixes prefixes)
Imports the datalog rules into the store.
|
void |
importRules(java.lang.String rules,
DataStore.UpdateType updateType,
Prefixes prefixes)
Imports the datalog rules into the store.
|
void |
importTriples(org.semanticweb.owlapi.model.OWLOntology rootOntology)
Imports the triples from the ontology into the store.
|
void |
importTriples(org.semanticweb.owlapi.model.OWLOntology rootOntology,
DataStore.UpdateType updateType)
Imports the triples from the ontology into the store.
|
void |
importTurtleFile(java.io.File file)
Imports the turtle file.
|
void |
importTurtleFile(java.io.File file,
Prefixes prefixes)
Imports the turtle file.
|
void |
importTurtleFile(java.io.File file,
Prefixes prefixes,
DataStore.UpdateType updateType)
Imports the turtle file.
|
void |
importTurtleFiles(java.io.File[] files)
Imports the turtle files.
|
void |
importTurtleFiles(java.io.File[] files,
DataStore.UpdateType updateType)
Imports the turtle files.
|
void |
initialize()
Initializes an empty store.
|
protected static boolean |
loadRDFoxFromJar(java.lang.String path) |
void |
makeFactsExplicit()
Makes all facts explicit.
|
protected void |
nAddRules(long dataStorePtr,
java.lang.String[] programTexts,
int updateType,
boolean useTreeDecomposition,
java.lang.String[] prefixes) |
protected void |
nAddTriples(long dataStorePtr,
java.lang.String[] lexicalForms,
int[] datatypeIDs,
int updateType) |
protected void |
nAddTriplesByResourceIDs(long dataStorePtr,
int[] resourceIDs,
int updateType) |
protected void |
nApplyRules(long dataStorePtr,
boolean incrementally) |
protected void |
nClearRulesAndMakeFactsExplicit(long dataStorePtr) |
protected void |
nCreate(java.lang.String dataStoreType,
boolean optimizeEquality,
long[] pointers) |
protected void |
nDispose(long dataStorePtr) |
protected long |
nGetTriplesCount(long dataStorePtr) |
protected void |
nImportRules(long dataStorePtr,
java.lang.String[] programFiles,
int rulesAction,
boolean useTreeDecomposition) |
protected void |
nImportTurtleFile(long dataStorePtr,
java.lang.String fileName,
int updateType) |
protected void |
nImportTurtleFiles(long dataStorePtr,
java.lang.String[] fileNames,
int updateType) |
protected void |
nInitialize(long dataStorePtr) |
protected void |
nLoad(java.lang.String fileName,
long[] pointers) |
protected void |
nMakeFactsExplicit(long dataStorePtr) |
protected void |
nSave(long datastorePtr,
java.lang.String fileName) |
protected void |
nSetNumberOfThreads(long dataStorePtr,
int numberOfThreads) |
void |
save(java.io.File file)
Saves the current store into a file.
|
void |
setNumberOfThreads(int numberOfThreads)
Sets the number of threads used during reasoning and parallel import of data,
|
protected void |
writeTerm(GroundTerm term,
int index,
java.lang.String[] lexicalForms,
int[] datatypeIDs) |
protected long m_storePtr
protected Dictionary m_dictionary
public DataStore(DataStore.StoreType dataStoreType) throws JRDFStoreException
JRDFStoreExceptionpublic DataStore(DataStore.StoreType dataStoreType, boolean nativeEqualityReasoning) throws JRDFStoreException
JRDFStoreExceptionpublic DataStore(DataStore.StoreType dataStoreType, boolean nativeEqualityReasoning, boolean cacheResources, boolean cacheGroundTerms) throws JRDFStoreException
JRDFStoreExceptionpublic DataStore(java.io.File file)
throws JRDFStoreException
JRDFStoreExceptionpublic DataStore(java.io.File file,
boolean nativeEqualityResouning)
throws JRDFStoreException
JRDFStoreExceptionpublic DataStore(java.io.File file,
boolean nativeEqualityResouning,
boolean cacheResources,
boolean cacheGroundTerms)
throws JRDFStoreException
JRDFStoreExceptionprotected static boolean loadRDFoxFromJar(java.lang.String path)
protected void nCreate(java.lang.String dataStoreType,
boolean optimizeEquality,
long[] pointers)
throws JRDFStoreException
JRDFStoreExceptionprotected void nInitialize(long dataStorePtr)
throws JRDFStoreException
JRDFStoreExceptionprotected long nGetTriplesCount(long dataStorePtr)
throws JRDFStoreException
JRDFStoreExceptionprotected void nSetNumberOfThreads(long dataStorePtr,
int numberOfThreads)
throws JRDFStoreException
JRDFStoreExceptionprotected void nAddTriples(long dataStorePtr,
java.lang.String[] lexicalForms,
int[] datatypeIDs,
int updateType)
throws JRDFStoreException
JRDFStoreExceptionprotected void nAddTriplesByResourceIDs(long dataStorePtr,
int[] resourceIDs,
int updateType)
throws JRDFStoreException
JRDFStoreExceptionprotected void nImportTurtleFile(long dataStorePtr,
java.lang.String fileName,
int updateType)
throws JRDFStoreException
JRDFStoreExceptionprotected void nImportTurtleFiles(long dataStorePtr,
java.lang.String[] fileNames,
int updateType)
throws JRDFStoreException
JRDFStoreExceptionprotected void nAddRules(long dataStorePtr,
java.lang.String[] programTexts,
int updateType,
boolean useTreeDecomposition,
java.lang.String[] prefixes)
throws JRDFStoreException
JRDFStoreExceptionprotected void nImportRules(long dataStorePtr,
java.lang.String[] programFiles,
int rulesAction,
boolean useTreeDecomposition)
throws JRDFStoreException
JRDFStoreExceptionprotected void nApplyRules(long dataStorePtr,
boolean incrementally)
throws JRDFStoreException
JRDFStoreExceptionprotected void nMakeFactsExplicit(long dataStorePtr)
throws JRDFStoreException
JRDFStoreExceptionprotected void nClearRulesAndMakeFactsExplicit(long dataStorePtr)
throws JRDFStoreException
JRDFStoreExceptionprotected void nSave(long datastorePtr,
java.lang.String fileName)
throws JRDFStoreException
JRDFStoreExceptionprotected void nLoad(java.lang.String fileName,
long[] pointers)
throws JRDFStoreException
JRDFStoreExceptionprotected void nDispose(long dataStorePtr)
protected void ensureValidState()
throws JRDFStoreException
JRDFStoreExceptionpublic void initialize()
throws JRDFStoreException
JRDFStoreException - thrown if there is an errorpublic long getTriplesCount()
throws JRDFStoreException
JRDFStoreException - thrown if there is an errorpublic void setNumberOfThreads(int numberOfThreads)
throws JRDFStoreException
numberOfThreads - the new number of threads to useJRDFStoreException - thrown if there is an errorpublic void addTriples(Resource[] triples) throws JRDFStoreException
triples - the triples to be added to the storeJRDFStoreException - thrown if there is an errorpublic void addTriples(Resource[] triples, DataStore.UpdateType updateType) throws JRDFStoreException
triples - the triples to be added to the storeupdateType - determines what action should be performed on the triplesJRDFStoreException - thrown if there is an errorpublic void addTriples(GroundTerm[] triples) throws JRDFStoreException
triples - the triples to be added to the storeJRDFStoreException - thrown if there is an errorpublic void addTriples(GroundTerm[] triples, DataStore.UpdateType updateType) throws JRDFStoreException
triples - the triples to be added to the storeupdateType - determines what action should be performed on the triplesJRDFStoreException - thrown if there is an errorpublic void addTriplesByResourceIDs(int[] triples)
throws JRDFStoreException
triples - the triples to be added to the storeJRDFStoreException - thrown if there is an errorpublic void addTriplesByResourceIDs(int[] triples,
DataStore.UpdateType updateType)
throws JRDFStoreException
triples - the triples to be added to the storeupdateType - determines what action should be performed on the triplesJRDFStoreException - thrown if there is an errorprotected void writeTerm(GroundTerm term, int index, java.lang.String[] lexicalForms, int[] datatypeIDs) throws JRDFStoreException
JRDFStoreExceptionpublic void importTurtleFile(java.io.File file,
Prefixes prefixes,
DataStore.UpdateType updateType)
throws JRDFStoreException
file - the file to be importedprefixes - the prefixes to be populatedupdateType - determines what action should be performed on the triplesJRDFStoreException - thrown if there is an errorpublic void importTurtleFile(java.io.File file,
Prefixes prefixes)
throws JRDFStoreException
file - the file to be importedprefixes - the prefixes to be populatedJRDFStoreException - thrown if there is an errorpublic void importTurtleFile(java.io.File file)
throws JRDFStoreException
file - the file to be importedJRDFStoreException - thrown if there is an errorpublic void importTurtleFiles(java.io.File[] files,
DataStore.UpdateType updateType)
throws JRDFStoreException
files - the files to be importedupdateType - determines what action should be performed on the triplesJRDFStoreException - thrown if there is an errorpublic void importTurtleFiles(java.io.File[] files)
throws JRDFStoreException
files - the files to be importedJRDFStoreException - thrown if there is an errorpublic void importRules(java.lang.String rules)
throws JRDFStoreException
rules - the character encoding of the rules to be added to the storeJRDFStoreException - thrown if there is an errorpublic void importRules(java.lang.String rules,
DataStore.UpdateType updateType)
throws JRDFStoreException
rules - the character encoding of the rules to be added to the storeupdateType - determines what action should be performed on the triplesJRDFStoreException - thrown if there is an errorpublic void importRules(java.lang.String rules,
DataStore.UpdateType updateType,
Prefixes prefixes)
throws JRDFStoreException
rules - the character encoding of the rules to be added to the storeupdateType - determines what action should be performed on the triplesprefixes - the prefixes used in the programsJRDFStoreException - thrown if there is an errorpublic void importRules(java.lang.String rules,
DataStore.UpdateType updateType,
boolean useTreeDecomposition,
Prefixes prefixes)
throws JRDFStoreException
rules - the character encoding of the the rules to be added to the storeupdateType - determines what action should be performed on the triplesuseTreeDecomposition - determines whether to optimize the rules using tree decompositionprefixes - the prefixes used in the programsJRDFStoreException - thrown if there is an errorpublic void importRules(org.semanticweb.owlapi.model.OWLOntology rootOntology)
throws JRDFStoreException
rootOntology - the ontology to be transformedJRDFStoreException - thrown if there is an errorpublic void importRules(org.semanticweb.owlapi.model.OWLOntology rootOntology,
DataStore.UpdateType updateType)
throws JRDFStoreException
rootOntology - the ontology to be transformedupdateType - determines what action should be performed on the triplesJRDFStoreException - thrown if there is an errorpublic void importRules(org.semanticweb.owlapi.model.OWLOntology rootOntology,
DataStore.UpdateType updateType,
boolean useTreeDecomposition)
throws JRDFStoreException
rootOntology - the ontology to be transformedupdateType - determines what action should be performed on the triplesuseTreeDecomposition - determines whether to optimize the rules using tree decompositionJRDFStoreException - thrown if there is an errorpublic void importTriples(org.semanticweb.owlapi.model.OWLOntology rootOntology)
throws JRDFStoreException
rootOntology - the ontology to be transformedJRDFStoreException - thrown if there is an errorpublic void importTriples(org.semanticweb.owlapi.model.OWLOntology rootOntology,
DataStore.UpdateType updateType)
throws JRDFStoreException
rootOntology - the ontology to be transformedupdateType - determines what action should be performed on the triplesJRDFStoreException - thrown if there is an errorpublic void importOntology(org.semanticweb.owlapi.model.OWLOntology rootOntology)
throws JRDFStoreException
rootOntology - the ontology to be transformedJRDFStoreException - thrown if there is an errorpublic void importOntology(org.semanticweb.owlapi.model.OWLOntology rootOntology,
DataStore.UpdateType updateType)
throws JRDFStoreException
rootOntology - the ontology to be transformedupdateType - determines what action should be performed on the triplesJRDFStoreException - thrown if there is an errorpublic void importOntology(org.semanticweb.owlapi.model.OWLOntology rootOntology,
DataStore.UpdateType updateType,
boolean useTreeDecomposition)
throws JRDFStoreException
rootOntology - the ontology to be transformedupdateType - determines what action should be performed on the triplesuseTreeDecomposition - determines whether to optimize the rules using tree decompositionJRDFStoreException - thrown if there is an errorprotected void importOntology(org.semanticweb.owlapi.model.OWLOntology rootOntology,
DataStore.UpdateType updateType,
boolean addRules,
boolean addTriples,
boolean useTreeDecomposition)
throws JRDFStoreException
rootOntology - the ontology to be transformedupdateType - determines what action should be performed on the triplesaddRules - specifies whether the ontology should be converted to rulesaddTriples - specifies whether assertions should be extracted from the ontologyuseTreeDecomposition - determines whether to optimize the rules using tree decompositionJRDFStoreException - thrown if there is an errorpublic void importRules(java.io.File[] files)
throws JRDFStoreException
files - the files to be importedJRDFStoreException - thrown if there is an errorpublic void importRules(java.io.File[] files,
DataStore.UpdateType updateType)
throws JRDFStoreException
files - the files to be importedupdateType - determines what action should be performed on the triplesJRDFStoreException - thrown if there is an errorpublic void importRules(java.io.File[] files,
DataStore.UpdateType updateType,
boolean useTreeDecomposition)
throws JRDFStoreException
files - the files to be importedupdateType - determines what action should be performed on the triplesuseTreeDecomposition - determines whether to optimize the rules using tree decompositionJRDFStoreException - thrown if there is an errorpublic void applyReasoning(boolean incrementally)
throws JRDFStoreException
incrementally - determines whether to reason incrementallyJRDFStoreException - thrown if there is an errorpublic void applyReasoning()
throws JRDFStoreException
JRDFStoreException - thrown if there is an errorpublic void makeFactsExplicit()
throws JRDFStoreException
JRDFStoreException - thrown if there is an errorpublic void clearRulesAndMakeFactsExplicit()
throws JRDFStoreException
JRDFStoreException - thrown if there is an errorpublic void save(java.io.File file)
throws JRDFStoreException
file - the file where the store is saved.JRDFStoreException - thrown if there is an errorpublic TupleIterator compileQuery(java.lang.String query, Prefixes prefixes, Parameters parameters, TripleStatus tripleStatusMask, TripleStatus expectedValue) throws JRDFStoreException
query - the queryprefixes - the prefixes used in the queryparameters - the parameters used during query compilationtripleStatusMask - the triple statuses to be checkedexpectedValue - the triple statuses to be presentJRDFStoreException - thrown if there is an errorpublic TupleIterator compileQuery(java.lang.String query, Prefixes prefixes, Parameters parameters) throws JRDFStoreException
query - the queryprefixes - the prefixes used in the queryparameters - the parameters used during query compilationJRDFStoreException - thrown if there is an errorpublic TupleIterator compileQuery(java.lang.String query, Prefixes prefixes) throws JRDFStoreException
query - the queryprefixes - the prefixes used in the queryJRDFStoreException - thrown if there is an errorpublic TupleIterator compileQuery(java.lang.String query) throws JRDFStoreException
query - the queryJRDFStoreException - thrown if there is an errorpublic Dictionary getDictionary() throws JRDFStoreException
JRDFStoreException - thrown if the store has been disposedpublic void dispose()
public void finalize()
finalize in class java.lang.Object