Fork me on GitHub
#datomic
<
2022-05-01
>
vlad_poh14:05:03

trying datomic free for the first time and running into a problem i don't understand why would the following fail

(def played
  '[[(played ?p1 ?p2 ?t)
     [?e :winner_name ?p1]
     [?e :loser_name ?p2]
     [?e :tourney_name ?t]]
    [(played ?p2 ?p1 ?t)
     [?e :winner_name ?p1]
     [?e :loser_name ?p2]
     [?e :tourney_name ?t]]])
with the following error
{:type java.lang.Exception,
    :message
    "processing rule: (q__355 ?t), message: processing clause: (played ?c__344 ?c__345 ?t), message: processing rule: [played ?p1 ?p2 ?t], message: processing clause: [?e :winner_name ?p1], message: :db.error/not-an-entity Unable to resolve entity: :winner_name",
    :at [datomic.datalog$eval_rule$fn__6648 invoke "datalog.clj" 1459]}
   {:type java.lang.Exception,
    :message
    "processing clause: (played ?c__344 ?c__345 ?t), message: processing rule: [played ?p1 ?p2 ?t], message: processing clause: [?e :winner_name ?p1], message: :db.error/not-an-entity Unable to resolve entity: :winner_name",
    :at
    [datomic.datalog$eval_clause$fn__6622 invoke "datalog.clj" 1405]}

nottmey18:05:58

it sounds like :winner_name is not registered as attribute

1