Class TripletPath<V,E>

java.lang.Object
org.aksw.commons.util.triplet.TripletPath<V,E>
Type Parameters:
V -
E -

public class TripletPath<V,E> extends Object
A path from triplets. A path is expected to be connected, hence for any consecutive triplets either of a triplet's subject or object matches either of its successor.
Author:
raven
  • Field Details

    • start

      protected V start
    • end

      protected V end
    • triplets

      protected List<Triplet<V,E>> triplets
  • Constructor Details

    • TripletPath

      public TripletPath(V start, V end, List<Triplet<V,E>> triples)
  • Method Details

    • getNodeSet

      public Set<V> getNodeSet()
    • getNode

      public V getNode(int i)
    • isCycleFree

      public boolean isCycleFree()
      An rdf path is cycle free, if it contains each triple at most once
      Returns:
    • subPath

      public TripletPath<V,E> subPath(int fromIndex, int toIndex)
    • getStart

      public V getStart()
    • getEnd

      public V getEnd()
    • getLength

      public int getLength()
      Returns the number of triplets - NOT nodes
      Returns:
    • getTriplets

      public List<Triplet<V,E>> getTriplets()
    • makeUndirected

      public static <V, E> List<Triplet<V,E>> makeUndirected(List<Triplet<V,Directed<E>>> triplets)
    • makeUndirected

      public static <V, E> TripletPath<V,E> makeUndirected(TripletPath<V,Directed<E>> path)
    • makeDirected

      public static <V, E> TripletPath<V,Directed<E>> makeDirected(TripletPath<V,E> path)
    • reverse

      public TripletPath<V,E> reverse()
    • concat

      public TripletPath<V,E> concat(TripletPath<V,E> that)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object