Documentation ¶
Overview ¶
a non-sql data format for use by the qna runtime
Index ¶
- Constants
- func FindKind(ks []rt.Kind, exactKind string) (ret *rt.Kind, okay bool)
- type Data
- type EvalData
- type NounData
- type NounName
- type Pair
- type PatternData
- type Plural
- type RawQuery
- func (q RawQuery) ActivateDomains(name string) (prev, next []string, err error)
- func (q RawQuery) Close()
- func (q RawQuery) IsDomainActive(name string) (okay bool, err error)
- func (q RawQuery) KindOfAncestors(singleOrPlural string) (ret []string, err error)
- func (q RawQuery) LoadGame(path string) (ret query.CacheMap, err error)
- func (q RawQuery) NounInfo(short string) (ret query.NounInfo, err error)
- func (q RawQuery) NounName(full string) (ret string, err error)
- func (q RawQuery) NounNames(full string) (ret []string, err error)
- func (q RawQuery) NounValue(full, field string) (ret rt.Assignment, err error)
- func (q RawQuery) NounsWithAncestor(kind string) (ret []string, err error)
- func (q RawQuery) PatternLabels(pat string) (ret []string, err error)
- func (q RawQuery) PluralFromSingular(singular string) (ret string, _ error)
- func (q RawQuery) PluralToSingular(plural string) (ret string, _ error)
- func (q RawQuery) Random(inclusiveMin int, exclusiveMax int) int
- func (q RawQuery) ReciprocalsOf(rel, noun string) (ret []string, err error)
- func (q RawQuery) Relate(rel, noun, otherNoun string) (err error)
- func (q RawQuery) RelativesOf(rel, noun string) (ret []string, err error)
- func (q RawQuery) RulesFor(pat string) (ret query.RuleSet, err error)
- func (q RawQuery) SaveGame(path string, dynamicValues query.CacheMap) error
- type RecordData
- type RelativeData
- type SceneData
Constants ¶
View Source
const ( ONE_TO_ONE = "one_one" ONE_TO_MANY = "one_any" MANY_TO_ONE = "any_one" MANY_TO_MANY = "any_any" )
cardinality
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Data ¶
type Data struct { Scenes []string // in order with root ( tapestry ) first Plurals []Plural // pairs of one, many; sorted by one Kinds []rt.Kind // sorted by .Kind Names []NounName // sorted by .Name Nouns []NounData // sorted by .Noun Patterns []PatternData // sorted by .Pattern Relatives []RelativeData // sorted by .Relation Grammar []grammar.Directive // sorted by .Name }
type EvalData ¶
type EvalData struct { Field string Value rt.Assignment }
type NounData ¶
type NounData struct { Id int // mdl_noun Domain string Noun string // full, unique name Kind string // alt? id, path, bitarray? ... CommonName string // author defined name Aliases []string // alpha order for parser Values []EvalData `json:",omitempty"` // sparse field values, sorted by field name Records []RecordData `json:",omitempty"` }
type PatternData ¶
type PatternData struct { Id int // mdl_pat Pattern string Labels []string // the last value is the result, even if blank Rules []rt.Rule `json:",omitempty"` UpdateAll bool }
func FindPattern ¶
func FindPattern(els []PatternData, name string) (ret PatternData, okay bool)
type RawQuery ¶
type RawQuery struct { *Data // contains filtered or unexported fields }
func (RawQuery) ActivateDomains ¶
func (RawQuery) IsDomainActive ¶
func (RawQuery) KindOfAncestors ¶
func (RawQuery) NounValue ¶
func (q RawQuery) NounValue(full, field string) (ret rt.Assignment, err error)
func (RawQuery) NounsWithAncestor ¶ added in v0.24.8
ex. give me all nouns of type "actors"
func (RawQuery) PatternLabels ¶
func (RawQuery) PluralFromSingular ¶
func (RawQuery) PluralToSingular ¶
func (RawQuery) ReciprocalsOf ¶
func (RawQuery) RelativesOf ¶
type RecordData ¶
record data is json serialized ( via pack/unpack ) because otherwise gobbing would need a way to store variant values package json says []byte encodes as a base64-encoded string,
func FindRecordField ¶
func FindRecordField(els []RecordData, name string) (ret RecordData, okay bool)
type RelativeData ¶
type RelativeData struct { Id int // mdl_rel Relation string // a kind OneKind, OtherKind string // primary and secondary types Cardinality string // ( these also are recorded in the kind data ) Pairs []Pair `json:",omitempty"` }
func FindRelation ¶
func FindRelation(els []RelativeData, name string) (ret *RelativeData, okay bool)
Click to show internal directories.
Click to hide internal directories.