public class RDBMSDatabase extends Database
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_PREFIX |
static boolean |
OPTIMAL_COVER_DEFAULT |
static String |
OPTIMAL_COVER_KEY
Use optimal cover grounding.
|
cache, closed, parentDataStore, readIDs, readPartitions, writeID, writePartition
Constructor and Description |
---|
RDBMSDatabase(RDBMSDataStore parent,
Partition write,
Partition[] read,
Set<StandardPredicate> closed) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases the
Partitions used by this Database. |
void |
commit(Collection<RandomVariableAtom> atoms)
A batch form or commit().
|
void |
commit(Collection<RandomVariableAtom> atoms,
int partitionId)
A form of commit() that allows the caller to choose the specific partition
the atoms are comitted to.
|
int |
countAllGroundAtoms(StandardPredicate predicate,
List<Integer> partitions) |
boolean |
deleteAtom(GroundAtom atom)
Removes the GroundAtom from the Database, if it exists.
|
ResultList |
executeGroundingQuery(Formula formula)
Like executeQuery(), but specifically for grounding queries.
|
ResultList |
executeQuery(DatabaseQuery query)
Returns all groundings of a Formula that match a DatabaseQuery.
|
ResultList |
executeQuery(Map<Variable,Integer> projectionMap,
VariableTypeMap varTypes,
String queryString)
A more general form for executeQuery().
|
List<GroundAtom> |
getAllGroundAtoms(StandardPredicate predicate,
List<Integer> partitions) |
GroundAtom |
getAtom(Predicate predicate,
Constant... arguments)
Returns the GroundAtom for the given Predicate and GroundTerms.
|
GroundAtom |
getAtom(StandardPredicate predicate,
boolean create,
Constant... arguments) |
boolean |
isClosed(StandardPredicate predicate)
Returns whether a StandardPredicate is closed in this Database.
|
void |
moveToWritePartition(StandardPredicate predicate,
int oldPartitionId)
Move all ground atoms of a predicate/partition combination into
the write partition.
|
commit, countAllGroundAtoms, countAllGroundRandomVariableAtoms, getAllGroundAtoms, getAllGroundObservedAtoms, getAllGroundRandomVariableAtoms, getDataStore, getReadPartitions, getWritePartition, hasAtom
public static final String CONFIG_PREFIX
public static final String OPTIMAL_COVER_KEY
public static final boolean OPTIMAL_COVER_DEFAULT
public RDBMSDatabase(RDBMSDataStore parent, Partition write, Partition[] read, Set<StandardPredicate> closed)
public GroundAtom getAtom(Predicate predicate, Constant... arguments)
ReadableDatabase
StandardPredicate
can be retrieved if and only
if its Predicate was registered with the DataStore at the time of the Database's
instantiation. Any GroundAtom with an ExternalFunctionalPredicate} can also be retrieved.
This method first checks the AtomCache
to see if the GroundAtom already
exists in memory. If it does, then that object is returned.
If the GroundAtom does not exist in memory, then it will be instantiated and
stored in the AtomCache before being returned. The subtype and state of the
instantiated GroundAtom depends on several factors:
ObservedAtom
with the persisted state.RandomVariableAtom
if it is open.public boolean deleteAtom(GroundAtom atom)
WritableDatabase
public void commit(Collection<RandomVariableAtom> atoms)
WritableDatabase
public void commit(Collection<RandomVariableAtom> atoms, int partitionId)
WritableDatabase
public void moveToWritePartition(StandardPredicate predicate, int oldPartitionId)
WritableDatabase
public ResultList executeGroundingQuery(Formula formula)
ReadableDatabase
public ResultList executeQuery(DatabaseQuery query)
ReadableDatabase
public ResultList executeQuery(Map<Variable,Integer> projectionMap, VariableTypeMap varTypes, String queryString)
projectionMap
- a mapping of each variable we want returned to the
order it appears in the select statement.varTypes
- the types for each variable in the projection.queryString
- the SQL query.public boolean isClosed(StandardPredicate predicate)
ReadableDatabase
public void close()
WritableDatabase
Partitions
used by this Database.public GroundAtom getAtom(StandardPredicate predicate, boolean create, Constant... arguments)
public List<GroundAtom> getAllGroundAtoms(StandardPredicate predicate, List<Integer> partitions)
getAllGroundAtoms
in class Database
public int countAllGroundAtoms(StandardPredicate predicate, List<Integer> partitions)
countAllGroundAtoms
in class Database
Copyright © 2018 University of California, Santa Cruz. All rights reserved.