Documentation ¶
Index ¶
- Constants
- func Bind(mappings []*base.Mapping, queries []*base.Query) (map[*base.Query][]*base.Mapping, error)
- func GetEntityType(mappings []*base.Mapping) map[string][]string
- func GetExplicitTypeProp(mappings []*base.Mapping) map[string][]string
- func GetFuncDeps(mappings []*base.Mapping) (map[base.Entity]map[string]interface{}, error)
- func GetNodeRef(queries []*base.Query) map[base.Node]struct{}
- func GetNodeType(queries []*base.Query) (map[string]string, error)
- func GetOutArcInfo(mappings []*base.Mapping, nodeType string) (map[string][]OutArcInfo, error)
- func GetProvColumn(mappings []*base.Mapping) (map[string]base.Column, error)
- func GetQueryID(queries []*base.Query, matchTriple map[*base.Query]bool) map[*base.Query]int
- func GetSubTypeMap(tableTypesJSONFilePath string) (map[string]string, error)
- func MatchTriple(mappings []*base.Mapping, queries []*base.Query) (map[*base.Query]bool, error)
- func ParseMapping(mcf, database string) ([]*base.Mapping, error)
- func ParseQuery(queryString string) ([]base.Node, []*base.Query, error)
- func PruneMapping(mappings []*base.Mapping) []*base.Mapping
- func RewriteQuery(queries []*base.Query, subTypeMap map[string]string) []*base.Query
- type Binding
- type Constraint
- type Graph
- type InArcInfo
- type OutArcInfo
- type ProvInfo
- type Translation
Constants ¶
const DB = "dc_v3"
DB is the database name.
Variables ¶
This section is empty.
Functions ¶
func GetEntityType ¶
GetEntityType obtains a map from entity key to the types.
func GetExplicitTypeProp ¶
GetExplicitTypeProp obtains a map from type to list of predicate
func GetFuncDeps ¶
GetFuncDeps obtains the functional deps from schema mapping.
func GetNodeRef ¶
GetNodeRef obtains a list of node reference from query statements.
func GetNodeType ¶
GetNodeType obtains a map from node alias to the types.
func GetOutArcInfo ¶
GetOutArcInfo gets the table and columns corresponding to the node properties.
func GetProvColumn ¶
GetProvColumn obtains the provenance column for each table.
func GetQueryID ¶
GetQueryID obtains the id for query statement. If two query statements match to Triples table, they would have same query id if they have the same predciate and subject. If two query statements match to non-Triples table, they would have the same query id if they have the same subject. The same query id means they point to the same spanner table instance in SQL query.
func GetSubTypeMap ¶
GetSubTypeMap gets subtype map.
func MatchTriple ¶
MatchTriple takes list of queries and mappings and determines whether a query matches Triples table.
func ParseMapping ¶
ParseMapping parses schema mapping mcf into a list of Mapping struct.
func ParseQuery ¶
ParseQuery parses a datalog query into list of nodes and list of query statements.
func PruneMapping ¶
PruneMapping prunes foreign key entity mappings.
Types ¶
type Constraint ¶
type Constraint struct { // Left hand side of an SQL condition LHS base.Column // Right hand side of an SQL condition RHS interface{} }
Constraint wraps the SQL lhs and rhs variable.
type Graph ¶
type Graph map[interface{}]map[interface{}]struct{}
Graph represents the struct for terms matching.
type OutArcInfo ¶
OutArcInfo is used for out arcs pred column.
type ProvInfo ¶
type ProvInfo struct {
// contains filtered or unexported fields
}
ProvInfo contains the provenance query metadata
type Translation ¶
type Translation struct { SQL string Nodes []base.Node Bindings []Binding Constraint []Constraint Prov map[int][]int }
Translation contains the translated result.