|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.franz.ag.SNAExtension
This class implements Social Network Analysis tools.
An AllegroGraph triple store can be used to store a social network, The methods in this class implement search operations on this social network.
This class is instantiated from an AllegroGraph instance with a call to
AllegroGraph.getSNAExtension()
.
Method Summary | |
UPI[][] |
allBidirectionalSearchPaths(java.lang.Object start,
java.lang.Object end,
java.lang.String generator,
int depth)
Find all paths using bidirectional search. |
UPI[][] |
allBreadthFirstSearchPaths(java.lang.Object start,
java.lang.Object end,
java.lang.String generator,
int depth)
Search the triple store in breadth first fashion starting at start and looking for end, using generator to expand the search space. |
UPI[][] |
allDepthFirstSearchPaths(java.lang.Object start,
java.lang.Object end,
java.lang.String generator,
int depth)
Search the triple store in depth first fashion starting at start and looking for end, using generator to expand the search space. |
UPI[] |
bidirectionalSearch(java.lang.Object start,
java.lang.Object end,
java.lang.String generator,
int depth)
Find one path using bidirectional search. |
UPI[] |
breadthFirstSearch(java.lang.Object start,
java.lang.Object end,
java.lang.String generator,
int depth)
Search the triple store in breadth first fashion starting at start and looking for end, using generator to expand the search space. |
void |
copyGeneratorsFrom(SNAExtension from)
Copy the generatores defined in another SNAExtension instance. |
UPI[] |
depthFirstSearch(java.lang.Object start,
java.lang.Object end,
java.lang.String generator,
int depth)
Search the triple store in depth first fashion starting at start and looking for end, using generator to expand the search space. |
double |
getBetweennessCentrality(java.lang.Object actor,
java.lang.Object group,
java.lang.String generator)
Determine the betweenness centrality of an actor or group. |
UPI[][] |
getCliques(java.lang.Object node,
java.lang.String generator,
int minSize)
Find all the cliques of which node is a member |
double |
getClosenessCentrality(java.lang.Object actor,
java.lang.Object group,
java.lang.String generator)
Determine the closeness centrality of an actor or group. |
double |
getDegreeCentrality(java.lang.Object actor,
java.lang.Object group,
java.lang.String generator)
Determine the centrality of an actor or group. |
double |
getDensity(java.lang.Object subgraph,
java.lang.String generator)
Determine the density of a subgraph. |
UPI[] |
getEgoGroup(java.lang.Object node,
java.lang.String generator,
int depth)
Find the ego group of a node. |
long |
getNodalDegree(java.lang.Object node,
java.lang.String generator)
Find the number of nodes connected to a given node. |
UPI[] |
getNodalNeighbors(java.lang.Object node,
java.lang.String generator)
Find the nodes connected to a given node. |
boolean |
isClique(java.lang.Object subgraph,
java.lang.String generator)
Determine if a subgraph represents a clique. |
void |
mapBidirectionalSearch(java.lang.Object start,
java.lang.Object end,
java.lang.String generator,
java.lang.String fn,
int depth)
Search for paths using bidirectional search and apply a server function to each. |
void |
mapBidirectionalSearchPathsBipartite(java.lang.Object start,
java.lang.Object end,
java.lang.String generator1,
java.lang.String generator2,
java.lang.String fn,
int depth)
Bipartitie bidirectional first search. |
void |
mapBreadthFirstSearch(java.lang.Object start,
java.lang.Object end,
java.lang.String generator,
java.lang.String fn,
int depth)
Search the triple store in breadth first fashion starting at start and looking for end, using generator to expand the search space, and apply a server function to each path that is found. |
void |
mapBreadthFirstSearchPathsBipartite(java.lang.Object start,
java.lang.Object end,
java.lang.String generator1,
java.lang.String generator2,
java.lang.String fn,
int depth)
Bipartitie breadth first search. |
void |
mapCliques(java.lang.Object node,
java.lang.String generator,
java.lang.String fn,
int minSize)
Apply a server function to each clique found. |
void |
mapDepthFirstSearch(java.lang.Object start,
java.lang.Object end,
java.lang.String generator,
java.lang.String fn,
int depth)
Search the triple store in depth first fashion starting at start and looking for end, using generator to expand the search space, and apply a server function to each path that is found. |
void |
mapDepthFirstSearchPathsBipartite(java.lang.Object start,
java.lang.Object end,
java.lang.String generator1,
java.lang.String generator2,
java.lang.String fn,
int depth)
Bipartitie depth first search. |
void |
registerGenerator(java.lang.String name,
java.lang.Object[] parts)
Register a generatore in the AllegroGraph server. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void copyGeneratorsFrom(SNAExtension from) throws AllegroGraphException
from
- the SNAExtension from which the generators are copied
AllegroGraphException
public void registerGenerator(java.lang.String name, java.lang.Object[] parts) throws AllegroGraphException
name
- the name of the generator. If the name matches a previously defined
generator in this instance, the older definition is overwritten.parts
- an Object array that defines the generator.
A generator clause specifies a set of neighbors that can be reached from a given node. The result of the generator is the union of the nodes from all the clauses.
registerGenerator("involved-with", new Object[]{ "objects-of", "!ex:kisses", "!ex:intimateWith" });
AllegroGraph.select(String)
. The query
must specify a single result variable; this variable defines the result set
of the generator clause. The pseudo-variable "node" denotes the origin node
of the search.
registerGenerator("in-movie-with", new Object[]{ "select", "(?x) (q ?x !franz:stars node)" });
Additional elements in the clause specify a prolog variable and a value. To specify a predicate obtained from the application:
registerGenerator("in-movie-with", new Object[]{ "select", "(?x) (q ?x ?pred node)", "?pred", v });
AllegroGraphException
public UPI[] breadthFirstSearch(java.lang.Object start, java.lang.Object end, java.lang.String generator, int depth) throws AllegroGraphException
start
- a string, Value instance or UPI instance that identifies the start
node of the search.end
- a string, Value instance or UPI instance that identifies the end
node of the search.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
depth
- an integer that limits the maximum depth of the search.
A zero or negative value specifies an unrestricted search.
In large graphs, this can be very expensive.
AllegroGraphException
public void mapBreadthFirstSearch(java.lang.Object start, java.lang.Object end, java.lang.String generator, java.lang.String fn, int depth) throws AllegroGraphException
start
- a string, Value instance or UPI instance that identifies the start
node of the search.end
- a string, Value instance or UPI instance that identifies the end
node of the search.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
fn
- a string that specifies a function in the server.depth
- an integer that limits the maximum depth of the search.
A zero or negative value specifies an unrestricted search.
In large graphs, this can be very expensive.
AllegroGraphException
public UPI[][] allBreadthFirstSearchPaths(java.lang.Object start, java.lang.Object end, java.lang.String generator, int depth) throws AllegroGraphException
start
- a string, Value instance or UPI instance that identifies the start
node of the search.end
- a string, Value instance or UPI instance that identifies the end
node of the search.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
depth
- an integer that limits the maximum depth of the search.
A zero or negative value specifies an unrestricted search.
In large graphs, this can be very expensive.
AllegroGraphException
public UPI[] depthFirstSearch(java.lang.Object start, java.lang.Object end, java.lang.String generator, int depth) throws AllegroGraphException
start
- a string, Value instance or UPI instance that identifies the start
node of the search.end
- a string, Value instance or UPI instance that identifies the end
node of the search.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
depth
- an integer that limits the maximum depth of the search.
A zero or negative value specifies an unrestricted search.
In large graphs, this can be very expensive.
AllegroGraphException
public void mapDepthFirstSearch(java.lang.Object start, java.lang.Object end, java.lang.String generator, java.lang.String fn, int depth) throws AllegroGraphException
start
- a string, Value instance or UPI instance that identifies the start
node of the search.end
- a string, Value instance or UPI instance that identifies the end
node of the search.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
fn
- a string that specifies a function in the server.depth
- an integer that limits the maximum depth of the search.
A zero or negative value specifies an unrestricted search.
In large graphs, this can be very expensive.
AllegroGraphException
public UPI[][] allDepthFirstSearchPaths(java.lang.Object start, java.lang.Object end, java.lang.String generator, int depth) throws AllegroGraphException
start
- a string, Value instance or UPI instance that identifies the start
node of the search.end
- a string, Value instance or UPI instance that identifies the end
node of the search.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
depth
- an integer that limits the maximum depth of the search.
A zero or negative value specifies an unrestricted search.
In large graphs, this can be very expensive.
AllegroGraphException
public UPI[] bidirectionalSearch(java.lang.Object start, java.lang.Object end, java.lang.String generator, int depth) throws AllegroGraphException
start
- a string, Value instance or UPI instance that identifies the start
node of the search.end
- a string, Value instance or UPI instance that identifies the end
node of the search.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
depth
- an integer that limits the maximum depth of the search.
A zero or negative value specifies an unrestricted search.
In large graphs, this can be very expensive.
AllegroGraphException
public void mapBidirectionalSearch(java.lang.Object start, java.lang.Object end, java.lang.String generator, java.lang.String fn, int depth) throws AllegroGraphException
start
- a string, Value instance or UPI instance that identifies the start
node of the search.end
- a string, Value instance or UPI instance that identifies the end
node of the search.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
fn
- a string that names a suitable server function.depth
- an integer that limits the maximum depth of the search.
A zero or negative value specifies an unrestricted search.
In large graphs, this can be very expensive.
AllegroGraphException
public UPI[][] allBidirectionalSearchPaths(java.lang.Object start, java.lang.Object end, java.lang.String generator, int depth) throws AllegroGraphException
start
- a string, Value instance or UPI instance that identifies the start
node of the search.end
- a string, Value instance or UPI instance that identifies the end
node of the search.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
depth
- an integer that limits the maximum depth of the search.
A zero or negative value specifies an unrestricted search.
In large graphs, this can be very expensive.
AllegroGraphException
public void mapBreadthFirstSearchPathsBipartite(java.lang.Object start, java.lang.Object end, java.lang.String generator1, java.lang.String generator2, java.lang.String fn, int depth) throws AllegroGraphException
start
- a string, Value instance or UPI instance that identifies the start
node of the search.end
- a string, Value instance or UPI instance that identifies the end
node of the search.generator1
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
generator2
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
fn
- a string that names a suitable server function.depth
- an integer that limits the maximum depth of the search.
A zero or negative value specifies an unrestricted search.
AllegroGraphException
public void mapDepthFirstSearchPathsBipartite(java.lang.Object start, java.lang.Object end, java.lang.String generator1, java.lang.String generator2, java.lang.String fn, int depth) throws AllegroGraphException
start
- a string, Value instance or UPI instance that identifies the start
node of the search.end
- a string, Value instance or UPI instance that identifies the end
node of the search.generator1
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
generator2
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
fn
- a string that names a suitable server function.depth
- an integer that limits the maximum depth of the search.
A zero or negative value specifies an unrestricted search.
AllegroGraphException
public void mapBidirectionalSearchPathsBipartite(java.lang.Object start, java.lang.Object end, java.lang.String generator1, java.lang.String generator2, java.lang.String fn, int depth) throws AllegroGraphException
start
- a string, Value instance or UPI instance that identifies the start
node of the search.end
- a string, Value instance or UPI instance that identifies the end
node of the search.generator1
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
generator2
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
fn
- a string that names a suitable server function.depth
- an integer that limits the maximum depth of the search.
A zero or negative value specifies an unrestricted search.
AllegroGraphException
public UPI[] getNodalNeighbors(java.lang.Object node, java.lang.String generator) throws AllegroGraphException
node
- a string, Value instance or UPI instance that identifies a node in the graph.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
AllegroGraphException
public long getNodalDegree(java.lang.Object node, java.lang.String generator) throws AllegroGraphException
node
- a string, Value instance or UPI instance that identifies a node in the graph.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
AllegroGraphException
public UPI[] getEgoGroup(java.lang.Object node, java.lang.String generator, int depth) throws AllegroGraphException
node
- a string, Value instance or UPI instance that identifies a node in the graph.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
depth
- an integer that limits the maximum depth of the search.
A zero or negative value specifies an unrestricted search.
AllegroGraphException
public double getDensity(java.lang.Object subgraph, java.lang.String generator) throws AllegroGraphException
subgraph
- a string, Value instance or UPI instance, or an array of these.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
AllegroGraphException
public double getDegreeCentrality(java.lang.Object actor, java.lang.Object group, java.lang.String generator) throws AllegroGraphException
actor
- If this argument is null, determine the group centrality.
Otherwise, this argument is a string, Value instance or UPI instance
that identifies a node in the graph.group
- a string, Value instance or UPI instance, or an array of these.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
AllegroGraphException
public double getClosenessCentrality(java.lang.Object actor, java.lang.Object group, java.lang.String generator) throws AllegroGraphException
actor
- If this argument is null, determine the group centrality.
Otherwise, this argument is a string, Value instance or UPI instance
that identifies a node in the graph.group
- a string, Value instance or UPI instance, or an array of these.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
AllegroGraphException
public double getBetweennessCentrality(java.lang.Object actor, java.lang.Object group, java.lang.String generator) throws AllegroGraphException
The actor-betweenness-centrality of actor i is computed by counting the number of shortest paths between all pairs of actors (not including i) that pass through actor i. The assumption being that this is the chance that actor i can control the interaction between j and k.
actor
- If this argument is null, determine the group centrality.
Otherwise, this argument is a string, Value instance or UPI instance
that identifies a node in the graph.group
- a string, Value instance or UPI instance, or an array of these.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
AllegroGraphException
public boolean isClique(java.lang.Object subgraph, java.lang.String generator) throws AllegroGraphException
subgraph
- a string, Value instance or UPI instance, or an array of these.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
AllegroGraphException
public UPI[][] getCliques(java.lang.Object node, java.lang.String generator, int minSize) throws AllegroGraphException
node
- a string, Value instance or UPI instance that identifies a node in the graph.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
minSize
- an integer that specifies the minimum size of each clique.
A zero or negative value specifies an unlimited size.
AllegroGraphException
public void mapCliques(java.lang.Object node, java.lang.String generator, java.lang.String fn, int minSize) throws AllegroGraphException
node
- a string, Value instance or UPI instance that identifies a node in the graph.generator
- a string that specifies a generatore defined previously
with registerGenerator(String, Object[])
fn
- a string that names a suitable server function.minSize
- an integer that specifies the minimum size of each clique.
A zero or negative value specifies an unlimited size.
AllegroGraphException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |