|
|||||||||
| Home >> All >> nl >> aidministrator >> rdf >> ral >> [ rdbms overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
nl.aidministrator.rdf.ral.rdbms
Class SQLStatementIterator

java.lang.Objectnl.aidministrator.rdf.ral.rdbms.SQLStatementIterator
- All Implemented Interfaces:
- nl.aidministrator.rdf.ral.StatementIterator
- public class SQLStatementIterator
- extends java.lang.Object
- implements nl.aidministrator.rdf.ral.StatementIterator
- extends java.lang.Object
A StatementIterator that executes an SQL query. The ResultSet should contain 6 columns: namespace(String) and localname(String) of subject, namespace(String) and localname(String) of predicate and namespace(String), localname(String) if object is instance of rdfs:Resource or language(String) and value(String) if object is instance of rdfs:Literal. With getObject() a StatementIterator returns the object of the statement it is pointing at. An object can be of type rdfs:Resource or rdfs:Literal, therefore it should know whether to construct a Resource or a Literal out of the ResultSet. A way to establish this is to execute 2 queries, one where object of table triples is joined with id of table resources and one where it is joined with id of table literals. Boolean _literalsHasBeenQueried identifies which query is executed, so whether to construct a Resource or a Literal out of the ResultSet.
- Version:
- 1.4, 12/17/01
| Field Summary | |
protected java.sql.Connection |
_databaseCon
Connection to the database. |
protected boolean |
_hasNext
Flag indicating whether there are any more results. |
protected boolean |
_literalsHasBeenQueried
Indicates which query is executed. |
protected nl.aidministrator.rdf.sail.model.Value |
_nextObject
Object of statement iterator is currently pointing at. |
protected nl.aidministrator.rdf.sail.model.Resource |
_nextPredicate
Predicate of statement iterator is currently pointing at. |
protected nl.aidministrator.rdf.sail.model.Resource |
_nextSubject
Subject of statement iterator is currently pointing at. |
protected boolean |
_objectFixed
Is object fixed. |
protected boolean |
_predicateFixed
Is predicate fixed. |
protected java.lang.String |
_queryLiterals
The query to execute. |
protected java.lang.String |
_queryResources
The query to execute. |
protected java.sql.ResultSet |
_resultSet
ResultSet for the query. |
protected java.sql.Statement |
_statement
SQL statement that was used to generate the ResultSet. |
protected boolean |
_subjectFixed
Is subject fixed. |
| Constructor Summary | |
SQLStatementIterator(java.sql.Connection databaseCon,
java.lang.String queryResources,
java.lang.String queryLiterals,
nl.aidministrator.rdf.sail.model.Resource subject,
nl.aidministrator.rdf.sail.model.Resource predicate,
nl.aidministrator.rdf.sail.model.Value object)
Constructor. |
|
| Method Summary | |
private void |
_execQuery(java.lang.String query)
|
private void |
_proceed()
|
void |
close()
Closes all connections to the repository. |
protected void |
finalize()
Called by the garbage collector on SQLValueIterator when garbage collection determines that there are no more references to the SQLValueIterator. |
nl.aidministrator.rdf.sail.model.Value |
getObject()
Gets the predicate of the statement iterator is currently pointing at. |
nl.aidministrator.rdf.sail.model.Resource |
getPredicate()
Gets the predicate of the statement iterator is currently pointing at. |
nl.aidministrator.rdf.sail.model.Resource |
getSubject()
Gets the subject of the statement iterator is currently pointing at. |
boolean |
hasNext()
Checks whether there are any more results available. |
void |
next()
Gets the next result. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
_resultSet
protected java.sql.ResultSet _resultSet
- ResultSet for the query.
_statement
protected java.sql.Statement _statement
- SQL statement that was used to generate the ResultSet. It cannot be closed
until all results have been read from the ResultSet.
_databaseCon
protected java.sql.Connection _databaseCon
- Connection to the database.
_queryResources
protected java.lang.String _queryResources
- The query to execute.
_queryLiterals
protected java.lang.String _queryLiterals
- The query to execute.
_hasNext
protected boolean _hasNext
- Flag indicating whether there are any more results.
_nextSubject
protected nl.aidministrator.rdf.sail.model.Resource _nextSubject
- Subject of statement iterator is currently pointing at.
_nextPredicate
protected nl.aidministrator.rdf.sail.model.Resource _nextPredicate
- Predicate of statement iterator is currently pointing at.
_nextObject
protected nl.aidministrator.rdf.sail.model.Value _nextObject
- Object of statement iterator is currently pointing at.
_subjectFixed
protected boolean _subjectFixed
- Is subject fixed.
_predicateFixed
protected boolean _predicateFixed
- Is predicate fixed.
_objectFixed
protected boolean _objectFixed
- Is object fixed.
_literalsHasBeenQueried
protected boolean _literalsHasBeenQueried
- Indicates which query is executed.
| Constructor Detail |
SQLStatementIterator
public SQLStatementIterator(java.sql.Connection databaseCon, java.lang.String queryResources, java.lang.String queryLiterals, nl.aidministrator.rdf.sail.model.Resource subject, nl.aidministrator.rdf.sail.model.Resource predicate, nl.aidministrator.rdf.sail.model.Value object)
- Constructor.
| Method Detail |
_proceed
private void _proceed()
_execQuery
private void _execQuery(java.lang.String query)
hasNext
public boolean hasNext()
- Description copied from interface:
nl.aidministrator.rdf.ral.StatementIterator - Checks whether there are any more results available.
- Specified by:
hasNextin interfacenl.aidministrator.rdf.ral.StatementIterator
next
public void next()
- Description copied from interface:
nl.aidministrator.rdf.ral.StatementIterator - Gets the next result.
- Specified by:
nextin interfacenl.aidministrator.rdf.ral.StatementIterator
getSubject
public nl.aidministrator.rdf.sail.model.Resource getSubject()
- Description copied from interface:
nl.aidministrator.rdf.ral.StatementIterator - Gets the subject of the statement iterator is currently pointing at.
- Specified by:
getSubjectin interfacenl.aidministrator.rdf.ral.StatementIterator
getPredicate
public nl.aidministrator.rdf.sail.model.Resource getPredicate()
- Description copied from interface:
nl.aidministrator.rdf.ral.StatementIterator - Gets the predicate of the statement iterator is currently pointing at.
- Specified by:
getPredicatein interfacenl.aidministrator.rdf.ral.StatementIterator
getObject
public nl.aidministrator.rdf.sail.model.Value getObject()
- Description copied from interface:
nl.aidministrator.rdf.ral.StatementIterator - Gets the predicate of the statement iterator is currently pointing at.
- Specified by:
getObjectin interfacenl.aidministrator.rdf.ral.StatementIterator
close
public void close()
- Description copied from interface:
nl.aidministrator.rdf.ral.StatementIterator - Closes all connections to the repository.
- Specified by:
closein interfacenl.aidministrator.rdf.ral.StatementIterator
finalize
protected void finalize()
- Called by the garbage collector on SQLValueIterator when garbage
collection determines that there are no more references to the
SQLValueIterator.
|
|||||||||
| Home >> All >> nl >> aidministrator >> rdf >> ral >> [ rdbms overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
nl.aidministrator.rdf.ral.rdbms.SQLStatementIterator