1 6 7 package com.hp.hpl.jena.db.impl; 8 9 11 13 import java.util.List ; 14 15 import com.hp.hpl.jena.db.IDBConnection; 16 import com.hp.hpl.jena.db.RDFRDBException; 17 import com.hp.hpl.jena.graph.Graph; 18 import com.hp.hpl.jena.graph.Node; 19 20 21 35 36 public interface IRDBDriver { 37 38 41 public void setConnection( IDBConnection dbcon ); 42 43 46 public IDBConnection getConnection(); 47 48 56 public SpecializedGraph getSystemSpecializedGraph(boolean doInit); 57 58 66 public List createSpecializedGraphs(String graphName, Graph requestedProperties); 67 68 75 public List recreateSpecializedGraphs(DBPropGraph graphProperties); 76 77 83 public void removeSpecializedGraphs(DBPropGraph graphProperties, List specializedGraphs); 84 85 92 public boolean isDBFormatOK(); 93 94 101 void setDatabaseProperties(Graph databaseProperties); 102 103 109 DBPropGraph getDefaultModelProperties(); 110 111 115 String getDatabaseType(); 116 117 118 125 126 public void cleanDB(); 127 128 132 133 public void close() throws RDFRDBException; 134 135 144 145 public void formatDB() throws RDFRDBException; 146 147 157 158 public void lockDB() throws RDFRDBException; 159 160 163 164 public void unlockDB() throws RDFRDBException; 165 166 169 170 public boolean tryLockDB() throws RDFRDBException; 171 172 180 181 184 185 public boolean DBisLocked() throws RDFRDBException; 186 187 abstract String createTable( int graphId, boolean isReif); 188 189 194 abstract void deleteTable( String tableName ); 195 196 197 200 public void abort() throws RDFRDBException; 201 202 205 public void begin() throws RDFRDBException; 206 207 210 public void commit() throws RDFRDBException; 211 212 215 public boolean transactionsSupported(); 216 217 222 223 public boolean supportsMultipleModels(); 224 225 234 235 public boolean supportsJenaReification(); 236 237 242 public int graphIdAlloc ( String graphName ); 243 244 248 public void graphIdDealloc ( int graphId ); 249 250 255 public int getInsertID ( String tableName ); 256 257 258 264 265 public String nodeToRDBString ( Node node, boolean addIfLong ); 266 267 272 273 public Node RDBStringToNode ( String RDBString ); 274 275 279 280 public String genSQLReifQualStmt (); 281 282 289 290 public String genSQLReifQualAnyObj( boolean objIsStmt); 291 292 300 301 public String genSQLReifQualObj ( char reifProp, boolean hasObj ); 302 303 319 320 public String genSQLQualConst ( int alias, char col, Node lit ); 321 322 327 public String genSQLReifQualConst ( int alias, char pred, Node lit ); 328 329 330 337 338 public String genSQLQualParam( int alias, char col ); 339 340 346 347 public String genSQLQualGraphId( int alias, int graphId ); 348 349 public String genSQLStringMatch( int alias, char col, 350 String fun, String stringToMatch ); 351 352 public String genSQLStringMatchLHS( boolean ignCase, String var ); 353 public String genSQLStringMatchLHS_IC( String var ); 354 355 public String genSQLStringMatchOp( boolean ignCase, String fun ); 356 357 public String stringMatchAllChar(); 358 public String stringMatchEscapeChar(); 359 360 public String genSQLStringMatchRHS( boolean ignCase, boolean pfxMatch, 361 String strToMatch ); 362 public String genSQLStringMatchRHS_IC( String strToMatch ); 363 364 public String genSQLStringMatchOp( String fun ); 365 366 public String genSQLStringMatchOp_IC( String fun ); 367 368 public boolean stringMatchNeedsEscape ( String strToMatch ); 369 370 public String addEscape ( String strToMatch ); 371 372 public String genSQLStringMatchEscape(); 373 374 public String genSQLLikeKW(); 375 376 public String genSQLEscapeKW(); 377 378 379 380 381 390 391 public String genSQLJoin( int lhsAlias, char lhsCol, 392 int rhsAlias, char rhsCol ); 393 394 399 400 public String genSQLResList( int resIndex[], VarDesc[] binding ); 401 402 408 409 public String genSQLFromList( int aliasCnt, String table ); 410 411 412 420 421 public String genSQLSelectStmt( String res, String from, String where ); 422 423 public class GenSQLAnd { 424 private boolean init; 425 GenSQLAnd () { init = false; } 426 String gen( String qual ) { 427 if ( qual == "" ) return ""; 428 if ( init == false ) { 429 init = true; 430 return qual; 431 } else 432 return " AND " + qual; 433 } 434 } 435 436 440 public int getLongObjectLength(); 441 442 447 public void setLongObjectLength(int len); 448 449 453 public int getIndexKeyLength(); 454 455 460 public void setIndexKeyLength(int len); 461 462 466 public boolean getIsTransactionDb(); 467 468 473 public void setIsTransactionDb(boolean bool); 474 475 479 public boolean getDoCompressURI(); 480 481 486 public void setDoCompressURI(boolean bool); 487 488 492 public int getCompressURILength(); 493 494 499 public void setCompressURILength(int len); 500 501 505 public boolean getDoDuplicateCheck(); 506 507 511 public void setDoDuplicateCheck(boolean bool); 512 513 517 public String getTableNamePrefix(); 518 519 523 public void setTableNamePrefix(String prefix); 524 525 529 public String getStoreWithModel(); 530 531 535 public void setStoreWithModel( String modelName ); 536 537 541 public int getCompressCacheSize(); 542 543 547 public void setCompressCacheSize(int count); 548 549 552 553 public int getSystemTableCount(); 554 555 558 559 public String getSystemTableName ( int i ); 560 561 } 562 563 589 590 591 | Popular Tags |