Class RDFLinkSources

java.lang.Object
org.aksw.jenax.dataaccess.sparql.linksource.RDFLinkSources

public class RDFLinkSources extends Object
  • Constructor Details

    • RDFLinkSources

      public RDFLinkSources()
  • Method Details

    • of

      public static RDFLinkSource of(org.apache.jena.graph.Graph graph)
    • of

      public static RDFLinkSource of(org.apache.jena.sparql.core.DatasetGraph datasetGraph)
    • newQueryBuilder

      public static org.apache.jena.sparql.exec.QueryExecBuilder newQueryBuilder(RDFLinkSource linkSource)
      This method backs RDFLinkSource.newQuery().
    • newUpdateBuilder

      public static org.apache.jena.sparql.exec.UpdateExecBuilder newUpdateBuilder(RDFLinkSource linkSource)
      This method backs RDFLinkSource#newUpdadte().
    • wrapWithLogging

      public static RDFLinkSource wrapWithLogging(RDFLinkSource delegate)
    • decorateQueryBeforeTxnBegin

      public static RDFLinkSource decorateQueryBeforeTxnBegin(RDFLinkSource linkSource, Runnable action)
      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 wrap
      convertToSelect - Only matching queries are executed as select
      Returns:
    • execQueryViaSelect

      public static LinkSparqlQueryTransform execQueryViaSelect(Predicate<org.apache.jena.query.Query> convertToSelect)
      Create a LinkSparqlQueryTransform that intercepts construct query requests and transforms them into select query ones. The execution work is done in a QueryExecBaseSelect.
    • 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 a RdfDataSourceWrapperWithRewrite then 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 of SparqlStmtTransformViaRewrite then the rewrite is unwrapped and passed to wrapWithOpTransform(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

      public static Map<String,org.apache.jena.sparql.function.user.UserDefinedFunctionDefinition> loadMacros(String macroSource)
    • 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

      public static RDFLinkSource withLimit(RDFLinkSource linkSource, long limit)
    • withPaginate

      public static RDFLinkSource withPaginate(RDFLinkSource linkSource, long pageSize)