Class MatchRDFSReduced<D,C>

java.lang.Object
org.aksw.commons.tuple.finder.TupleFinderWrapper<D,C,B>
org.aksw.commons.tuple.finder.TupleFinder3Wrapper<D,C,org.aksw.commons.tuple.finder.TupleFinder3<D,C>>
org.aksw.jenax.arq.util.tuple.impl.MatchRDFSReduced<D,C>
All Implemented Interfaces:
org.aksw.commons.tuple.finder.TupleFinder<D,C>, org.aksw.commons.tuple.finder.TupleFinder3<D,C>

public class MatchRDFSReduced<D,C> extends org.aksw.commons.tuple.finder.TupleFinder3Wrapper<D,C,org.aksw.commons.tuple.finder.TupleFinder3<D,C>>
RDFS stream reasoner engine that builds upon Jena's MatchRDFS but handles the X_ANY_ANY and ANY_ANY_ANY cases differently in order to produce fewer duplicates.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Bridge between TupleFinder and MatchRDF - this class inherits both
    class 
     
    class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.aksw.commons.tuple.finder.TupleFinder3<D,C>
    The non-inferencing backend.
    protected org.apache.jena.rdfs.engine.CxtInf<C,D>
     

    Fields inherited from class org.aksw.commons.tuple.finder.TupleFinderWrapper

    base
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    MatchRDFSReduced(org.aksw.commons.tuple.finder.TupleFinder3<D,C> matchRDFS, org.aksw.commons.tuple.finder.TupleFinder3<D,C> backend, org.apache.jena.rdfs.engine.CxtInf<C,D> cxtInf)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> Set<T>
    addAndGetNew(Set<T> acc, Set<T> base, Set<T> additions)
    Add every item in 'additions' that is not in 'base' both to 'base' and 'acc'.
    static <T> Set<T>
    addAndGetNew(Set<T> acc, Set<T> base, T addition)
     
    static <D, C> org.aksw.commons.tuple.finder.TupleFinder3<D,C>
    create(org.apache.jena.rdfs.setup.ConfigRDFS<C> setup, org.apache.jena.rdfs.engine.MapperX<C,D> mapper, org.aksw.commons.tuple.finder.TupleFinder3<D,C> backend)
     
    find(C s, C p, C o)
     
    static <D, C> Set<C>
    getPredicates(org.aksw.commons.tuple.finder.TupleFinder3<D,C> backend, C s, boolean isForward, C any, long enumerationThreshold, Set<C> enumeration)
    Generic method to get a listing of a resource's predicates w.r.t.
    protected boolean
    isAny(C c)
     
    protected boolean
    isTerm(C c)
     

    Methods inherited from class org.aksw.commons.tuple.finder.TupleFinder3Wrapper

    getTupleBridge

    Methods inherited from class org.aksw.commons.tuple.finder.TupleFinderWrapper

    getBase

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.aksw.commons.tuple.finder.TupleFinder

    contains, contains, find, find

    Methods inherited from interface org.aksw.commons.tuple.finder.TupleFinder3

    contains, find, getDimension
  • Field Details

    • cxtInf

      protected org.apache.jena.rdfs.engine.CxtInf<C,D> cxtInf
    • backend

      protected org.aksw.commons.tuple.finder.TupleFinder3<D,C> backend
      The non-inferencing backend. Should be the base's base. Note that the delegate of this wrapper backs the backend with RDFS inferences.
  • Constructor Details

    • MatchRDFSReduced

      protected MatchRDFSReduced(org.aksw.commons.tuple.finder.TupleFinder3<D,C> matchRDFS, org.aksw.commons.tuple.finder.TupleFinder3<D,C> backend, org.apache.jena.rdfs.engine.CxtInf<C,D> cxtInf)
  • Method Details

    • create

      public static <D, C> org.aksw.commons.tuple.finder.TupleFinder3<D,C> create(org.apache.jena.rdfs.setup.ConfigRDFS<C> setup, org.apache.jena.rdfs.engine.MapperX<C,D> mapper, org.aksw.commons.tuple.finder.TupleFinder3<D,C> backend)
    • isTerm

      protected boolean isTerm(C c)
    • isAny

      protected boolean isAny(C c)
    • find

      public Stream<D> find(C s, C p, C o)
    • addAndGetNew

      public static <T> Set<T> addAndGetNew(Set<T> acc, Set<T> base, T addition)
    • addAndGetNew

      public static <T> Set<T> addAndGetNew(Set<T> acc, Set<T> base, Set<T> additions)
      Add every item in 'additions' that is not in 'base' both to 'base' and 'acc'. If there is a change and 'acc' is null then a fresh linked hash set is allocated. Returns the latest state of 'acc'.
    • getPredicates

      public static <D, C> Set<C> getPredicates(org.aksw.commons.tuple.finder.TupleFinder3<D,C> backend, C s, boolean isForward, C any, long enumerationThreshold, Set<C> enumeration)
      Generic method to get a listing of a resource's predicates w.r.t. a given set of relevant predicates. Starts off with iterating the resource's triples (in or out). Once more then 'threshold' triples are seen that way, the presence of the remaining predicates in 'enumeration' is checked directly with contains checks.