|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.openrdf.sesame.sailimpl.rdbms.RdfSource
A portable implementation of the RdfSource interface for relational databases, based on (a subset of) the SQL2/SQL92 standard. This class defines the read-only methods, the subclass RdfRepository defines the update methods.
| Field Summary | |
static String |
JDBC_DRIVER_KEY
Key used to specify a JDBC driver in the initialization parameters |
static String |
JDBC_URL_KEY
Key used to specify a JDBC URL in the initialization parameters |
static String |
KEY_EXPORT_FLAGS
Key used to store the status of the export flags in the metadata table |
static String |
KEY_SCHEMACREATOR
Key used to store the schema creator in the metadata table |
static String |
KEY_SCHEMAVERSION
Key used to store the schema version in the metadata table |
static String |
PASSWORD_KEY
Key used to specify a password in the initialization parameters |
static String |
USER_KEY
Key used to specify a username in the initialization parameters |
static String |
VALUE_DIRTY
Value used to indiate an "dirty" status in the metadata table |
static String |
VALUE_UP_TO_DATE
Value used to indiate an "up-to-date" status in the metadata table |
| Constructor Summary | |
RdfSource()
Creates a new RdfSource object that will be able to read triples from an RDF database. |
|
| Method Summary | |
BNode |
createBNode()
Creates a new bNode. |
BNode |
createBNode(String nodeId)
creates a new bNode with the given node identifier. |
Literal |
createLiteral(String value)
Creates a new literal with the supplied value. |
Literal |
createLiteral(String value,
String language)
Creates a new literal with the supplied value and language attribute. |
Literal |
createLiteral(String value,
URI datatype)
Creates a new literal with the supplied value and datatype. |
Statement |
createStatement(Resource subject,
URI predicate,
Value object)
Creates a new statement with the supplied subject, predicate and object. |
URI |
createURI(String uri)
Creates a new URI from the supplied string-representation. |
URI |
createURI(String namespace,
String localName)
Creates a new URI that will get the supplied namespace and local name. |
IdLiteral |
getLiteral(int id)
Gets the Literal for the supplied ID. |
NamespaceIterator |
getNamespaces()
Gets the prefix and name of all namespaces. |
IdResource |
getResource(int id)
Gets the Resource for the supplied ID. |
StatementIterator |
getStatements(Resource subj,
URI pred,
Value obj)
Gets all statements with a specific subject, predicate and/or object. |
StatementIterator |
getStatements(Resource subj,
URI pred,
Value obj,
boolean explicitOnly)
|
IdValue |
getValue(int id)
Gets the Value for the supplied ID. |
ValueFactory |
getValueFactory()
Gets a ValueFactory object that can be used to create URI-, blank node- and literal objects. |
boolean |
hasStatement(Resource subj,
URI pred,
Value obj)
Checks whether some statement with a specific subject, predicate and/or object is present in the repository. |
boolean |
hasStatement(Resource subj,
URI pred,
Value obj,
boolean explicitOnly)
|
void |
initialize(Map configParams)
Initializes the RdfSource. |
void |
initialize(String jdbcDriver,
String jdbcUrl)
Initializes the RdfSource. |
void |
initialize(String jdbcDriver,
String jdbcUrl,
String user,
String password)
Initializes the RdfSource. |
Query |
optimizeQuery(Query query)
Merges all TriplePatterns to one large SQL-join and includes as much of the boolean constraints as possible. |
void |
shutDown()
Disconnects from the database. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String KEY_SCHEMAVERSION
public static final String KEY_SCHEMACREATOR
public static final String KEY_EXPORT_FLAGS
public static final String VALUE_UP_TO_DATE
public static final String VALUE_DIRTY
public static final String JDBC_DRIVER_KEY
public static final String JDBC_URL_KEY
public static final String USER_KEY
public static final String PASSWORD_KEY
| Constructor Detail |
public RdfSource()
| Method Detail |
public void initialize(String jdbcDriver,
String jdbcUrl)
throws SailInitializationException
jdbcDriver - The String representing the JDBC-driver class, e.g.
org.gjt.mm.mysql.Driver.jdbcUrl - The String representing the JDBC-url of the database to connect to,
e.g. jdbc:mysql://localhost/sesame.
SailInitializationException - If the initialization failed.
public void initialize(String jdbcDriver,
String jdbcUrl,
String user,
String password)
throws SailInitializationException
jdbcDriver - The String representing the JDBC-driver class, e.g.
org.gjt.mm.mysql.Driver.jdbcUrl - The String representing the JDBC-url of the database to connect to,
e.g. jdbc:mysql://localhost/sesame.user - The username that can be used to connect to the RDBMS.password - The password of the user in the RDBMS.
SailInitializationException - If the initialization failed.
public void initialize(Map configParams)
throws SailInitializationException
initialize in interface SailconfigParams - configuration parameters
SailInitializationException - If the RdfSource could not be initialized using the supplied
parameters.JDBC_DRIVER_KEY,
JDBC_URL_KEY,
USER_KEY,
PASSWORD_KEY,
initialize(java.lang.String,java.lang.String,java.lang.String,java.lang.String)public void shutDown()
shutDown in interface Sailpublic ValueFactory getValueFactory()
RdfSource
getValueFactory in interface RdfSource
public StatementIterator getStatements(Resource subj,
URI pred,
Value obj)
RdfSource
getStatements in interface RdfSourcesubj - subject of patternpred - predicate of patternobj - object of pattern
public StatementIterator getStatements(Resource subj,
URI pred,
Value obj,
boolean explicitOnly)
public boolean hasStatement(Resource subj,
URI pred,
Value obj)
RdfSource
hasStatement in interface RdfSourcesubj - subject of statementpred - predicate of statementobj - object of statement
public Query optimizeQuery(Query query)
optimizeQuery in interface RdfSourcequery - The Query to optimize.
public boolean hasStatement(Resource subj,
URI pred,
Value obj,
boolean explicitOnly)
public NamespaceIterator getNamespaces()
RdfSource
getNamespaces in interface RdfSourcepublic IdValue getValue(int id)
public IdResource getResource(int id)
public IdLiteral getLiteral(int id)
public URI createURI(String uri)
ValueFactory
createURI in interface ValueFactoryuri - A string-representation of a URI.
public URI createURI(String namespace,
String localName)
ValueFactory
createURI in interface ValueFactorynamespace - A namespace.localName - A legal local name. A legal local name adheres to the
definition of an NCName as specified at
http://www.w3.org/TR/REC-xml-names/#NT-NCName.public BNode createBNode()
ValueFactory
createBNode in interface ValueFactorypublic BNode createBNode(String nodeId)
ValueFactory
createBNode in interface ValueFactorynodeId - the bnode identifier
public Literal createLiteral(String value)
ValueFactory
createLiteral in interface ValueFactoryvalue - The literal's value.
public Literal createLiteral(String value,
String language)
ValueFactory
createLiteral in interface ValueFactoryvalue - The literal's value.language - The literal's language attribute, or null if the
literal doesn't have a language.
public Literal createLiteral(String value,
URI datatype)
ValueFactory
createLiteral in interface ValueFactoryvalue - The literal's value.datatype - The literal's datatype, or null if the literal
doesn't have a datatype.
public Statement createStatement(Resource subject,
URI predicate,
Value object)
ValueFactory
createStatement in interface ValueFactorysubject - The statement's subject.predicate - The statement's predicate.object - The statement's object.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||