Class Edge

java.lang.Object
dev.roanh.gmark.core.graph.Edge

public class Edge extends Object
Represents a single edge in the graph schema. A graph schema edge also store information about the overall presence of all its edges in a concrete graph instance. This is done using degrees distributions on the in and out degree of the nodes the edges are connected to.
See Also:
  • Field Details

    • source

      private Type source
      The type of the source node for this edge.
    • target

      private Type target
      The type of the target node for this edge.
    • symbol

      private Predicate symbol
      The predicate, symbol or label on this edge.
    • inDistribution

      private Distribution inDistribution
      The in distribution of nodes this edge starts from. This distribution models the degree of nodes concrete edge instances start from in a graph.
    • outDistribution

      private Distribution outDistribution
      The out distribution of nodes this edge ends at. This distribution models the degree of nodes concrete edge instances end at in a graph.
  • Constructor Details

    • Edge

      public Edge(Type source, Type target, Predicate symbol, Distribution in, Distribution out)
      Constructs a new edge with the given source type, target type, predicate, in degree distribution and out degree distribution.
      Parameters:
      source - The source type.
      target - The target type.
      symbol - The edge predicate.
      in - The edge in distribution.
      out - The edge out distribution.
  • Method Details

    • getInDistribution

      public Distribution getInDistribution()
      Gets the in distribution of nodes this edge starts from. This distribution models the degree of nodes concrete edge instances start from in a graph.
      Returns:
      The in distribution of this edge.
    • getOutDistribution

      public Distribution getOutDistribution()
      Gets the out distribution of nodes this edge ends at. This distribution models the degree of nodes concrete edge instances end at in a graph.
      Returns:
      The out distribution of this edge.
    • getSourceType

      public Type getSourceType()
      Gets the type of source (subject) nodes for this edge.
      Returns:
      The source type for this edge.
    • getTargetType

      public Type getTargetType()
      Gets the type of target (object) nodes for this edge
      Returns:
      The target type for this edge.
    • getPredicate

      public Predicate getPredicate()
      Gets the predicate (symbol) for this edge.
      Returns:
      The predicate for this edge.
    • getSelectivity

      public SelectivityClass getSelectivity()
      Computes the selectivity class of this edge based on whether or not the end points types of this edge are scalable or not and depending on the in and out distribution of this edge.
      Returns:
      The selectivity class of this edge.
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object