Fork me on GitHub
#datomic
<
2016-07-09
>
val_waeselynck12:07:44

@lvh regarding your first question I would need an example

val_waeselynck12:07:43

I mean with attribute definitions and specific questions you want to ask

casperc14:07:55

@marshall: Hmm, I tried that but seems I got caught in a bit of a gotya. I was trying to do the ‘and’ logic on the child entity being referenced by the cardinality many ref, which does not work.

casperc14:07:36

Works:

(db/q 
        '[:find [(pull ?e [*]) ...]
          :in $ ?one ?two
          :where 
          [?e :template/field ?one]
          [?e :template/field ?two]]
        db [:template.field/id 102] [:template.field/id 101])

casperc14:07:46

Doesn’t work:

(db/q
        '[:find [(pull ?e [*]) ...]
          :in $ ?one ?two
          :where 
          [?e :template/field ?field]
          [?f :template.field/id ?one]
          [?f :template.field/id ?two]]
        db 102 101)

casperc14:07:07

Works too:

(db/q
       '[:find [(pull ?e [*]) ...]
         :in $ ?one ?two
         :where 
         [?f1 :template.field/id ?one]
         [?f2 :template.field/id ?two]
         [?e :template/field ?f1]
         [?e :template/field ?f2]
         ]
       db 102 101)

casperc14:07:07

I guess I see the logic now, in that the second one only sees one template.field at a time and then asks it to be both ?one and ?two.

lvh18:07:11

val_waeselynck: More detail then what I provided in https://clojurians.slack.com/archives/datomic/p1468014473000883 ? I’m trying to translate Swagger into datomic

lvh18:07:58

I’m trying to find a sufficiently complex and pretty-printed swagger example

lvh18:07:14

I am trying to turn this: https://gist.github.com/lvh/b45dc7994336b4171d78622af81f7e52 into datomic so I can query it. petstore-minimal.json specifies the generally accepted and returned mime types here: https://gist.github.com/lvh/b45dc7994336b4171d78622af81f7e52#file-petstore-minimal-json-L20-L25 but also overrides it for a specific operation here: https://gist.github.com/lvh/b45dc7994336b4171d78622af81f7e52#file-petstore-minimal-json-L30-L32

lvh18:07:28

incidentally, in this case they agree (application/json)

lvh18:07:48

according to the spec, which unfortunately doesn’t have anchor links for a specific part (http://swagger.io/specification/) the operation one overrides the global one