pull: Creates pull expressions

Description Usage Arguments Value Examples

View source: R/pull.R

Description

This function creates Datomic pull expressions. The following rules apply when converting R expressions to Datomic pull expressions:

Usage

1

Arguments

...

This function takes exactly 2 arguments which must be specified in the following order (named arguments are not supported, the arguments are matched positionally)

  • The variable representing the entity id from which the pull is initiated

  • The pull expression

Value

Returns a data structure representing the pull expression, suitable for inclusion in the find clause of a query

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
qq <- query(
  find(pull(?s, c({sample/subject = c(.)}, .))),
  where(
    d(?s, sample/id, ?id)
  )
)
do_query(qq)

qq <- query(
  find(pull(?g, c(gene/hugo, {variant/.gene = c({variant/type = c(db/ident)}, .)})))
  where(
    d(?g, gene/hugo, ?hugo)
  )
)
do_query(qq)

ParkerICI/datalogr documentation built on Aug. 16, 2021, 10:59 a.m.