Package org.aksw.commons.util.triplet
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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TripletPath<V,E>concat(TripletPath<V,E> that)booleanequals(Object obj)VgetEnd()intgetLength()Returns the number of triplets - NOT nodesVgetNode(int i)Set<V>getNodeSet()VgetStart()List<Triplet<V,E>>getTriplets()inthashCode()booleanisCycleFree()An rdf path is cycle free, if it contains each triple at most oncestatic <V,E>
TripletPath<V,Directed<E>>makeDirected(TripletPath<V,E> path)static <V,E>
List<Triplet<V,E>>makeUndirected(List<Triplet<V,Directed<E>>> triplets)static <V,E>
TripletPath<V,E>makeUndirected(TripletPath<V,Directed<E>> path)TripletPath<V,E>reverse()TripletPath<V,E>subPath(int fromIndex, int toIndex)StringtoString()
-
-
-
Method Detail
-
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:
-
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)
-
-