Open mikko-ahonen opened 3 months ago
Hello @mikko-ahonen !
Thank you for clear instructions to reproduce the error!
Yes, this is exected. Raw SQLite is generally missing some functions that advanced Logica functions need to be implemented, so Logica is enriching SQLite with more functions from Python. This includes MagicalEntangle
function
which is used to disambiguate scope in aggregating expressions. You are using negation, which is implemented via aggregating expression and thus getting this error.
You can run only very simple programs via sqlite3 binary.
It is supposed that you'd run Logica program directly with logica like so:
$ python3 -m logica foo.l run CountNotE1
+-------+
| count |
+-------+
| 1 |
+-------+
Btw, in the rule Bar(id:id, name:name) :- Foo(id:"E1", name:);
you don't have variable id
assigned. It's probably intended to be as such Bar(id:id, name:name) :- Foo(id:, name:), id = "E1";
.
Is this is a workable method for you?
If not, I'd be curious to learn about your usecase and we can try to find a solution.
Thank you! Evgeny.
This is not really a problem for me, as I am executing the queries from python.
But I think this could bite others starting with the product. I would expect "print" command to print out sufficient functions so that I can copy paste the code into the SQLite command line tool.
This would help the debugging.
But like said, this is not blocking me or anything.
Just to add, I imagine typically people who are taking the product for a spin would do exactly like I did. So they probably use print because that shows you exactly what is happening, and then you can copy-paste it to command line SQL client. Also using SQLite is probably the first option because it does not require you to set iany server up. In many places in the public docs it appears as if only BigTable is supported which was a huge blocker for me. Luckily I tried it out anyway.
Yeah, that's a good point. I'll be clean up docs asap. Thank you!
I am having an issue with sqlite database. I just installed fresh logica and sqlite3 (pip install logica, apt install sqlite3) on Debian.