Fork me on GitHub
#clara
<
2018-03-21
>
talgiat16:03:02

is there a way to query for all types but one?

mikerod16:03:10

@talgiat the main problem I’d see with doing something like that is that the query may become a performance problem

mikerod16:03:40

It would be heavily hit since it’s working memory will change any time any fact in working memory is inserted/retracted (including from truth maintenance)

mikerod16:03:16

You could probably do what you ask though:

(r/defquery []
  [?o <- Object]
  [:test (not (isa? (type ?o) ExcludedType))])

mikerod16:03:32

If you have a custom :fact-type-fn you could still accomplish similar

talgiat16:03:18

I do have a :fact-type-fn

mikerod17:03:23

@talgiat you’d have to define an hierarchy then more than likely

mikerod17:03:43

Potentially you could derive all your types to a common ancestor type.

mikerod17:03:28

You could leave out the excluded type from that grouping too, and then your query would just be r/defquery my-q [] [?x <- :parent-type]

talgiat17:03:53

yeah, thought about that

talgiat17:03:09

prob. better with records implementing a common protocol that will be the parent

mikerod18:03:35

@talgiat it can go either way really