public class NamedGraph extends Graph implements java.lang.Cloneable
Named graphs also have a name and a group by which they can be classified as being in the focus or in the complement for the search. In addition, they possess a successor pointer, so that they can be connected into a singly linked list. Named graphs are used for storing the graph database to mine.
Modifier and Type | Field and Description |
---|---|
static int |
COMPL
group identifier: complement
|
static int |
FOCUS
group identifier: focus
|
protected int |
group
the marker for grouping (either 0 or 1, used as an array index)
|
protected java.lang.String |
name
the graph name/identifier
|
protected NamedGraph |
succ
the next graph in a list
|
protected float |
value
the value associated with the graph
|
Modifier | Constructor and Description |
---|---|
|
NamedGraph(Graph graph)
Turn a graph into a named graph.
|
|
NamedGraph(Graph graph,
java.lang.String name)
Turn a graph into a named graph.
|
|
NamedGraph(Graph graph,
java.lang.String name,
float value,
int group)
Turn a graph into a named graph.
|
protected |
NamedGraph(NamedGraph graph)
Clone a named graph.
|
|
NamedGraph(Notation ntn)
Create a graph with an empty name and value and group 0.
|
|
NamedGraph(Notation ntn,
int nodecnt,
int edgecnt,
java.lang.String name,
float value,
int group)
Create a graph with a given name, group and size.
|
|
NamedGraph(Notation ntn,
java.lang.String name)
Create a graph with value and group 0.
|
|
NamedGraph(Notation ntn,
java.lang.String name,
float value,
int group)
Create a graph of default size with a given name and group.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Create a clone of this named graph.
|
int |
getGroup()
Get the group of this graph.
|
java.lang.String |
getName()
Get the name of this graph.
|
float |
getValue()
Get the value of this graph.
|
static void |
main(java.lang.String[] args)
Main function for testing some basic functionality.
|
void |
setGroup(int group)
Set the group of this graph.
|
void |
setName(java.lang.String name)
Set the name of this graph.
|
void |
setValue(float value)
Set the value of this graph.
|
NamedGraph |
split()
Split a graph into its connected components.
|
java.lang.String |
toLogic()
Create a Prolog description of this graph.
|
addEdge, addNode, addNodeRaw, clear, contains, contains, decode, embed, embed, encode, equals, equalsCanonic, getEdge, getEdgeCount, getEdgeMgr, getEdgeType, getNode, getNodeCount, getNodeMgr, getNodeType, getNodeTypeRaw, getNotation, getRecoder, hashCode, hasOpenRings, index, isCanonic, isCanonic, isConnected, makeCanonic, makeCanonic, map, mark, markBridges, markPseudo, markRings, markRings, maskTypes, normalize, opt, prepare, prepareEmbed, toString, toString, toString, trim
public static final int FOCUS
public static final int COMPL
protected NamedGraph succ
protected java.lang.String name
protected float value
protected int group
public NamedGraph(Notation ntn)
ntn
- the notation of the graphpublic NamedGraph(Notation ntn, java.lang.String name)
ntn
- the notation of the graphname
- the name of the graphpublic NamedGraph(Notation ntn, java.lang.String name, float value, int group)
ntn
- the notation of the graphname
- the name/identifier of the graphvalue
- the associated valuegroup
- the group of the graphpublic NamedGraph(Notation ntn, int nodecnt, int edgecnt, java.lang.String name, float value, int group)
ntn
- the notation of the graphnodecnt
- the expected number of nodesedgecnt
- the expected number of edgesname
- the name/identifier of the graphvalue
- the associated valuegroup
- the group of the graphpublic NamedGraph(Graph graph)
Note that the constituents of the graph are not copied, so changes to the given graph affect the created named graph.
graph
- the graph to turn into a named graphpublic NamedGraph(Graph graph, java.lang.String name)
Note that the constituents of the graph are not copied, so changes to the given graph affect the created named graph.
graph
- the graph to turn into a named graphname
- the identifier/name of the graphpublic NamedGraph(Graph graph, java.lang.String name, float value, int group)
Note that the constituents of the graph are not copied, so changes to the given graph affect the created named graph.
graph
- the graph to turn into a named graphname
- the name/identifier of the graphvalue
- the associated valuegroup
- the group of the graphprotected NamedGraph(NamedGraph graph)
This function returns a deep copy of a named graph (all constituents of the named graph are copied). It is intended mainly for debugging purposes.
graph
- the named graph to duplicatepublic java.lang.Object clone()
This function simply returns new NamedGraph(this)
.
It is intended mainly for debugging purposes.
clone
in class Graph
NamedGraph(NamedGraph)
public void setName(java.lang.String name)
name
- the name to setpublic java.lang.String getName()
public void setValue(float value)
value
- the value to setpublic float getValue()
public void setGroup(int group)
group
- the group to setpublic int getGroup()
public NamedGraph split()
public java.lang.String toLogic()
The graph is described by a set of predicates, one per node and one per edge, which list the graph they belong to together with their indices and types.
public static void main(java.lang.String[] args)
args
- the command line arguments