triples

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirectionIncoming = iota
	DirectionOutgoing
	DirectionUnknown
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AttrValue

type AttrValue struct {
	Value  string
	Regexp *regexp.Regexp
}
type Link struct {
	ID         string           `json:"id"`
	Type       oam.RelationType `json:"type"`
	CreatedAt  string           `json:"created_at"`
	LastSeen   string           `json:"last_seen"`
	Relation   oam.Relation     `json:"relation"`
	Node       *Vertex          `json:"entity"`
	Properties []*Prop          `json:"tags"`
}

type Node

type Node struct {
	Key        string
	Regexp     *regexp.Regexp
	Type       oam.AssetType
	Since      time.Time
	Attributes map[string]*AttrValue
	Properties []*Property
}

func (*Node) IsWildcard

func (n *Node) IsWildcard() bool

type Predicate

type Predicate struct {
	Label      string
	Regexp     *regexp.Regexp
	Type       oam.RelationType
	Since      time.Time
	Attributes map[string]*AttrValue
	Properties []*Property
}

func (*Predicate) IsWildcard

func (p *Predicate) IsWildcard() bool

type Prop

type Prop struct {
	ID        string           `json:"id"`
	Type      oam.PropertyType `json:"type"`
	CreatedAt string           `json:"created_at"`
	LastSeen  string           `json:"last_seen"`
	Property  oam.Property     `json:"property"`
}

type Property

type Property struct {
	Name       string
	Regexp     *regexp.Regexp
	Since      time.Time
	Type       oam.PropertyType
	Attributes map[string]*AttrValue
}

type Results

type Results struct {
	Node *Vertex `json:"entity"`
}

func Extract

func Extract(db repository.Repository, triples []*Triple) (*Results, error)

type Triple

type Triple struct {
	Direction int
	Subject   *Node
	Predicate *Predicate
	Object    *Node
}

func ParseTriple

func ParseTriple(triple string) (*Triple, error)

type Vertex

type Vertex struct {
	ID         string        `json:"id"`
	Type       oam.AssetType `json:"type"`
	CreatedAt  string        `json:"created_at"`
	LastSeen   string        `json:"last_seen"`
	Asset      oam.Asset     `json:"asset"`
	Relations  []*Link       `json:"edges"`
	Properties []*Prop       `json:"tags"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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