Querying facts database with records

See mail post above this. Dictionaries are not useful for your case. The way to go is to use a predicate with flat facts and some goal expansion mechanism that rewrites a term with named variables to the proper goal as I explained above. Using dicts for this representation is a good option, so you’re program looks like

...,
user{location:"Vienna", name:Name},
...

and compiles to e.g.,

user(_, _, "Vienna", _, Name, _, _, _),

Note that for indexing, atoms are faster than strings as atoms just look at the handle and strings actually need to access the text.

1 Like