KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > db > impl > IPSet


1 /*
2   (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3   [See end of file]
4 */

5
6 package com.hp.hpl.jena.db.impl;
7
8 import java.util.List JavaDoc;
9
10 import com.hp.hpl.jena.db.RDFRDBException;
11 import com.hp.hpl.jena.graph.Triple;
12 import com.hp.hpl.jena.graph.TripleMatch;
13 import com.hp.hpl.jena.util.iterator.ExtendedIterator;
14
15
16 /**
17 * Generic database interface used for implementing PStore
18 * Different database table layouts and different SQL dialects should all
19 * be supportable via this generic interface.
20 *
21 * Based on the Jena1 version of IRDBDriver by Dave Reynolds
22 *
23 * @author hkuno
24 * @version $Revision: 1.11 $
25 */

26
27 public interface IPSet {
28
29     /**
30      * Link an existing instance of the IPSet to a specific driver
31      */

32     public void setDriver(IRDBDriver driver) throws RDFRDBException;
33
34     /**
35      * Pass the SQL cache to the IPSet
36      */

37     public void setSQLCache(SQLCache cache);
38     public SQLCache getSQLCache();
39     public void setSQLType(String JavaDoc value);
40     public void setSkipDuplicateCheck(boolean value);
41     public void setCachePreparedStatements(boolean value);
42
43     /**
44      * Close this PSet
45      */

46     public void close();
47
48     /**
49      * Remove all RDF information associated with this PSet
50      * from a database.
51      */

52     public void cleanDB();
53     
54     /**
55      * Return boolean indicating whether or not statement
56      * table for specified statement table contains
57      * the specified triple for the specified graph.
58      */

59     public boolean statementTableContains(IDBID graphID, Triple t);
60         
61     
62     /**
63      * @param t the triple to be added
64      * @param gid the id of the graph
65      */

66     public void storeTriple(Triple t, IDBID gid);
67     
68     /**
69      * Attempt to add a list of triples to the specialized graph.
70      *
71      * As each triple is successfully added it is removed from the List.
72      * If complete is true then the entire List was added and the List will
73      * be empty upon return. if complete is false, then at least one triple
74      * remains in the List.
75      *
76      * If a triple can't be stored for any reason other than incompatability
77      * (for example, a lack of disk space) then the implemenation should throw
78      * a runtime exception.
79      *
80      * @param triples List of triples to be added. This is modified by the call.
81      * @param my_GID ID of the graph.
82      */

83     public void storeTripleList(List JavaDoc triples, IDBID my_GID);
84
85
86
87
88     /**
89      * @param t the triple to be added
90      * @param gid the id of the graph
91      */

92     public void deleteTriple(Triple t, IDBID gid);
93     
94     /**
95          * @param t the triple to be added
96          * @param gid the id of the graph
97          */

98     public void deleteTripleList(List JavaDoc triples, IDBID gid);
99     
100     
101     /**
102      * Method extractTripleFromRowData.
103      * @param subjURI
104      * @param predURI
105      * @param objURI may be null
106      * @param objVal may be null
107      * @param objRef may be null
108      * @return Triple
109      */

110     Triple extractTripleFromRowData(
111         String JavaDoc subj,
112         String JavaDoc pred,
113         String JavaDoc obj);
114         
115     /**
116      * Method find matching entries
117      * @param t tripleMatch pattern
118      * @param graphID of the graph to search
119      * @return ExtendedIterator holding results
120      */

121     public ExtendedIterator find(TripleMatch t,
122     IDBID graphID);
123     
124     /**
125      * Return a count of the rows in a given table
126      *
127      * @param tName
128      * @return int
129      */

130     public int rowCount(String JavaDoc tName);
131
132     /**
133      * Remove the statements associated with this PStore
134      * from the database tables. Leave Literals.
135      * @param pProp properties
136      */

137     public void removeStatementsFromDB(IDBID graphID);
138
139     /**
140      * @return number of triples in AssertedStatement table
141      */

142     public int tripleCount();
143
144     /**
145      * @param tblName
146      */

147     public void setTblName(String JavaDoc tblName);
148     
149     /**
150      * @return String the name of the table that stores the PSet.
151      */

152     public String JavaDoc getTblName();
153
154     /**
155      * @return the driver for the PSet
156      */

157     public IRDBDriver driver();
158
159 }
160
161 /*
162  * (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
163  * All rights reserved.
164  *
165  * Redistribution and use in source and binary forms, with or without
166  * modification, are permitted provided that the following conditions
167  * are met:
168  * 1. Redistributions of source code must retain the above copyright
169  * notice, this list of conditions and the following disclaimer.
170  * 2. Redistributions in binary form must reproduce the above copyright
171  * notice, this list of conditions and the following disclaimer in the
172  * documentation and/or other materials provided with the distribution.
173  * 3. The name of the author may not be used to endorse or promote products
174  * derived from this software without specific prior written permission.
175
176  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
177  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
178  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
179  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
180  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
181  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
182  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
183  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
184  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
185  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
186  */

187     
188  
189
Popular Tags