Module: RDF::AllegroGraph::Functors::SnaFunctors

Included in:
Query
Defined in:
lib/rdf/allegro_graph/functors/sna_functors.rb

Overview

This module contains AllegroGraph functor definitions that may be called when building a query. Note that these functors merely add a functor expression to a query. The actual functor will be called on the server.

See Also:

Paths Through the Graph collapse

Nearby Nodes collapse

Instance Method Details

#bidirectional_search_paths(from, to, generator, path, options = {})

This method returns an undefined value.

Search for paths between two nodes following the edges specified by generator, and using a bidirectional search strategy.

Options Hash (options):

  • :max_depth (Integer)

    Input: The maxium search depth.


70
71
72
73
# File 'lib/rdf/allegro_graph/functors/sna_functors.rb', line 70

def bidirectional_search_paths(from, to, generator, path, options={})
  search_paths('bidirectional-search-paths', from, to, generator, path,
               options)
end

#breadth_first_search_paths(from, to, generator, path, options = {})

This method returns an undefined value.

Search for paths between two nodes following the edges specified by generator, and using a breadth-first search strategy.

Options Hash (options):

  • :max_depth (Integer)

    Input: The maxium search depth.


30
31
32
33
# File 'lib/rdf/allegro_graph/functors/sna_functors.rb', line 30

def breadth_first_search_paths(from, to, generator, path, options={})
  search_paths('breadth-first-search-paths', from, to, generator, path,
               options)
end

#depth_first_search_paths(from, to, generator, path, options = {})

This method returns an undefined value.

Search for paths between two nodes following the edges specified by generator, and using a depth-first search strategy.

Options Hash (options):

  • :max_depth (Integer)

    Input: The maxium search depth.


50
51
52
53
# File 'lib/rdf/allegro_graph/functors/sna_functors.rb', line 50

def depth_first_search_paths(from, to, generator, path, options={})
  search_paths('depth-first-search-paths', from, to, generator, path,
               options)
end

#ego_group(actor, depth, generator, group)

This method returns an undefined value.

Generate an actor's ego group.


127
128
129
130
# File 'lib/rdf/allegro_graph/functors/sna_functors.rb', line 127

def ego_group(actor, depth, generator, group)
  functor('ego-group', actor, PrologLiteral.new(depth),
          generator, group)
end

#ego_group_member(actor, depth, generator, member)

This method returns an undefined value.

Generate all members of an actor's ego group.


143
144
145
146
# File 'lib/rdf/allegro_graph/functors/sna_functors.rb', line 143

def ego_group_member(actor, depth, generator, member)
  functor('ego-group-member', actor, PrologLiteral.new(depth),
          generator, member)
end

#neighbor_count(actor, generator, count) Also known as: nodal_degree

This method returns an undefined value.

Count the neighbors of the actor.


97
98
99
# File 'lib/rdf/allegro_graph/functors/sna_functors.rb', line 97

def neighbor_count(actor, generator, count)
  functor('nodal-degree', actor, generator, count)
end

#neighbors(actor, generator, neighbor) Also known as: nodal_neighbors

This method returns an undefined value.

Find all neighbors of the actor.


111
112
113
# File 'lib/rdf/allegro_graph/functors/sna_functors.rb', line 111

def neighbors(actor, generator, neighbor)
  functor('nodal-neighbors', actor, generator, neighbor)
end