| java.lang.Object com.hp.hpl.jena.graph.impl.GraphBase com.hp.hpl.jena.db.GraphRDB
GraphRDB | public class GraphRDB extends GraphBase implements Graph(Code) | | A persistent Graph implementation using a relational database for storage.
This graph stores data persistently in a relational database.
It supports the full Graph interface and should operate just like
a GraphMem.
Internally, each GraphRDB keeps a list of specialized graphs.
For each operation, it works through the list of graphs
attempting to perform the operation on each one.
The intention is that each type of specialized graph is
optimized for a different type of triple. For example, one
type of specialied graph might be optimized for storing
triples in a particular ontology. The last specialized
graph in the list is always a generic one that can handle any
valid RDF triple.
The order of the specialized graphs is consistent and
immutable after the graph is constructed. This aids
optimization. For example, if a specialized graph
is asked to perform an operatin on a triple, and it knows
that it would have added it if asked, then it can advise the
calling GraphRDB that the operaton is complete even though
it doesn't know anything about other specialized graphs later
in the list.
since: Jena 2.0 author: csayers (based in part on GraphMem by bwm). version: $Revision: 1.49 $ |
Constructor Summary | |
public | GraphRDB(IDBConnection con, String graphID, Graph requestedProperties, boolean isNew) Construct a new GraphRDB using an unusual reification style.
Parameters: con - an open connection to the database Parameters: graphID - is the name of a graph or GraphRDB.DEFAULT Parameters: requestedProperties - a set of default properties. | public | GraphRDB(IDBConnection con, String graphID, Graph requestedProperties, int reificationBehaviour, boolean isNew) Construct a new GraphRDB
Parameters: con - an open connection to the database Parameters: graphID - is the name of a graph or GraphRDB.DEFAULT Parameters: requestedProperties - a set of default properties. |
DEFAULT | final public static String DEFAULT(Code) | | The name used for the default graph.
|
OPTIMIZE_ALL_REIFICATIONS_AND_HIDE_NOTHING | final public static int OPTIMIZE_ALL_REIFICATIONS_AND_HIDE_NOTHING(Code) | | Optimize all triples representing part or all of a reified statement;
this is the recommended option.
This is the best choice in almost every case. It optimizes
all reified triples regardless of how they are added to the graph,
provides a simple interface, and is quite efficient.
With this choice, if you do add(A) then
contains(A) will return true for all A.
|
OPTIMIZE_AND_HIDE_FULL_AND_PARTIAL_REIFICATIONS | final public static int OPTIMIZE_AND_HIDE_FULL_AND_PARTIAL_REIFICATIONS(Code) | | Optimize and hide any triples representing part or all of a reified statement.
This optimizes all triples but hides them so they are visible only via the reifier interface.
There is no significant performance advantage in using this option and it is not recommended.
It is included only for compatability with in-memory graphs.
Note that it will also cause unexpected behaviour, for example, if you do:
add(new Triple( s, RDF.predicate, o))
then that triple will be hidden and a subsequent call to contains ,
find , or size will not show it's presence. The only
way to see that statement is to use Reifier.getHiddenTriples .
|
OPTIMIZE_AND_HIDE_ONLY_FULL_REIFICATIONS | final public static int OPTIMIZE_AND_HIDE_ONLY_FULL_REIFICATIONS(Code) | | Optimize and hide only fully reified statements added via the Reifier interface, use only for backward-compatability with Jena1.
This treats triples added through the Reifier interface as distinct from those
added using the normal Graph.add function. Those added via the reifier interface
will be optimized and hidden from view. Those added via Graph.add will not
be optimized and will be visible.
Since many of the techniques for adding triple to Graphs use Graph.add, and
that is never optimized, this is not usually a good choice. It is included
only for backward compability with Jena 1. There is no performance advantage
in using this option.
|
m_reificationBehaviour | protected int m_reificationBehaviour(Code) | | |
m_specializedGraphAsserted | protected List m_specializedGraphAsserted(Code) | | |
m_specializedGraphReifiers | protected List m_specializedGraphReifiers(Code) | | |
m_specializedGraphs | protected List m_specializedGraphs(Code) | | |
m_specializedGraphsAll | protected List m_specializedGraphsAll(Code) | | |
GraphRDB | public GraphRDB(IDBConnection con, String graphID, Graph requestedProperties, boolean isNew)(Code) | | Construct a new GraphRDB using an unusual reification style.
Parameters: con - an open connection to the database Parameters: graphID - is the name of a graph or GraphRDB.DEFAULT Parameters: requestedProperties - a set of default properties. (May be null, if non-null should be a superset of the properties obtained by calling ModelRDB.getDefaultModelProperties ). Parameters: isNew - is true if the graph doesn't already exist and false otherwise. (If unsure, test for existance by using IDBConnection.containsGraph ). |
GraphRDB | public GraphRDB(IDBConnection con, String graphID, Graph requestedProperties, int reificationBehaviour, boolean isNew)(Code) | | Construct a new GraphRDB
Parameters: con - an open connection to the database Parameters: graphID - is the name of a graph or GraphRDB.DEFAULT Parameters: requestedProperties - a set of default properties. (May be null, if non-null should be a superset of the properties obtained by calling ModelRDB.getDefaultModelProperties ). Parameters: reificationBehaviour - specifies how this graph should handle reified triples.The options are OPTIMIZE_ALL_REIFICATIONS_AND_HIDE_NOTHING (strongly recommended), OPTIMIZE_AND_HIDE_FULL_AND_PARTIAL_REIFICATIONS (included only for full compatability with all the options for in-memory Graphs), OPTIMIZE_AND_HIDE_ONLY_FULL_REIFICATIONS (included only for compatability with older jena1-style usage). Parameters: isNew - is true if the graph doesn't already exist and false otherwise. (If unsure, test for existance by usingIDBConnection.containsGraph ). |
add | public void add(List triples)(Code) | | Add a list of triples.
Parameters: triples - List to be added. This is unchanged by the call |
checkOpen | protected void checkOpen()(Code) | | |
clear | public synchronized void clear()(Code) | | Remove all statements from this graph.
|
close | public synchronized void close()(Code) | | |
delete | public void delete(List triples)(Code) | | Delete a list of triples.
Parameters: triples - List to be deleted. This is unchanged by the call. |
getConnection | public IDBConnection getConnection()(Code) | | Return the connection
IDBConnection for the database on which this graph is stored. Returns null if the connection has not yet been estabilished. |
getDoDuplicateCheck | public boolean getDoDuplicateCheck()(Code) | | Get the value of DoDuplicateCheck
bool boolean |
getDoFastpath | public boolean getDoFastpath()(Code) | | Get the value of DoFastpath.
boolean |
getNode | public Node getNode()(Code) | | Returns the Node for this model in the system properties graph.
The properties of each GraphRDB (things like how it is stored in
the database) are themelves stored in a system Graph. This function
returns the Node which represents this GraphRDB in the system Graph.
since: Jena 2.0 |
getPropertyTriples | public ExtendedIterator getPropertyTriples()(Code) | | Returns triples that describe this graph in the system properties graph.
The properties of each GraphRDB (things like how it is stored in
the database) are stored as triples in a system Graph. This function
returns those triples.
since: Jena 2.0 |
getQueryFullReified | public boolean getQueryFullReified()(Code) | | Get the value of QueryFullReified.
boolean |
getQueryOnlyAsserted | public boolean getQueryOnlyAsserted()(Code) | | Get the value of QueryOnlyAsserted.
boolean |
getQueryOnlyReified | public boolean getQueryOnlyReified()(Code) | | Get the value of QueryOnlyReified.
boolean |
getSpecializedGraphs | public Iterator getSpecializedGraphs()(Code) | | Return an iterator over the specialized graphs for this graph
Iterator over the list of specialized graphs. |
graphBaseContains | public boolean graphBaseContains(Triple t)(Code) | | |
graphBaseSize | public int graphBaseSize()(Code) | | |
isClosed | public boolean isClosed()(Code) | | |
isOpen | protected boolean isOpen()(Code) | | |
reificationBehavior | public int reificationBehavior()(Code) | | Return the reification behavior (GraphRDB) for this graph
integer that defines the reification behavior for this graphRDB. |
reifierSize | public int reifierSize()(Code) | | |
remove | public synchronized void remove()(Code) | | Remove this Graph entirely from the database.
This operation is unique to GraphRDB - it removes all
mention of this graph from the database - after removing
a graph it is recommended to immediately call close()
(there is no other useful operation that may be
performed, and so no reason to keep the Graph around).
|
setDoDuplicateCheck | public void setDoDuplicateCheck(boolean bool)(Code) | | Set the value of DoDuplicateCheck.
Parameters: bool - boolean |
setDoFastpath | public void setDoFastpath(boolean val)(Code) | | Set the value of DoFastpath.
Parameters: val - boolean |
setDoImplicitJoin | public void setDoImplicitJoin(boolean val)(Code) | | Set the value of DoImplicitJoin.
Parameters: val - boolean |
setQueryFullReified | public void setQueryFullReified(boolean opt)(Code) | | Set the value of QueryFullReified.
Parameters: opt - boolean |
setQueryOnlyAsserted | public void setQueryOnlyAsserted(boolean opt)(Code) | | Set the value of QueryOnlyAsserted.
Parameters: opt - boolean |
setQueryOnlyReified | public void setQueryOnlyReified(boolean opt)(Code) | | Set the value of QueryOnlyReified.
Parameters: opt - boolean |
styleRDB | public static int styleRDB(ReificationStyle style)(Code) | | Answer the integer representing the RDB reifier style given the Reifier style.
|
styleRDB | public static ReificationStyle styleRDB(int behaviour)(Code) | | Answer the reification style corresponding to the DB behaviour integer.
|
|
|