Class RDFLinkSources
java.lang.Object
org.aksw.jenax.dataaccess.sparql.linksource.RDFLinkSources
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RDFLinkSourcedecorateQueryBeforeTxnBegin(RDFLinkSource linkSource, Runnable action) Wrap a LinkSparqlQuery such that a possible write action is run when txn.begin() is invoked.static LinkSparqlQueryTransformexecQueryViaSelect(Predicate<org.apache.jena.query.Query> convertToSelect) Create aLinkSparqlQueryTransformthat intercepts construct query requests and transforms them into select query ones.static RDFLinkSourceexecQueryViaSelect(RDFLinkSource linkSource, Predicate<org.apache.jena.query.Query> convertToSelect) Wrap a data source such that matching queries are transformed to and executed as SELECT queries.loadMacros(String macroSource) static voidloadMacros(Set<String> macroProfiles, Map<String, org.apache.jena.sparql.function.user.UserDefinedFunctionDefinition> udfRegistry, String macroSource) Load macros from a given source w.r.t.static org.apache.jena.sparql.exec.QueryExecBuildernewQueryBuilder(RDFLinkSource linkSource) This method backsRDFLinkSource.newQuery().static org.apache.jena.sparql.exec.UpdateExecBuildernewUpdateBuilder(RDFLinkSource linkSource) This method backsRDFLinkSource#newUpdadte().static RDFLinkSourceof(org.apache.jena.graph.Graph graph) static RDFLinkSourceof(org.apache.jena.sparql.core.DatasetGraph datasetGraph) static RDFLinkSourcewithLimit(RDFLinkSource linkSource, long limit) static RDFLinkSourcewithPaginate(RDFLinkSource linkSource, long pageSize) static RDFLinkSourcewrapWithAutoTxn(RDFLinkSource linkSource, org.apache.jena.query.Dataset dataset) If the dataset supports transactions then return a wrapped datasource that starts transactions when none is active.static RDFLinkSourcewrapWithExprTransform(RDFLinkSource linkSource, org.apache.jena.sparql.expr.ExprTransform eform) Wrap a data source with query rewriting for macro expansion.static RDFLinkSourcewrapWithLinkSparqlQueryTransform(RDFLinkSource linkSource, LinkSparqlQueryTransform transform) static RDFLinkSourcewrapWithLinkSparqlUpdateTransform(RDFLinkSource linkSource, LinkSparqlUpdateTransform transform) static RDFLinkSourcewrapWithLinkTransform(RDFLinkSource linkSource, RDFLinkTransform transform) static RDFLinkSourcewrapWithLogging(RDFLinkSource delegate) static RDFLinkSourcewrapWithMacros(RDFLinkSource linkSource, Map<String, org.apache.jena.sparql.function.user.UserDefinedFunctionDefinition> udfRegistry) Wrap a data source with query rewriting for macro expansion.static RDFLinkSourcewrapWithOpTransform(RDFLinkSource dataSource, Supplier<org.apache.jena.sparql.algebra.Transform> transformSupplier) Wrap a datasource such that an algebra transform is applied to each statement.static RDFLinkSourcewrapWithOpTransform(RDFLinkSource dataSource, org.apache.jena.sparql.algebra.optimize.Rewrite rewrite) Returns a new data source that applies the given rewrite.static RDFLinkSourcewrapWithOpTransform(RDFLinkSource dataSource, org.apache.jena.sparql.algebra.Transform statelessTransform) Wrap a datasource such that a (stateless) algebra transform is applied to each statement.static RDFLinkSourcewrapWithQueryExecTransform(RDFLinkSource linkSource, QueryExecTransform queryExecTransform) static RDFLinkSourcewrapWithQueryTransform(RDFLinkSource linkSource, QueryTransform queryTransform) static RDFLinkSourcewrapWithStmtTransform(RDFLinkSource linkSource, org.aksw.jenax.stmt.core.SparqlStmtTransform stmtTransform) Return a new data source that applies the given statement transform.static RDFLinkSourcewrapWithUpdateTransform(RDFLinkSource linkSource, UpdateRequestTransform updateTransform)
-
Constructor Details
-
RDFLinkSources
public RDFLinkSources()
-
-
Method Details
-
of
-
of
-
newQueryBuilder
public static org.apache.jena.sparql.exec.QueryExecBuilder newQueryBuilder(RDFLinkSource linkSource) This method backsRDFLinkSource.newQuery(). -
newUpdateBuilder
public static org.apache.jena.sparql.exec.UpdateExecBuilder newUpdateBuilder(RDFLinkSource linkSource) This method backsRDFLinkSource#newUpdadte(). -
wrapWithLogging
-
decorateQueryBeforeTxnBegin
Wrap a LinkSparqlQuery such that a possible write action is run when txn.begin() is invoked. The action is run before the transaction is started. Can be used to update e.g. the spatial index before a read transaction. -
execQueryViaSelect
public static RDFLinkSource execQueryViaSelect(RDFLinkSource linkSource, Predicate<org.apache.jena.query.Query> convertToSelect) Wrap a data source such that matching queries are transformed to and executed as SELECT queries. The select query is passed on to the underlying data source, whereas the row set is post processed locally to fulfill the original request.- Parameters:
dataSource- The data source which to wrapconvertToSelect- Only matching queries are executed as select- Returns:
-
execQueryViaSelect
public static LinkSparqlQueryTransform execQueryViaSelect(Predicate<org.apache.jena.query.Query> convertToSelect) Create aLinkSparqlQueryTransformthat intercepts construct query requests and transforms them into select query ones. The execution work is done in aQueryExecBaseSelect. -
wrapWithAutoTxn
public static RDFLinkSource wrapWithAutoTxn(RDFLinkSource linkSource, org.apache.jena.query.Dataset dataset) If the dataset supports transactions then return a wrapped datasource that starts transactions when none is active. This method checks transaction support only immediately. -
wrapWithOpTransform
public static RDFLinkSource wrapWithOpTransform(RDFLinkSource dataSource, org.apache.jena.sparql.algebra.optimize.Rewrite rewrite) Returns a new data source that applies the given rewrite. In order to reduce Algebra.compile / OpAsQuery.asQuery round trips, if the base data source is already aRdfDataSourceWrapperWithRewritethen the rewrite is unwrapped and combined with the given rewrite. -
wrapWithLinkTransform
public static RDFLinkSource wrapWithLinkTransform(RDFLinkSource linkSource, RDFLinkTransform transform) -
wrapWithStmtTransform
public static RDFLinkSource wrapWithStmtTransform(RDFLinkSource linkSource, org.aksw.jenax.stmt.core.SparqlStmtTransform stmtTransform) Return a new data source that applies the given statement transform. If the given transform in an instance ofSparqlStmtTransformViaRewritethen the rewrite is unwrapped and passed towrapWithOpTransform(RDFLinkSource, Rewrite).- Parameters:
linkSource-stmtTransform-- Returns:
-
wrapWithOpTransform
public static RDFLinkSource wrapWithOpTransform(RDFLinkSource dataSource, org.apache.jena.sparql.algebra.Transform statelessTransform) Wrap a datasource such that a (stateless) algebra transform is applied to each statement. -
wrapWithLinkSparqlQueryTransform
public static RDFLinkSource wrapWithLinkSparqlQueryTransform(RDFLinkSource linkSource, LinkSparqlQueryTransform transform) -
wrapWithLinkSparqlUpdateTransform
public static RDFLinkSource wrapWithLinkSparqlUpdateTransform(RDFLinkSource linkSource, LinkSparqlUpdateTransform transform) -
wrapWithOpTransform
public static RDFLinkSource wrapWithOpTransform(RDFLinkSource dataSource, Supplier<org.apache.jena.sparql.algebra.Transform> transformSupplier) Wrap a datasource such that an algebra transform is applied to each statement. -
loadMacros
-
loadMacros
public static void loadMacros(Set<String> macroProfiles, Map<String, org.apache.jena.sparql.function.user.UserDefinedFunctionDefinition> udfRegistry, String macroSource) Load macros from a given source w.r.t. the given profiles and add them to the registry. -
wrapWithMacros
public static RDFLinkSource wrapWithMacros(RDFLinkSource linkSource, Map<String, org.apache.jena.sparql.function.user.UserDefinedFunctionDefinition> udfRegistry) Wrap a data source with query rewriting for macro expansion. -
wrapWithExprTransform
public static RDFLinkSource wrapWithExprTransform(RDFLinkSource linkSource, org.apache.jena.sparql.expr.ExprTransform eform) Wrap a data source with query rewriting for macro expansion. -
wrapWithUpdateTransform
public static RDFLinkSource wrapWithUpdateTransform(RDFLinkSource linkSource, UpdateRequestTransform updateTransform) -
wrapWithQueryTransform
public static RDFLinkSource wrapWithQueryTransform(RDFLinkSource linkSource, QueryTransform queryTransform) -
wrapWithQueryExecTransform
public static RDFLinkSource wrapWithQueryExecTransform(RDFLinkSource linkSource, QueryExecTransform queryExecTransform) -
withLimit
-
withPaginate
-