ast

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2018 License: BSD-3-Clause Imports: 5 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 ParseQuotedString added in v0.5.6

func ParseQuotedString(_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

func (FromClause) String added in v0.5.5

func (f FromClause) String() string

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 InsertClause added in v0.6.0

type InsertClause struct {
	Terms []Triple
}

func NewInsertClause added in v0.6.0

func NewInsertClause(triples interface{}) (InsertClause, error)

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
	Insert    InsertClause
	Where     WhereClause
	Variables []string
	Type      QueryType
}

func NewInsertQuery added in v0.6.0

func NewInsertQuery(insertclause, whereclause interface{}, count bool) (Query, error)

func NewInsertQueryMulti added in v0.6.0

func NewInsertQueryMulti(insertclause, fromclause, whereclause interface{}, count bool) (Query, error)

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) Dump added in v0.6.0

func (q Query) Dump()

func (Query) IsInsert added in v0.6.0

func (q Query) IsInsert() bool

func (Query) IsSelect added in v0.6.0

func (q Query) IsSelect() bool

func (Query) IterTriples

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

func (*Query) PopulateVars

func (q *Query) PopulateVars()

type QueryType added in v0.6.0

type QueryType uint
const (
	SELECT_QUERY QueryType = 1 << iota
	INSERT_QUERY
	DELETE_QUERY
)

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) Copy added in v0.6.0

func (t Triple) Copy() Triple

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