Java Doc for GraphRDB.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » db » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.db 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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 $


Field Summary
final public static  StringDEFAULT
     The name used for the default graph.
final public static  intOPTIMIZE_ALL_REIFICATIONS_AND_HIDE_NOTHING
     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.

final public static  intOPTIMIZE_AND_HIDE_FULL_AND_PARTIAL_REIFICATIONS
     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.

final public static  intOPTIMIZE_AND_HIDE_ONLY_FULL_REIFICATIONS
     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.

protected  IRDBDriverm_driver
    
protected  DBPrefixMappingImplm_prefixMapping
    
protected  DBPropGraphm_properties
    
protected  intm_reificationBehaviour
    
protected  Reifierm_reifier
    
protected  Listm_specializedGraphAsserted
    
protected  Listm_specializedGraphReifiers
    
protected  Listm_specializedGraphs
    
protected  Listm_specializedGraphsAll
    

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.

Method Summary
public  DBQueryHandlerDBqueryHandler()
    
public  voidadd(List triples)
     Add a list of triples.
Parameters:
  triples - List to be added.
protected  voidcheckOpen()
    
public synchronized  voidclear()
     Remove all statements from this graph.
public synchronized  voidclose()
    
public  voiddelete(List triples)
     Delete a list of triples.
Parameters:
  triples - List to be deleted.
public  BulkUpdateHandlergetBulkUpdateHandler()
    
public  CapabilitiesgetCapabilities()
     Database graphs do not presently support the equivalence of plain string literals and xsd:string literals (and other typed literals in general).
public  IDBConnectiongetConnection()
     Return the connection IDBConnection for the database on which this graph is stored.
public  booleangetDoDuplicateCheck()
    
public  booleangetDoFastpath()
     Get the value of DoFastpath.
public  NodegetNode()
     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.
public  PrefixMappinggetPrefixMapping()
    
public  ExtendedIteratorgetPropertyTriples()
     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.
public  booleangetQueryFullReified()
     Get the value of QueryFullReified.
public  booleangetQueryOnlyAsserted()
     Get the value of QueryOnlyAsserted.
public  booleangetQueryOnlyReified()
     Get the value of QueryOnlyReified.
public  ReifiergetReifier()
    
public  IteratorgetSpecializedGraphs()
    
public  TransactionHandlergetTransactionHandler()
    
public  booleangraphBaseContains(Triple t)
    
public  ExtendedIteratorgraphBaseFind(TripleMatch m)
    
public  intgraphBaseSize()
    
public  booleanisClosed()
    
protected  booleanisOpen()
    
public  voidperformAdd(Triple t)
    
public  voidperformDelete(Triple t)
    
public  QueryHandlerqueryHandler()
    
public  intreificationBehavior()
    
public  intreifierSize()
    
public  ExtendedIteratorreifierTriples(TripleMatch m)
    
public synchronized  voidremove()
     Remove this Graph entirely from the database.
public  voidsetDoDuplicateCheck(boolean bool)
     Set the value of DoDuplicateCheck.
public  voidsetDoFastpath(boolean val)
     Set the value of DoFastpath.
public  voidsetDoImplicitJoin(boolean val)
     Set the value of DoImplicitJoin.
public  voidsetQueryFullReified(boolean opt)
     Set the value of QueryFullReified.
public  voidsetQueryOnlyAsserted(boolean opt)
     Set the value of QueryOnlyAsserted.
public  voidsetQueryOnlyReified(boolean opt)
     Set the value of QueryOnlyReified.
public static  intstyleRDB(ReificationStyle style)
     Answer the integer representing the RDB reifier style given the Reifier style.
public static  ReificationStylestyleRDB(int behaviour)
     Answer the reification style corresponding to the DB behaviour integer.

Field Detail
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_driver
protected IRDBDriver m_driver(Code)



m_prefixMapping
protected DBPrefixMappingImpl m_prefixMapping(Code)



m_properties
protected DBPropGraph m_properties(Code)



m_reificationBehaviour
protected int m_reificationBehaviour(Code)



m_reifier
protected Reifier m_reifier(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)




Constructor Detail
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 ).




Method Detail
DBqueryHandler
public DBQueryHandler DBqueryHandler()(Code)



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.



getBulkUpdateHandler
public BulkUpdateHandler getBulkUpdateHandler()(Code)



getCapabilities
public Capabilities getCapabilities()(Code)
Database graphs do not presently support the equivalence of plain string literals and xsd:string literals (and other typed literals in general).
See Also:   com.hp.hpl.jena.graph.Graph.getCapabilities



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



getPrefixMapping
public PrefixMapping getPrefixMapping()(Code)



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



getReifier
public Reifier getReifier()(Code)



getSpecializedGraphs
public Iterator getSpecializedGraphs()(Code)
Return an iterator over the specialized graphs for this graph Iterator over the list of specialized graphs.



getTransactionHandler
public TransactionHandler getTransactionHandler()(Code)



graphBaseContains
public boolean graphBaseContains(Triple t)(Code)



graphBaseFind
public ExtendedIterator graphBaseFind(TripleMatch m)(Code)



graphBaseSize
public int graphBaseSize()(Code)



isClosed
public boolean isClosed()(Code)



isOpen
protected boolean isOpen()(Code)



performAdd
public void performAdd(Triple t)(Code)



performDelete
public void performDelete(Triple t)(Code)



queryHandler
public QueryHandler queryHandler()(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)



reifierTriples
public ExtendedIterator reifierTriples(TripleMatch m)(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.



Fields inherited from com.hp.hpl.jena.graph.impl.GraphBase
protected BulkUpdateHandler bulkHandler(Code)(Java Doc)
protected Capabilities capabilities(Code)(Java Doc)
protected boolean closed(Code)(Java Doc)
protected GraphEventManager gem(Code)(Java Doc)
protected PrefixMapping pm(Code)(Java Doc)
protected QueryHandler queryHandler(Code)(Java Doc)
protected Reifier reifier(Code)(Java Doc)
protected GraphStatisticsHandler statisticsHandler(Code)(Java Doc)
final protected ReificationStyle style(Code)(Java Doc)

Methods inherited from com.hp.hpl.jena.graph.impl.GraphBase
public void add(Triple t)(Code)(Java Doc)
protected void checkOpen()(Code)(Java Doc)
public void close()(Code)(Java Doc)
protected Reifier constructReifier()(Code)(Java Doc)
final public boolean contains(Triple t)(Code)(Java Doc)
final public boolean contains(Node s, Node p, Node o)(Code)(Java Doc)
final protected boolean containsByFind(Triple t)(Code)(Java Doc)
protected GraphStatisticsHandler createStatisticsHandler()(Code)(Java Doc)
final public void delete(Triple t)(Code)(Java Doc)
public boolean dependsOn(Graph other)(Code)(Java Doc)
final public ExtendedIterator find(TripleMatch m)(Code)(Java Doc)
final public ExtendedIterator find(Node s, Node p, Node o)(Code)(Java Doc)
public ExtendedIterator forTestingOnly_graphBaseFind(TripleMatch tm)(Code)(Java Doc)
public BulkUpdateHandler getBulkUpdateHandler()(Code)(Java Doc)
public Capabilities getCapabilities()(Code)(Java Doc)
public GraphEventManager getEventManager()(Code)(Java Doc)
public PrefixMapping getPrefixMapping()(Code)(Java Doc)
public Reifier getReifier()(Code)(Java Doc)
public GraphStatisticsHandler getStatisticsHandler()(Code)(Java Doc)
public TransactionHandler getTransactionHandler()(Code)(Java Doc)
protected boolean graphBaseContains(Triple t)(Code)(Java Doc)
abstract protected ExtendedIterator graphBaseFind(TripleMatch m)(Code)(Java Doc)
protected ExtendedIterator graphBaseFind(Node s, Node p, Node o)(Code)(Java Doc)
protected int graphBaseSize()(Code)(Java Doc)
public boolean isClosed()(Code)(Java Doc)
public boolean isEmpty()(Code)(Java Doc)
public boolean isIsomorphicWith(Graph g)(Code)(Java Doc)
public void notifyAdd(Triple t)(Code)(Java Doc)
public void notifyDelete(Triple t)(Code)(Java Doc)
public void performAdd(Triple t)(Code)(Java Doc)
public void performDelete(Triple t)(Code)(Java Doc)
public QueryHandler queryHandler()(Code)(Java Doc)
protected boolean reifierContains(Triple t)(Code)(Java Doc)
protected int reifierSize()(Code)(Java Doc)
protected ExtendedIterator reifierTriples(TripleMatch m)(Code)(Java Doc)
final public int size()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public static String toString(String prefix, Graph that)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.