Interface TupleTableCore<T,X>

Type Parameters:
T - The type of the tuples to hold
All Superinterfaces:
TupleQuerySupport<T,X>

public interface TupleTableCore<T,X> extends TupleQuerySupport<T,X>
Base interface for tuples i.e. triples and quads. Evolving. Deliberately analogous to TupleTable to enable potential future consolidation
Author:
Claus Stadler 11/09/2020
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(T tuple)
     
    static org.apache.jena.graph.Node
    anyToNull(org.apache.jena.graph.Node n)
     
    void
    Clear all entries Optional operation.
    boolean
    contains(T tuple)
     
    void
    delete(T tuple)
     
    default ResultStreamer<T,X,org.apache.jena.atlas.lib.tuple.Tuple<X>>
    find(TupleQuery<X> tupleQuery)
    Method for running tuple queries
     
    <D> Stream<T>
    findTuples(D domainTyple, org.aksw.commons.tuple.accessor.TupleAccessor<? super D,? extends X> accessor)
     
    default Stream<T>
    findTuples(List<X> pattern)
    The basic find method that yields all tuples whose components equal the corresponding non-null components in pattern.
    default int
    The number of components / columns
    org.aksw.commons.tuple.bridge.TupleBridge<T,X>
     
    static org.apache.jena.graph.Node
    nullToAny(org.apache.jena.graph.Node n)
     
    default long
    The number of tuples in the table.
  • Method Details

    • clear

      void clear()
      Clear all entries Optional operation. May fail with UnsupportedOperationException for e.g. views.
    • add

      void add(T tuple)
    • delete

      void delete(T tuple)
    • contains

      boolean contains(T tuple)
    • findTuples

      default Stream<T> findTuples(List<X> pattern)
      The basic find method that yields all tuples whose components equal the corresponding non-null components in pattern. Be aware that the contract for this method is that only null values in the pattern correspond to 'match any' Specifically, don't use Node.ANY here or it may result in an attempt to match tuples with this value exactly. On the tuple-level we don't know or care about such domain conventions.
      Parameters:
      tupleTypes -
      Returns:
    • findTuples

      <D> Stream<T> findTuples(D domainTyple, org.aksw.commons.tuple.accessor.TupleAccessor<? super D,? extends X> accessor)
    • findTuples

      Stream<T> findTuples()
    • find

      default ResultStreamer<T,X,org.apache.jena.atlas.lib.tuple.Tuple<X>> find(TupleQuery<X> tupleQuery)
      Description copied from interface: TupleQuerySupport
      Method for running tuple queries
      Specified by:
      find in interface TupleQuerySupport<T,X>
      Returns:
    • size

      default long size()
      The number of tuples in the table. If not indexed then this value is used as the estimate of lookups Therefore the size should be cached
      Returns:
    • getDimension

      default int getDimension()
      The number of components / columns
      Returns:
    • getTupleAccessor

      org.aksw.commons.tuple.bridge.TupleBridge<T,X> getTupleAccessor()
    • nullToAny

      static org.apache.jena.graph.Node nullToAny(org.apache.jena.graph.Node n)
    • anyToNull

      static org.apache.jena.graph.Node anyToNull(org.apache.jena.graph.Node n)