Interface DataQuery<T extends org.apache.jena.rdf.model.RDFNode>

All Known Subinterfaces:
FacetedDataQuery<T>

public interface DataQuery<T extends org.apache.jena.rdf.model.RDFNode>
This object represents a query builder for exposing a correlated join between two graph-patterns based relations as partitions of rooted graph fragments. The first graph relation is referred to as the base relation. The other is the attribute extension relation (AER). The AER is initially a unit table. Query builder for retrieval batch retrieval of related *optional* information for each entity of an underlying base relation. Hence, limit and offset apply to the base relation.
Author:
raven
  • Method Details

    • pseudoRandom

      DataQuery<T> pseudoRandom(Random pseudoRandom)
    • peek

      DataQuery<T> peek(Consumer<? super DataQuery<T>> consumer)
      Pass 'this' to a given consumer that may invoke methods on this object. A typical use case is to print out the SPARQL query before execution without breaking the chain of method calls: dataQuery .limit(10) .mutate(x -> System.out.println(x.toConstructQuery()) .exec();
      Parameters:
      consumer -
      Returns:
    • get

      NodePath get(String attrName)
      Access an attribute of the result class based on the mapping between attributes and properties, such as using the @Iri annotation Only works for appropriately annotated or mapped result classes See FacetValue for an example.
      Parameters:
      attrName -
      Returns:
    • getAttr

      DataQueryVarView<T> getAttr(String attrName)
      Access an attribute of the result class based on the mapping between attributes and properties, such as using the @Iri annotation Only works for appropriately annotated or mapped result classes See FacetValue for an example.
      Parameters:
      attrName -
      Returns:
    • execConstruct

      io.reactivex.rxjava3.core.Single<org.apache.jena.rdf.model.Model> execConstruct()
    • fetchPredicates

      Fragment1 fetchPredicates()
    • getRoot

      DataNode getRoot()
    • add

      DataQuery<T> add(org.apache.jena.rdf.model.Property property)
    • addOptional

      DataQuery<T> addOptional(org.apache.jena.rdf.model.Property property)
    • filterUsing

      DataQuery<T> filterUsing(Fragment relation, String... attrNames)
    • filter

      DataQuery<T> filter(Fragment1 concept)
    • filter

      default DataQuery<T> filter(String exprStr)
    • toUnaryFiler

      static Fragment1 toUnaryFiler(org.apache.jena.sparql.expr.Expr expr)
    • filter

      DataQuery<T> filter(org.apache.jena.sparql.expr.Expr expr)
      Filtering by an unary expression (i.e. just 1 variable allowed)
      Parameters:
      expr -
      Returns:
    • filterDirect

      DataQuery<T> filterDirect(org.apache.jena.sparql.syntax.Element element)
    • dataSource

      DataQuery<T> dataSource(org.aksw.jenax.dataaccess.sparql.datasource.RDFDataSource dataSource)
    • dataSource

      org.aksw.jenax.dataaccess.sparql.datasource.RDFDataSource dataSource()
    • connection

      @Deprecated default org.apache.jena.rdfconnection.SparqlQueryConnection connection()
      Deprecated.
    • connection

      @Deprecated default DataQuery<T> connection(org.apache.jena.rdfconnection.SparqlQueryConnection connection)
      Deprecated.
    • only

      default DataQuery<T> only(Iterable<org.apache.jena.graph.Node> nodes)
    • only

      default DataQuery<T> only(org.apache.jena.graph.Node... nodes)
    • only

      default DataQuery<T> only(org.apache.jena.rdf.model.RDFNode... rdfNodes)
    • only

      default DataQuery<T> only(String... iris)
    • exclude

      default DataQuery<T> exclude(Iterable<org.apache.jena.graph.Node> nodes)
    • exclude

      default DataQuery<T> exclude(org.apache.jena.graph.Node... nodes)
    • exclude

      default DataQuery<T> exclude(org.apache.jena.rdf.model.RDFNode... rdfNodes)
    • exclude

      default DataQuery<T> exclude(String... iris)
    • limit

      DataQuery<T> limit(Long limit)
    • limit

      default DataQuery<T> limit(Integer limit)
    • offset

      DataQuery<T> offset(Long offset)
    • offset

      default DataQuery<T> offset(Integer offset)
    • sample

      DataQuery<T> sample(boolean onOrOff)
      grouped mode (false): default semantic of construct queries partition mode (true): each row is individually mapped to a resource, used for facet value counts Partition mode is there for legacy design choices and may be deprecated, going with default semantics are strongly encouraged
    • sample

      default DataQuery<T> sample()
    • isSampled

      boolean isSampled()
    • ordered

      DataQuery<T> ordered(boolean onOrOff)
    • ordered

      default DataQuery<T> ordered()
    • isOrdered

      boolean isOrdered()
    • randomOrder

      DataQuery<T> randomOrder(boolean onOrOff)
    • randomOrder

      default DataQuery<T> randomOrder()
    • isRandomOrder

      boolean isRandomOrder()
    • toConstructQueryNew

      QuerySpec toConstructQueryNew()
      Return a SPARQL construct query together with the designated root variable TODO Do we need to revise the return value to allow multiple root variables? Maybe yield a Relation instance?
      Returns:
    • getDefaultVar

      org.apache.jena.sparql.core.Var getDefaultVar()
    • getSuperRootNode

      org.apache.jena.graph.Node getSuperRootNode()
      A node of the template from which all primary key variables are reachable by paths
      Returns:
    • toConstructQuery

      @Deprecated default Map.Entry<org.apache.jena.graph.Node,org.apache.jena.query.Query> toConstructQuery()
      Deprecated.
    • baseRelation

      default Fragment baseRelation()
    • primaryKeyVars

      List<org.apache.jena.sparql.core.Var> primaryKeyVars()
    • baseElement

      org.apache.jena.sparql.syntax.Element baseElement()
    • exec

      io.reactivex.rxjava3.core.Flowable<T> exec()
    • count

      io.reactivex.rxjava3.core.Single<org.aksw.commons.util.range.CountInfo> count()
      Count the number of resources matching this data query's configuration using default request parameters. The result may yield a partial count (the count upon reaching a timeout)
      Returns:
    • count

      io.reactivex.rxjava3.core.Single<org.aksw.commons.util.range.CountInfo> count(Long distinctItemCount, Long rowCount)
    • resolver

      ResolverNode resolver()
    • addOrderBy

      DataQuery<T> addOrderBy(org.apache.jena.graph.Node node, int direction)
    • addOrderBy

      default DataQuery<T> addOrderBy(Path path, int direction)
    • nodeForPath

      org.apache.jena.graph.Node nodeForPath(Path path)
      Wrap a path object as a Node such that it can be used in conventional SPARQL expressions passed to this data query instance such as for filtering and sorting The data query implementation will substitute all paths with appropriate variables when assembling the effective sparql query in .toConstructQuery()
      Parameters:
      path -
      Returns:
    • as

      <U extends org.apache.jena.rdf.model.RDFNode> DataQuery<U> as(Class<U> clazz)