graph

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package graph provides types and functions for generic knowledge representation, including items,messages, events, and statements about these in an RDF-like fashion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGraph

func CreateGraph() *graph

Types

type Collection

type Collection interface {
	Iterator() Iterator
	First() v.Step
	Size() uint64
	AsSlice() []v.Step
	SourceGraph() Graph
}

type Graph

type Graph interface {
	ROGraph
	Concept() v.Step
	Assert(v.Step, v.Step, v.Value) v.Step
	AssertConcept(v.Step, string) v.Step
}

type Identifier

type Identifier = v.Identifier

type Iterator

type Iterator interface {
	Next() bool
	Value() v.Step
}

An Iterator allows iterating over query results, like this: `it := graph.Query(...).Iterator()

for it.Next() { s := it.Value(); ... }`

func SliceIterator

func SliceIterator(data []v.Step) Iterator

type ROGraph

type ROGraph interface {
	Content() Collection
	Last() v.Step
	Size() uint64
	Query(v.Step, v.Step, v.Value) Collection
	Get(string) v.Step
	Name(v.Step) string
	Concepts() Collection
}

type Step

type Step struct {
	// contains filtered or unexported fields
}

func (*Step) AsNumber

func (s *Step) AsNumber() (v.Number, bool)

func (*Step) AsStep

func (s *Step) AsStep() (v.Step, bool)

func (*Step) AsText

func (s *Step) AsText() (v.Text, bool)

func (*Step) GoString

func (s *Step) GoString() string

func (Step) Id

func (sc Step) Id() Identifier

func (*Step) IsEmpty

func (s *Step) IsEmpty() bool

func (*Step) IsTerminal

func (s *Step) IsTerminal() bool

func (Step) Item

func (s Step) Item() v.Step

func (Step) Property

func (s Step) Property() v.Step

func (*Step) String

func (s *Step) String() string

func (*Step) Type

func (s *Step) Type() v.TypeCode

func (Step) Value

func (s Step) Value() v.Value

Directories

Path Synopsis
Package talk provides external interfaces for graphs.
Package talk provides external interfaces for graphs.

Jump to

Keyboard shortcuts

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