Class NamedGraph
- All Implemented Interfaces:
Serializable
,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.
- Since:
- 2002.03.11/2006.10.23
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
group identifier: complementstatic final int
group identifier: focusprotected int
the marker for grouping (either 0 or 1, used as an array index)protected String
the graph name/identifierprotected NamedGraph
the next graph in a listprotected float
the value associated with the graph -
Constructor Summary
ConstructorsModifierConstructorDescriptionNamedGraph
(Graph graph) Turn a graph into a named graph.NamedGraph
(Graph graph, String name) Turn a graph into a named graph.NamedGraph
(Graph graph, 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, String name, float value, int group) Create a graph with a given name, group and size.NamedGraph
(Notation ntn, int nodecnt, int edgecnt, String name, float value, int group, boolean dir) Create a graph with a given name, group and size.NamedGraph
(Notation ntn, String name) Create a graph with value and group 0.NamedGraph
(Notation ntn, String name, boolean dir) Create a graph with value and group 0.NamedGraph
(Notation ntn, String name, float value, int group) Create a graph of default size with a given name and group.NamedGraph
(Notation ntn, String name, float value, int group, boolean dir) Create a graph of default size with a given name and group. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Create a clone of this named graph.int
getGroup()
Get the group of this graph.getName()
Get the name of this graph.float
getValue()
Get the value of this graph.static void
Main function for testing some basic functionality.void
setGroup
(int group) Set the group of this graph.void
Set the name of this graph.void
setValue
(float value) Set the value of this graph.split()
Split a graph into its connected components.toLogic()
Create a Prolog description of this graph.Methods inherited from class moss.Graph
addEdge, addNode, addNodeRaw, clear, contains, contains, decode, embed, embed, encode, equals, equalsCanonic, getEdge, getEdgeCount, getEdgeMark, getEdgeMgr, getEdgeName, getEdgeType, getNode, getNodeCount, getNodeMark, getNodeMgr, getNodeName, getNodeType, getNodeTypeRaw, getNotation, getRecoder, hashCode, hasOpenRings, index, isCanonic, isCanonic, isConnected, makeCanonic, makeCanonic, map, mark, markBridges, markEmbed, markPseudo, markRings, markRings, maskTypes, normalize, opt, prepare, prepareEmbed, simple, toString, toString, toString, trim
-
Field Details
-
FOCUS
public static final int FOCUSgroup identifier: focus- See Also:
-
COMPL
public static final int COMPLgroup identifier: complement- See Also:
-
succ
the next graph in a list -
name
the graph name/identifier -
value
protected float valuethe value associated with the graph -
group
protected int groupthe marker for grouping (either 0 or 1, used as an array index)
-
-
Constructor Details
-
NamedGraph
Create a graph with an empty name and value and group 0.- Parameters:
ntn
- the notation of the graph- Since:
- 2006.10.23 (Christian Borgelt)
-
NamedGraph
Create a graph with value and group 0.- Parameters:
ntn
- the notation of the graphname
- the name of the graph- Since:
- 2007.02.15 (Christian Borgelt)
-
NamedGraph
Create a graph with value and group 0.- Parameters:
ntn
- the notation of the graphname
- the name of the graphdir
- whether the graph is directed- Since:
- 2022.09.27 (Christian Borgelt)
-
NamedGraph
Create a graph of default size with a given name and group.- Parameters:
ntn
- the notation of the graphname
- the name/identifier of the graphvalue
- the associated valuegroup
- the group of the graph- Since:
- 2006.10.23 (Christian Borgelt)
-
NamedGraph
Create a graph of default size with a given name and group.- Parameters:
ntn
- the notation of the graphname
- the name/identifier of the graphvalue
- the associated valuegroup
- the group of the graphdir
- whether the graph is directed- Since:
- 2006.10.23 (Christian Borgelt)
-
NamedGraph
Create a graph with a given name, group and size.- Parameters:
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 graph- Since:
- 2006.10.23 (Christian Borgelt)
-
NamedGraph
public NamedGraph(Notation ntn, int nodecnt, int edgecnt, String name, float value, int group, boolean dir) Create a graph with a given name, group and size.- Parameters:
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 graphdir
- whether the graph is directed- Since:
- 2022.09.27 (Christian Borgelt)
-
NamedGraph
Turn a graph into a named graph.Note that the constituents of the graph are not copied, so changes to the given graph affect the created named graph.
- Parameters:
graph
- the graph to turn into a named graph- Since:
- 2007.06.23 (Christian Borgelt)
-
NamedGraph
Turn a graph into a named graph.Note that the constituents of the graph are not copied, so changes to the given graph affect the created named graph.
- Parameters:
graph
- the graph to turn into a named graphname
- the identifier/name of the graph- Since:
- 2007.06.23 (Christian Borgelt)
-
NamedGraph
Turn a graph into a named graph.Note that the constituents of the graph are not copied, so changes to the given graph affect the created named graph.
- Parameters:
graph
- the graph to turn into a named graphname
- the name/identifier of the graphvalue
- the associated valuegroup
- the group of the graph- Since:
- 2007.06.23 (Christian Borgelt)
-
NamedGraph
Clone a named 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.
- Parameters:
graph
- the named graph to duplicate- Since:
- 2006.10.23 (Christian Borgelt)
-
-
Method Details
-
clone
Create a clone of this named graph.This function simply returns
new NamedGraph(this)
. It is intended mainly for debugging purposes. -
setName
Set the name of this graph.- Parameters:
name
- the name to set- Since:
- 2006.10.23 (Christian Borgelt)
-
getName
Get the name of this graph.- Returns:
- the name of this graph
- Since:
- 2006.10.23 (Christian Borgelt)
-
setValue
public void setValue(float value) Set the value of this graph.- Parameters:
value
- the value to set- Since:
- 2007.02.15 (Christian Borgelt)
-
getValue
public float getValue()Get the value of this graph.- Returns:
- the value of this graph
- Since:
- 2007.02.15 (Christian Borgelt)
-
setGroup
public void setGroup(int group) Set the group of this graph.- Parameters:
group
- the group to set- Since:
- 2006.10.23 (Christian Borgelt)
-
getGroup
public int getGroup()Get the group of this graph.- Returns:
- the group of this graph
- Since:
- 2006.10.23 (Christian Borgelt)
-
split
Split a graph into its connected components.- Returns:
- a list of graphs representing the connected components or the graph itself if there is only one component
- Since:
- 2007.06.14 (Christian Borgelt)
-
toLogic
Create a Prolog description of this graph.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.
- Returns:
- a Prolog description of this graph
- Since:
- 2003.03.31 (Christian Borgelt)
-
main
Main function for testing some basic functionality.- Parameters:
args
- the command line arguments- Since:
- 2006.01.02 (Christian Borgelt)
-