graph

package
v0.0.0-...-7e20739 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 1 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectedEdge

type DirectedEdge struct {
	Id       string            `json:"id,omitempty" yaml:"id,omitempty" mapstructure:"id,omitempty"`
	Source   []string          `json:"source" yaml:"source" mapstructure:"source"`
	Target   []string          `json:"target" yaml:"target" mapstructure:"target"`
	Relation string            `json:"relation,omitempty" yaml:"relation,omitempty" mapstructure:"relation,omitempty"`
	Label    string            `json:"label,omitempty" yaml:"label,omitempty" mapstructure:"label,omitempty"`
	Metadata metadata.Metadata `json:"metadata,omitempty" yaml:"metadata,omitempty" mapstructure:"metadata,omitempty"`
}

type DirectedGraph

type DirectedGraph struct {
	GraphBase
	Edges []DirectedEdge `json:"hyperedges" yaml:"hyperedges" mapstructure:"hyperedges"`
}

A directed graph - has a list of directed edges

type DirectedJsonGraph

type DirectedJsonGraph struct {
	Graph DirectedGraph `json:"graph" yaml:"graph" mapstructure:"graph"`
}

DirectedJsonGraph is explicitly a directed graph

func NewDirectedGraph

func NewDirectedGraph() *DirectedJsonGraph

type DirectedJsonGraphList

type DirectedJsonGraphList struct {
	Graphs []DirectedGraph `json:"graphs" yaml:"graphs" mapstructure:"graphs"`
}

type Edge

type Edge struct {
	Id       string            `json:"id,omitempty" yaml:"id,omitempty" mapstructure:"id,omitempty"`
	Source   string            `json:"source" yaml:"source" mapstructure:"source"`
	Target   string            `json:"target" yaml:"target" mapstructure:"target"`
	Relation string            `json:"relation,omitempty" yaml:"relation,omitempty" mapstructure:"relation,omitempty"`
	Label    string            `json:"label,omitempty" yaml:"label,omitempty" mapstructure:"label,omitempty"`
	Directed bool              `json:"directed,omitempty" yaml:"directed,omitempty" mapstructure:"directed,omitempty"`
	Metadata metadata.Metadata `json:"metadata,omitempty" yaml:"metadata,omitempty" mapstructure:"metadata,omitempty"`
}

type Graph

type Graph struct {
	GraphBase
	Edges []Edge `json:"edges" yaml:"edges" mapstructure:"edges"`
}

A standard Json graph - has a list of edges

type GraphBase

type GraphBase struct {
	Id       string          `json:"id,omitempty" yaml:"id,omitempty" mapstructure:"id,omitempty"`
	Label    string          `json:"label,omitempty" yaml:"label,omitempty" mapstructure:"label,omitempty"`
	Directed bool            `json:"directed,omitempty" yaml:"directed,omitempty" mapstructure:"directed,omitempty"`
	Type     string          `json:"type,omitempty" yaml:"type,omitempty" mapstructure:"type,omitempty"`
	Nodes    map[string]Node `json:"nodes" yaml:"nodes" mapstructure:"nodes"`
}

The graph base has attributes shared across graphs

type JsonGraph

type JsonGraph struct {
	Graph Graph `json:"graph" yaml:"graph" mapstructure:"graph"`
}

A JSONGraph can either be parsed into a list of graps or single graph We have types for standard, and then explicitly directed and undirected

func NewGraph

func NewGraph() *JsonGraph

New functions handle creation of new graphs (and directed, etc.)

type JsonGraphList

type JsonGraphList struct {
	Graphs []Graph `json:"graphs" yaml:"graphs" mapstructure:"graphs"`
}

type Node

type Node struct {
	Label    *string           `json:"label,omitempty" yaml:"label,omitempty" mapstructure:"label,omitempty"`
	Metadata metadata.Metadata `json:"metadata,omitempty" yaml:"metadata,omitempty" mapstructure:"metadata,omitempty"`
}

type UndirectedEdge

type UndirectedEdge struct {
	Id       string            `json:"id,omitempty" yaml:"id,omitempty" mapstructure:"id,omitempty"`
	Nodes    []string          `json:"nodes" yaml:"nodes" mapstructure:"nodes"`
	Relation string            `json:"relation,omitempty" yaml:"relation,omitempty" mapstructure:"relation,omitempty"`
	Label    string            `json:"label,omitempty" yaml:"label,omitempty" mapstructure:"label,omitempty"`
	Metadata metadata.Metadata `json:"metadata,omitempty" yaml:"metadata,omitempty" mapstructure:"metadata,omitempty"`
}

type UndirectedGraph

type UndirectedGraph struct {
	GraphBase
	Edges []UndirectedEdge `json:"hyperedges" yaml:"hyperedges" mapstructure:"hyperedges"`
}

An undirected graph - has a list of undirected edges

type UndirectedJsonGraph

type UndirectedJsonGraph struct {
	Graph UndirectedGraph `json:"graph" yaml:"graph" mapstructure:"graph"`
}

UndirectedJsonGraph is explicitly an undirected graph

func NewUndirectedGraph

func NewUndirectedGraph() *UndirectedJsonGraph

type UndirectedJsonGraphList

type UndirectedJsonGraphList struct {
	Graphs []UndirectedGraph `json:"graphs" yaml:"graphs" mapstructure:"graphs"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL