Salt  3.4.2
A powerful, tagset-independent and theory-neutral meta model and API for storing, manipulating, and representing nearly all types of linguistic data .
org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R > Interface Template Reference

The here defined graph is given by G=(V, E, L, {label a , ...label b }) with: More...

Inherits org.corpus_tools.salt.graph.IdentifiableElement.

Inherited by org.corpus_tools.salt.core.SGraph, org.corpus_tools.salt.extensions.notification.graph.impl.GraphNotifierImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >, and org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

Public Member Functions

IndexMgr getIndexMgr ()
 Returns the index manager. More...
 
List< R > getRelations ()
 Returns a list of all relations contained in this graph. More...
 
getRelation (String relationId)
 Returns an relation corresponding to the passed id, if such an relation is contained in the graph. More...
 
List< R > getRelations (String sourceNodeId, String targetNodeId)
 Returns all relations,which connects the two passed nodes. More...
 
List< R > getInRelations (String nodeId)
 Returns all relations, which have the node corresponding to the passed id as their target node. More...
 
List< R > getOutRelations (String nodeId)
 Returns all relations, which have the node corresponding to the passed id as their source node. More...
 
void addRelation (Relation<? extends N, ? extends N > relation)
 Adds the passed relation to this graph and updates indexes. More...
 
void removeRelation (Relation<? extends N, ? extends N > relation)
 Removes the passed relation from this graph. More...
 
void removeRelations ()
 Removes all relations from this graph and cleans all indexes.
 
boolean containsRelation (String relationId)
 Returns whether this graph contains an Relation corresponding to the passed id. More...
 
List< N > getNodes ()
 Returns a list of all relations contained in this graph. More...
 
getNode (String nodeId)
 Returns a node corresponding to the passed id, if such a node is contained in the graph. More...
 
void addNode (N node)
 Adds the passed node to this graph and updates indexes. More...
 
void removeNode (N node)
 Removes the passed node from this graph and cleans all indexes. More...
 
boolean containsNode (String nodeId)
 Returns whether this graph contains a Node corresponding to the passed id. More...
 
getLayer (String layerId)
 Returns a layer corresponding to the passed id, if such a layer is contained in the graph. More...
 
Set< L > getLayers ()
 Returns a set of layers contained by this graph. More...
 
void addLayer (L layer)
 Adds the passed layer to this graph. More...
 
boolean containsLayer (String layerId)
 Returns whether this graph contains a Layer corresponding to the passed id. More...
 
void removeLayer (L layer)
 Removes the passed layer from this graph and cleans all indexes. More...
 
- Public Member Functions inherited from org.corpus_tools.salt.graph.IdentifiableElement
String getId ()
 Returns the id of this object, which is the value of the contained Identifier object. More...
 
void setId (String id)
 Creates a new Identifier object and sets its value to the passed id. More...
 
Identifier getIdentifier ()
 Returns the Identifier label for this object. More...
 
void setIdentifier (Identifier identifier)
 Sets the Identifier label for this object. More...
 
- Public Member Functions inherited from org.corpus_tools.salt.graph.LabelableElement
Collection< LabelgetLabels ()
 Returns all labels being contained by this object. More...
 
void addLabel (Label label)
 Adds the given Label object to the list of labels. More...
 
Label getLabel (String namespace, String name)
 Returns a label having the passed namespace and name, if such a label is contained by this object. More...
 
Label getLabel (String qName)
 Returns a label having the passed qualified name. More...
 
void removeLabel (String qName)
 Removes the label having the passed qName. More...
 
void removeLabel (String namespace, String name)
 Removes a Label object from the list of labels of this object. More...
 
void removeAll ()
 Removes all Label objects.
 
Set< LabelgetLabelsByNamespace (String namespace)
 Returns a set containing all Label objects having the given namespace. More...
 
boolean containsLabel (String qName)
 Checks if this object has a Label object in its list having the given qualified name. More...
 
Integer sizeLabels ()
 returns the number of Label objects contained by this object. More...
 

Detailed Description

The here defined graph is given by G=(V, E, L, {label a , ...label b }) with:

  • V being a set of Nodes with v= ({label c , ... label d }) ∊ V
  • E being a set of directed Relations with e= (v 1 ∊ V, v 2 ∊ V, {label e , ... label f }) ∊ E
  • L being a set of Layers with l= (V 1 ⊆ V, E 1 ⊆ E, L 1 ⊆ L, {label g ,.. label h }) ∊ L
  • and a set of Labels {label a , ... label b } the graph is labeled with.
Author
florian
Parameters
<N>type of contained Nodes
<E>type of contained Relations

Member Function Documentation

◆ addLayer()

void org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.addLayer ( layer)

Adds the passed layer to this graph.

If layer is null or layer is already contained nothing is inserted. The passed layer and this graph will be double chained, which means the method Layer#getGraph() will return this graph. If the passed layer contains nodes or relations, which are not already contained by the graph, they will be added.

Parameters
layerlayer to be inserted

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >, and org.corpus_tools.salt.extensions.notification.graph.impl.GraphNotifierImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ addNode()

void org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.addNode ( node)

Adds the passed node to this graph and updates indexes.

If node is null or node is already contained nothing is inserted. The passed node and this graph will be double chained, which means the method Node#getGraph() will return this graph.

Parameters
nodenode to be inserted

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >, and org.corpus_tools.salt.extensions.notification.graph.impl.GraphNotifierImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ addRelation()

void org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.addRelation ( Relation<? extends N, ? extends N >  relation)

Adds the passed relation to this graph and updates indexes.

If relation is null or relation is already contained nothing is inserted. The passed relation and this graph will be double chained, which means the method Relation#getGraph() will return this graph.

Parameters
relationrelation to be inserted

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >, and org.corpus_tools.salt.extensions.notification.graph.impl.GraphNotifierImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ containsLayer()

boolean org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.containsLayer ( String  layerId)

Returns whether this graph contains a Layer corresponding to the passed id.

Parameters
layerIdid of the node to be checked
Returns
true if the node is contained, false otherwise

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ containsNode()

boolean org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.containsNode ( String  nodeId)

Returns whether this graph contains a Node corresponding to the passed id.

Parameters
nodeIdid of the node to be checked
Returns
true if the node is contained, false otherwise

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ containsRelation()

boolean org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.containsRelation ( String  relationId)

Returns whether this graph contains an Relation corresponding to the passed id.

Parameters
relationIdid of the node to be checked
Returns
true if the relation is contained, false otherwise

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ getIndexMgr()

IndexMgr org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.getIndexMgr ( )

Returns the index manager.

The index manager is used to register indexes for sets of nodes, relations, layers etc. or single values. The manager contains all indexes used by the Graph class. These indexes are:

Even further indexes can be added to the index manager.

Returns
the index manager

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ getInRelations()

List<R> org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.getInRelations ( String  nodeId)

Returns all relations, which have the node corresponding to the passed id as their target node.

Parameters
nodeIdid corresponding to the node, for which all incoming relations should be searched
Returns
a list of all incoming relations

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ getLayer()

L org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.getLayer ( String  layerId)

Returns a layer corresponding to the passed id, if such a layer is contained in the graph.

Parameters
layerIdid of the layer to be searched for

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ getLayers()

Set<L> org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.getLayers ( )

Returns a set of layers contained by this graph.

Returns
all contained layers

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ getNode()

N org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.getNode ( String  nodeId)

Returns a node corresponding to the passed id, if such a node is contained in the graph.

Parameters
nodeIdid of the node to be searched for

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ getNodes()

List<N> org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.getNodes ( )

Returns a list of all relations contained in this graph.

Returns
a list of all contained relations.

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ getOutRelations()

List<R> org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.getOutRelations ( String  nodeId)

Returns all relations, which have the node corresponding to the passed id as their source node.

Parameters
nodeIdid corresponding to the node, for which all outgoing relations should be searched
Returns
a list of all outgoing relations

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ getRelation()

R org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.getRelation ( String  relationId)

Returns an relation corresponding to the passed id, if such an relation is contained in the graph.

Parameters
relationIdid of the relation to be searched for

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ getRelations() [1/2]

List<R> org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.getRelations ( )

Returns a list of all relations contained in this graph.

Returns
a list of all contained relations.

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ getRelations() [2/2]

List<R> org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.getRelations ( String  sourceNodeId,
String  targetNodeId 
)

Returns all relations,which connects the two passed nodes.

Parameters
sourceNodeIdthe id of the source node
targetNodeIdthe id of the target node
Returns
returns all nodes between source node and target node

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ removeLayer()

void org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.removeLayer ( layer)

Removes the passed layer from this graph and cleans all indexes.

It also ensures, that the graph is removed from the layer, thus invoking Layer#getGraph() will return null. The double chaining between this graph and the passed layer will be cut off. If the passed layer is null nothing happens.

Parameters
layerthe layer to be removed

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >, and org.corpus_tools.salt.extensions.notification.graph.impl.GraphNotifierImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ removeNode()

void org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.removeNode ( node)

Removes the passed node from this graph and cleans all indexes.

It also ensures, that the graph is removed from the node, thus invoking Node#getGraph() will return null. The double chaining between this graph and the passed node will be cut off. If the passed node is null nothing is done.

Parameters
nodethe node to be removed

Implemented in org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >, and org.corpus_tools.salt.extensions.notification.graph.impl.GraphNotifierImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.

◆ removeRelation()

void org.corpus_tools.salt.graph.Graph< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.removeRelation ( Relation<? extends N, ? extends N >  relation)

Removes the passed relation from this graph.

If a relation is removed, it will be deleted from all indexes. If the passed relation is null, nothing is removed.

Parameters
relationrelation to be removed

Implemented in org.corpus_tools.salt.extensions.notification.graph.impl.GraphNotifierImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >, and org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.