Triangle Enumeration

The Triangle Enumeration algorithm identifies each of the triangles that exist in the specified graph. A triangle is defined as three nodes that are connected by three edges (a-b, b-c, c-a).

Triangle Enumeration Syntax

Graph algorithms are accessed from an internal SPARQL service endpoint. To incorporate the Triangle Enumeration algorithm in a query, include a SERVICE statement in the WHERE clause. The service call specifies the name of the algorithm and defines the required and optional property values for that algorithm.

Use the following syntax to find the triangles in a graph. The table below describes each property.

SERVICE <csi:triangles> {
  [] <csi:binding-vertex1>  ?vertex1_variable_name ;
     <csi:binding-vertex2>  ?vertex2_variable_name ;
     <csi:binding-vertex3>  ?vertex3_variable_name ;
     <csi:edge-label>       <edge_uri> .
}
Property Description Range & Default Value
<csi:binding-vertex1> Required property that defines the name to use for the result column that lists the first node in the triangle. Range: Must be a variable name
Default: none
<csi:binding-vertex2> Required property that defines the name to use for the result column that lists the second node in the triangle. Range: Must be a variable name
Default: none
<csi:binding-vertex3> Required property that defines the name to use for the result column that lists the third node in the triangle. Range: Must be a variable name
Default: none
<csi:edge-label> Required property that lists the edge URI that defines the graph to operate on. The graph is the set of vertices that are connected by this URI. Range: Must be a URI
Default: none
Related Topics