ast

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2017 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PATTERN_SINGLE = iota + 1
	PATTERN_ZERO_ONE
	PATTERN_ONE_PLUS
	PATTERN_ZERO_PLUS
)

Variables

This section is empty.

Functions

func AddIfVar

func AddIfVar(uri turtle.URI, m map[string]int)

func AppendString

func AppendString(strlist, _str interface{}) ([]string, error)

func AppendVar

func AppendVar(varlist, _var interface{}) ([]string, error)

func ClearDebug

func ClearDebug()

func NewStringList

func NewStringList(_str interface{}) ([]string, error)

func NewURI

func NewURI(value interface{}) (turtle.URI, error)

func NewVarList

func NewVarList(_var interface{}) ([]string, error)

func ParseString

func ParseString(_var interface{}) (string, error)

func SetDebug

func SetDebug()

func VarsFromGroup

func VarsFromGroup(group GraphGroup, m map[string]int)

Types

type FromClause

type FromClause struct {
	Databases []string
	AllDBs    bool
}

func NewAllFromClause

func NewAllFromClause() (FromClause, error)

func NewFromClause

func NewFromClause(dblist interface{}) (FromClause, error)

func (FromClause) Empty

func (from FromClause) Empty() bool

type GraphGroup

type GraphGroup struct {
	Terms  []Triple
	Unions []GraphGroup
}

func AddTriplesToGraphGroup

func AddTriplesToGraphGroup(left, triples interface{}) (GraphGroup, error)

func GraphGroupFromTriples

func GraphGroupFromTriples(triples interface{}) (GraphGroup, error)

func GraphGroupUnion

func GraphGroupUnion(left, right interface{}) (GraphGroup, error)

func MergeGraphGroups

func MergeGraphGroups(left, right interface{}) (GraphGroup, error)

func (GraphGroup) Expand

func (grp GraphGroup) Expand() [][]Triple

func (GraphGroup) Iter

func (grp GraphGroup) Iter(f func(t turtle.URI))

func (*GraphGroup) IterTriples

func (grp *GraphGroup) IterTriples(f func(t Triple) Triple)

type PathPattern

type PathPattern struct {
	Predicate turtle.URI
	Pattern   Pattern
}

func AddPathMod

func AddPathMod(_pred, _mod interface{}) (PathPattern, error)

func AppendPathSequence

func AppendPathSequence(_seq, _pred interface{}) ([]PathPattern, error)

func NewPathPattern

func NewPathPattern(_pred interface{}) (PathPattern, error)

func NewPathSequence

func NewPathSequence(_pred interface{}) ([]PathPattern, error)

func PathFromVar

func PathFromVar(_var interface{}) ([]PathPattern, error)

func (PathPattern) String

func (pp PathPattern) String() string

type Pattern

type Pattern uint

func (Pattern) String

func (p Pattern) String() string

type Query

type Query struct {
	Select    SelectClause
	From      FromClause
	Count     bool
	Where     WhereClause
	Variables []string
}

func NewQuery

func NewQuery(selectclause, whereclause interface{}, count bool) (Query, error)

func NewQueryMulti

func NewQueryMulti(selectclause, fromclause, whereclause interface{}, count bool) (Query, error)

func (Query) Copy added in v0.5.3

func (q Query) Copy() *Query

func (Query) CopyWithNewTerms

func (q Query) CopyWithNewTerms(terms []Triple) Query

func (Query) IterTriples

func (q Query) IterTriples(f func(t Triple) Triple)

func (*Query) PopulateVars

func (q *Query) PopulateVars()

type SelectClause

type SelectClause struct {
	Vars    []string
	AllVars bool
}

func NewAllSelectClause

func NewAllSelectClause() (SelectClause, error)

func NewSelectClause

func NewSelectClause(varlist interface{}) (SelectClause, error)

type Triple

type Triple struct {
	Subject    turtle.URI
	Predicates []PathPattern
	Object     turtle.URI
}

func AppendTripleBlock

func AppendTripleBlock(block, triple interface{}) ([]Triple, error)

func NewTriple

func NewTriple(subject, predicates, object interface{}) (Triple, error)

func NewTripleBlock

func NewTripleBlock(triple interface{}) ([]Triple, error)

func (Triple) String

func (t Triple) String() string

type WhereClause

type WhereClause struct {
	Terms      []Triple
	GraphGroup *GraphGroup
}

func NewWhereClause

func NewWhereClause(triples interface{}) (WhereClause, error)

func NewWhereClauseGraphGroup

func NewWhereClauseGraphGroup(group interface{}) (WhereClause, error)

func NewWhereClauseWithGraphGroup

func NewWhereClauseWithGraphGroup(triples, group interface{}) (WhereClause, error)

Jump to

Keyboard shortcuts

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