slib.sglib.model.graph.utils
Interface WalkConstraint


public interface WalkConstraint

WalkConstraint interface is used to define methods commonly required to orient a walk according to some conditions. The aim is to provide a way to distinguish edges which can be traversed from a vertex. The conditions can be based on:

Author:
Sebastien Harispe

Method Summary
 boolean acceptInWalks()
          Check if the walk give access to IN edges
 boolean acceptOutWalks()
          Check if the walk give access to OUT edges
 void addAcceptedTraversal(Set<org.openrdf.model.URI> pred, Direction dir)
          Add the current Traversal in the mapping of admitted traversal.
 void addAcceptedTraversal(org.openrdf.model.URI pred, Direction dir)
          Add the current Traversal in the mapping of admitted traversal.
 void addWalkconstraints(WalkConstraint wc)
          Add to the current constraints the ones defines in the walk constraint passed in parameter.
 Set<org.openrdf.model.URI> getAcceptedPredicates()
          Access to a view of the set of predicates (edge types) the walk consider during edge evaluation.
 Set<org.openrdf.model.URI> getAcceptedWalks_DIR_BOTH()
          Intersection of getAcceptedWalks_DIR_IN() and getAcceptedWalks_DIR_OUT().
 Set<org.openrdf.model.URI> getAcceptedWalks_DIR_IN()
          Access to a view of the set of predicates which can be traversed from target to source, i.e.
 Set<org.openrdf.model.URI> getAcceptedWalks_DIR_OUT()
          Access to a view of the set of predicates which can be traversed from source to target i.e.
 Direction getAssociatedDirection(org.openrdf.model.URI uri)
          Return the direction associated to the given predicate the object admits
 boolean respectConstaints(E e, Direction dir)
          The method defines the behavior of a walk reaching the given edge.
 

Method Detail

respectConstaints

boolean respectConstaints(E e,
                          Direction dir)
The method defines the behavior of a walk reaching the given edge. Return true if the walk must continues (false if the walk must stop).

Parameters:
e - the vertex to evaluates
dir - the direction of the edge
Returns:
a boolean value defining if the walk must continue (true:yes, false:no)

getAcceptedPredicates

Set<org.openrdf.model.URI> getAcceptedPredicates()
Access to a view of the set of predicates (edge types) the walk consider during edge evaluation. Note that during the walk the constraints are defined by sets of tuples {URI, Direction}, thus in some cases the walk constraint doesn't admit all edges of the type returned by this method.

Returns:
a view of the set of URIs corresponding to the predicates accepted by the constraint

getAssociatedDirection

Direction getAssociatedDirection(org.openrdf.model.URI uri)
Return the direction associated to the given predicate the object admits

Parameters:
uri - the URI of the predicate of interest
Returns:
a direction IN, OUT, BOTH, null if the evaluated predicate is not registered by the object

addWalkconstraints

void addWalkconstraints(WalkConstraint wc)
Add to the current constraints the ones defines in the walk constraint passed in parameter.

Parameters:
wc - the walk constraint

addAcceptedTraversal

void addAcceptedTraversal(org.openrdf.model.URI pred,
                          Direction dir)
Add the current Traversal in the mapping of admitted traversal.

Parameters:
pred - the predicate URI (not null).
dir - the accepted direction corresponding to the given predicate (not null).

addAcceptedTraversal

void addAcceptedTraversal(Set<org.openrdf.model.URI> pred,
                          Direction dir)
Add the current Traversal in the mapping of admitted traversal.

Parameters:
pred - the predicate URI (not null).
dir - the accepted direction corresponding to the given predicate (not null).

getAcceptedWalks_DIR_IN

Set<org.openrdf.model.URI> getAcceptedWalks_DIR_IN()
Access to a view of the set of predicates which can be traversed from target to source, i.e. in the opposite direction. Return the set of URI corresponding to the valid predicates

Returns:
the set of URIs which are accepted considering the direction IN

getAcceptedWalks_DIR_OUT

Set<org.openrdf.model.URI> getAcceptedWalks_DIR_OUT()
Access to a view of the set of predicates which can be traversed from source to target i.e. in the original direction.

Returns:
the set of URIs which are accepted considering the direction OUT

getAcceptedWalks_DIR_BOTH

Set<org.openrdf.model.URI> getAcceptedWalks_DIR_BOTH()
Intersection of getAcceptedWalks_DIR_IN() and getAcceptedWalks_DIR_OUT(). Return the set of URIs corresponding to the valid predicates

Returns:
the set of URIs which are accepted considering the directions IN and OUT

acceptOutWalks

boolean acceptOutWalks()
Check if the walk give access to OUT edges

Returns:
true if the constraints accept walks to OUT edges

acceptInWalks

boolean acceptInWalks()
Check if the walk give access to IN edges

Returns:
true if the constraints accept walks to IN edges


Copyright © 2013. All Rights Reserved.