In the new version of logicblox (any version later than 4.2.1), if there is a predicate "Person(p), hasPNr(p:n) -> int(n)." And I insert an data "+Person(p),+hasPNr[p]=1." Then if I want to delete data by "-Person(1)." There will be an warning message " WARNING : expression '1' has type 'int', but a value of type 'Person' is needed. The compiler has inserted a use of the predicate 'hasPNr' to allow the code to compile." How can I delete the data without this message?
Asked
Active
Viewed 120 times
1 Answers
2
You can delete by:
-Person(n) <- Person:hasPNr@prev(n, 1).
You should probably modify the way you do inserts as well. The feature in the compiler converting a "1" into a "Person", is called "refmode conversion". That feature is actually being removed because it often causes confusion (as it has already in your case :) ) So to insert without refmode conversion:
+Person(n), +Person:hasPnr(n, 1).

Shan Shan Huang
- 183
- 3
-
Thank you! Is there any way that can delete all data once? like delete all person in Person? – jitron Jul 20 '15 at 21:09
-
Sure. You can do: -Person(n) <- Person@prev(n). – Shan Shan Huang Jul 20 '15 at 23:48