std.lib.transform.base.alias
find-aliases
added in 3.0
(find-aliases tsch ks)finds necessary aliases
(find-aliases (:flat (schema/schema family/family-links)) :person/brother :person/mother) => [:person/brother {:ns :sibling, :template {:sibling {:gender :m}}} :person/mother {:ns :parent, :template {:parent {:gender :f}}}]
resolve-alias
added in 3.0
(resolve-alias tsch tdata alias no-gen-sym)resolves the data for the alias
(resolve-alias (:tree (schema/schema family/family-links)) {:male {:name “Chris”}} :male {:ns :person, :template {:person {:gender :m}}} nil) => {:person {:gender :m, :name “Chris”}}
template-alias
added in 3.0
(template-alias tmpl)templates an alias, replacing symbols with random
(template-alias {:db/id ’hello}) ;;{:db/id hello_141387} => (contains {:db/id symbol?})
wrap-alias
added in 3.0
(wrap-alias f)wraps normalise to process aliases for a database schema
(graph/normalise {:male/name “Chris”} {:schema (schema/schema family/family-links)} {:normalise wrap-alias}) => {:person {:gender :m, :name “Chris”}}
(graph/normalise {:female {:parent/name “Sam” :brother {:brother/name “Chris”}}} {:schema (schema/schema family/family-links)}) => {:person {:gender :f, :parent {:name “Sam”}, :sibling {:gender :m, :sibling {:gender :m, :name “Chris”}}}}