Class ITER_SQL
java.lang.Object
fr.mines_stetienne.ci.sparql_generate.iterator.IteratorStreamFunctionBase
fr.mines_stetienne.ci.sparql_generate.iterator.IteratorStreamFunctionBase2
fr.mines_stetienne.ci.sparql_generate.sql.ITER_SQL
- All Implemented Interfaces:
IteratorFunction
Iterator function SQL
issues a SQL query to a database.
- Param 1: (database): the JDBC URL of the database, with its user and
password if it needs them, such as
<jdbc:mysql://localhost/db?user=me&password=secret>,<jdbc:postgresql://localhost/db?user=me&password=secret>or<jdbc:sqlite:data.db>. Any JDBC driver of the classpath is used; the MySQL driver is included. - Param 2: (sql) the SQL query;
- Output 1 .. N: value of the ith column, encoded as a boolean, float, double, integer, string, dateTimeStamp, as it best fits.
- Author:
- Omar Qawasmeh, Maxime Lefrançois
-
Field Summary
FieldsFields inherited from class fr.mines_stetienne.ci.sparql_generate.iterator.IteratorStreamFunctionBase
arguments -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckBuild(org.apache.jena.sparql.expr.ExprList args) Partially checks if the iterator function can be executed with the given arguments.voidexec(org.apache.jena.sparql.expr.NodeValue nodeSQL, org.apache.jena.sparql.expr.NodeValue querySQL, Consumer<List<List<org.apache.jena.sparql.expr.NodeValue>>> consumer) getConnection(org.apache.jena.sparql.expr.NodeValue sql) voidgetListSQL(Connection conn, org.apache.jena.sparql.expr.NodeValue querySQL, Consumer<List<List<org.apache.jena.sparql.expr.NodeValue>>> consumer) static PropertiesgetProperties(String url) The connection properties: none, the user and password are those of the JDBC URL; a MySQL connection is in UTC.Methods inherited from class fr.mines_stetienne.ci.sparql_generate.iterator.IteratorStreamFunctionBase2
execMethods inherited from class fr.mines_stetienne.ci.sparql_generate.iterator.IteratorStreamFunctionBase
build, exec, getContext
-
Field Details
-
URI
The SPARQL function URI.- See Also:
-
-
Constructor Details
-
ITER_SQL
public ITER_SQL()
-
-
Method Details
-
getProperties
The connection properties: none, the user and password are those of the JDBC URL; a MySQL connection is in UTC. -
exec
public void exec(org.apache.jena.sparql.expr.NodeValue nodeSQL, org.apache.jena.sparql.expr.NodeValue querySQL, Consumer<List<List<org.apache.jena.sparql.expr.NodeValue>>> consumer) Description copied from class:IteratorStreamFunctionBase2- Specified by:
execin classIteratorStreamFunctionBase2
-
getConnection
- Throws:
Exception
-
getListSQL
public void getListSQL(Connection conn, org.apache.jena.sparql.expr.NodeValue querySQL, Consumer<List<List<org.apache.jena.sparql.expr.NodeValue>>> consumer) -
checkBuild
public void checkBuild(org.apache.jena.sparql.expr.ExprList args) Description copied from class:IteratorStreamFunctionBase2Partially checks if the iterator function can be executed with the given arguments.- Overrides:
checkBuildin classIteratorStreamFunctionBase2- Parameters:
args- -
-