Java Doc for PSet_TripleStore_RDB.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » db » impl » 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.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.hp.hpl.jena.db.impl.PSet_TripleStore_RDB

All known Subclasses:   com.hp.hpl.jena.db.impl.PSet_ReifStore_RDB,
PSet_TripleStore_RDB
public class PSet_TripleStore_RDB implements IPSet(Code)
Handles Physical storage for implementing SpecializedGraphs. Different PSet classes are needed for different databases and different layout schemes.

This class is a base implemention from which database-specific drivers can inherit. It is not generic in the sense that it will work on any minimal SQL store and so should be treated as if it were an abstract class.

The SQL statements which implement each of the functions are loaded in a separate file etc/[layout]_[database].sql from the classpath. See SQLCache SQLCache documentation for more information on the format of this file. Based on Driver* classes by Dave Reynolds.
author:
   Harumi Kuno
version:
   $Revision: 1.58 $ on $Date: 2008/01/02 12:08:23 $



Field Summary
protected  booleanCACHE_PREPARED_STATEMENTS
    
final protected static  intDEFAULT_CACHE
    
protected  StringID_SQL_TYPE
    
protected  booleanSKIP_DUPLICATE_CHECK
    
protected  ICacheliteralCache
    
protected static  Loglogger
    
protected  IRDBDriverm_driver
    
protected  SQLCachem_sql
    
public  Stringm_tblName
     Holds name of AssertedStatement table (defaults to JENA_SYS_AssStatements).
protected  ICacheresourceCache
    

Constructor Summary
public  PSet_TripleStore_RDB()
     Constructor.

Method Summary
public  voidcleanDB()
     Remove all RDF information about this pset from a database.
public  voidclose()
    
public  voiddeleteTriple(Triple t, IDBID graphID)
     Attempt to remove a statement from an Asserted_Statement table, if it is present.
public  voiddeleteTriple(Triple t, IDBID graphID, boolean isBatch, Hashtable batchedPreparedStatements)
     Attempt to remove a statement from an Asserted_Statement table, if it is present.
public  voiddeleteTripleAR(Triple t, IDBID graphID, Node reifNode, boolean isBatch, Hashtable batchedPreparedStatements)
     Attempt to remove a statement from an Asserted_Statement table, if it is present.
public  voiddeleteTripleList(List triples, IDBID my_GID)
     Attempt to remove a list of triples from the specialized graph. As each triple is successfully deleted it is removed from the List.
public  IRDBDriverdriver()
    
public  TripleextractTripleFromRowData(String subj, String pred, String obj)
     Convert the current row of a result set from a ResultSet to a Triple.
public  ExtendedIteratorfind(TripleMatch t, IDBID graphID)
    
public  Node_LiteralgetLiteralFromCache(IDBID id)
     Fetch a literal from the cache just knowing its literal rdb-id.
public  PreparedStatementgetPreparedStatement(String op, String tableName, boolean isBatch, Hashtable batchedPreparedStatements)
     Given an operation name, a table name, whether or not this operation is part of a batched update, and a table of batched prepared statements, find or create an appropriate PreparedStatement.
public  SQLCachegetSQLCache()
    
public  StringgetTblName()
     Accessor for m_tblName.
public  voidremoveStatementsFromDB(IDBID graphID)
    
public  introwCount(int gid)
     Compute the number of rows in a table.
public  voidsetCachePreparedStatements(boolean value)
    
public  voidsetDriver(IRDBDriver driver)
    
public  voidsetSQLCache(SQLCache cache)
    
public  voidsetSQLType(String value)
    
public  voidsetSkipDuplicateCheck(boolean value)
    
public  voidsetTblName(String tblName)
     Sets m_tblName variable.
public  booleanstatementTableContains(IDBID graphID, Triple t)
     Tests if a triple is contained in the specialized graph.
Parameters:
  t - is the triple to be tested
Parameters:
  graphID - is the id of the graph.
public  voidstoreTriple(Triple t, IDBID graphID)
     Attempt to store a statement into an Asserted_Statement table.
public  voidstoreTriple(Triple t, IDBID graphID, boolean isBatch, Hashtable batchedPreparedStatements)
     Attempt to store a statement into an Asserted_Statement table.
public  voidstoreTripleAR(Triple t, IDBID graphID, Node reifNode, boolean hasType, boolean isBatch, Hashtable batchedPreparedStatements)
     Attempt to store a statement into an Asserted_Statement table.
public  voidstoreTripleList(List triples, IDBID my_GID)
     Attempt to add a list of triples to the specialized graph. As each triple is successfully added it is removed from the List.
public  StringtoString()
    
public  inttripleCount(IDBID graphId)
     Compute the number of unique triples added to the Specialized Graph.
public  IDBIDwrapDBID(Object id)
     Convert the raw SQL object used to store a database identifier into a java object which meets the IDBID interface.
public  ObjectwrapFlag(boolean flag)
     Wrap up a boolean flag as a object which the jdbc driver can assert into a boolean/short column.

Field Detail
CACHE_PREPARED_STATEMENTS
protected boolean CACHE_PREPARED_STATEMENTS(Code)
Set to true to enable cache of pre-prepared statements



DEFAULT_CACHE
final protected static int DEFAULT_CACHE(Code)
default size for literal and resource caches



ID_SQL_TYPE
protected String ID_SQL_TYPE(Code)
The SQL type to use for storing ids (compatible with wrapDBID)



SKIP_DUPLICATE_CHECK
protected boolean SKIP_DUPLICATE_CHECK(Code)
Set to true if the insert operations already check for duplications



literalCache
protected ICache literalCache(Code)
Cache of literals



logger
protected static Log logger(Code)



m_driver
protected IRDBDriver m_driver(Code)
The IRDBDriver for the database.



m_sql
protected SQLCache m_sql(Code)
The table of sql driver statements



m_tblName
public String m_tblName(Code)
Holds name of AssertedStatement table (defaults to JENA_SYS_AssStatements). Every triple store has at least one tables for AssertedStatements.



resourceCache
protected ICache resourceCache(Code)
Cache of resources




Constructor Detail
PSet_TripleStore_RDB
public PSet_TripleStore_RDB()(Code)
Constructor.




Method Detail
cleanDB
public void cleanDB()(Code)
Remove all RDF information about this pset from a database.



close
public void close()(Code)
Close this PSet



deleteTriple
public void deleteTriple(Triple t, IDBID graphID)(Code)
Attempt to remove a statement from an Asserted_Statement table, if it is present. Return without error if the statement is not present.
Parameters:
  subj_uri - is the URI of the subject
Parameters:
  pred_uri - is the URI of the predicate (property)
Parameters:
  obj_node - is the URI of the object (can be URI or literal)
Parameters:
  graphID - is the ID of the graph
Parameters:
  complete - is true if this handler is capable of adding this triple.



deleteTriple
public void deleteTriple(Triple t, IDBID graphID, boolean isBatch, Hashtable batchedPreparedStatements)(Code)
Attempt to remove a statement from an Asserted_Statement table, if it is present. Return without error if the statement is not present.
Parameters:
  subj_uri - is the URI of the subject
Parameters:
  pred_uri - is the URI of the predicate (property)
Parameters:
  obj_node - is the URI of the object (can be URI or literal)
Parameters:
  graphID - is the ID of the graph
Parameters:
  complete - is true if this handler is capable of adding this triple.



deleteTripleAR
public void deleteTripleAR(Triple t, IDBID graphID, Node reifNode, boolean isBatch, Hashtable batchedPreparedStatements)(Code)
Attempt to remove a statement from an Asserted_Statement table, if it is present. Return without error if the statement is not present.
Parameters:
  subj_uri - is the URI of the subject
Parameters:
  pred_uri - is the URI of the predicate (property)
Parameters:
  obj_node - is the URI of the object (can be URI or literal)
Parameters:
  stmtURI - is the URI of the statement if reified, null for asserted
Parameters:
  graphID - is the ID of the graph
Parameters:
  complete - is true if this handler is capable of adding this triple.



deleteTripleList
public void deleteTripleList(List triples, IDBID my_GID)(Code)
Attempt to remove a list of triples from the specialized graph. As each triple is successfully deleted it is removed from the List. If complete is true then the entire List was added and the List will be empty upon return. if complete is false, then at least one triple remains in the List. If a triple can't be stored for any reason other than incompatability (for example, a lack of disk space) then the implemenation should throw a runtime exception.
Parameters:
  triples - List of triples to be added. This is modified by the call.
Parameters:
  my_GID - ID of the graph.



driver
public IRDBDriver driver()(Code)
the database driver.



extractTripleFromRowData
public Triple extractTripleFromRowData(String subj, String pred, String obj)(Code)
Convert the current row of a result set from a ResultSet to a Triple. Expects row to contain: S.SubjRes, S.PropRes, S.ObjRes, S.ObjStr, S.ObjLiteral
Parameters:
  rs - the resultSet to be processed.



find
public ExtendedIterator find(TripleMatch t, IDBID graphID)(Code)



getLiteralFromCache
public Node_Literal getLiteralFromCache(IDBID id)(Code)
Fetch a literal from the cache just knowing its literal rdb-id. If it is not in the cache, do not attempt to retrieve it from the database.



getPreparedStatement
public PreparedStatement getPreparedStatement(String op, String tableName, boolean isBatch, Hashtable batchedPreparedStatements) throws SQLException(Code)
Given an operation name, a table name, whether or not this operation is part of a batched update, and a table of batched prepared statements, find or create an appropriate PreparedStatement.
Parameters:
  op -
Parameters:
  tableName -
Parameters:
  isBatch -
Parameters:
  batchedPreparedStatements - the prepared statement
throws:
  SQLException -



getSQLCache
public SQLCache getSQLCache()(Code)



getTblName
public String getTblName()(Code)
Accessor for m_tblName. name of the Statement table.



removeStatementsFromDB
public void removeStatementsFromDB(IDBID graphID)(Code)



rowCount
public int rowCount(int gid)(Code)
Compute the number of rows in a table. int count.



setCachePreparedStatements
public void setCachePreparedStatements(boolean value)(Code)



setDriver
public void setDriver(IRDBDriver driver) throws RDFRDBException(Code)
Link an existing instance of the IPSet to a specific driver



setSQLCache
public void setSQLCache(SQLCache cache)(Code)



setSQLType
public void setSQLType(String value)(Code)



setSkipDuplicateCheck
public void setSkipDuplicateCheck(boolean value)(Code)



setTblName
public void setTblName(String tblName)(Code)
Sets m_tblName variable.
Parameters:
  tblName - the name of the Statement Table



statementTableContains
public boolean statementTableContains(IDBID graphID, Triple t)(Code)
Tests if a triple is contained in the specialized graph.
Parameters:
  t - is the triple to be tested
Parameters:
  graphID - is the id of the graph. boolean result to indicte if the tripple was contained



storeTriple
public void storeTriple(Triple t, IDBID graphID)(Code)
Attempt to store a statement into an Asserted_Statement table.
Parameters:
  subj_uri - is the URI of the subject
Parameters:
  pred_uri - is the URI of the predicate (property)
Parameters:
  obj_node - is the URI of the object (can be URI or literal)
Parameters:
  graphID - is the ID of the graph
Parameters:
  complete - is true if this handler is capable of adding this triple.



storeTriple
public void storeTriple(Triple t, IDBID graphID, boolean isBatch, Hashtable batchedPreparedStatements)(Code)
Attempt to store a statement into an Asserted_Statement table.
Parameters:
  subj_uri - is the URI of the subject
Parameters:
  pred_uri - is the URI of the predicate (property)
Parameters:
  obj_node - is the URI of the object (can be URI or literal)
Parameters:
  graphID - is the ID of the graph
Parameters:
  isBatch - is true if this request is part of a batch operation.



storeTripleAR
public void storeTripleAR(Triple t, IDBID graphID, Node reifNode, boolean hasType, boolean isBatch, Hashtable batchedPreparedStatements)(Code)
Attempt to store a statement into an Asserted_Statement table.
Parameters:
  subj_uri - is the URI of the subject
Parameters:
  pred_uri - is the URI of the predicate (property)
Parameters:
  obj_node - is the URI of the object (can be URI or literal)
Parameters:
  stmtURI - is the URI of the statement if reified, null for asserted
Parameters:
  hasType - is true if the hasType flag should be set for a reified stmt
Parameters:
  graphID - is the ID of the graph
Parameters:
  isBatch - is true if this request is part of a batch operation.



storeTripleList
public void storeTripleList(List triples, IDBID my_GID)(Code)
Attempt to add a list of triples to the specialized graph. As each triple is successfully added it is removed from the List. If complete is true then the entire List was added and the List will be empty upon return. if complete is false, then at least one triple remains in the List. If a triple can't be stored for any reason other than incompatability (for example, a lack of disk space) then the implemenation should throw a runtime exception.
Parameters:
  triples - List of triples to be added. This is modified by the call.
Parameters:
  my_GID - ID of the graph.



toString
public String toString()(Code)
Printable name for the driver configuration



tripleCount
public int tripleCount(IDBID graphId)(Code)
Compute the number of unique triples added to the Specialized Graph. int count.



wrapDBID
public IDBID wrapDBID(Object id) throws RDFRDBException(Code)
Convert the raw SQL object used to store a database identifier into a java object which meets the IDBID interface.



wrapFlag
public Object wrapFlag(boolean flag)(Code)
Wrap up a boolean flag as a object which the jdbc driver can assert into a boolean/short column.



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.