Questions tagged [logiql]

Logic Query Language (LogiQL) is a declarative programming language that extends Datalog.

Logic Query Language (LogiQL) is a declarative programming language derived from Datalog. Its syntax is similar to rule-based languages such as Prolog. Its feature set and semantics extends the academic variant of Datalog with many features useful for practical programming.

It has been developed by LogicBlox Inc for their LogicBlox database engine.

13 questions
5
votes
3 answers

What is the difference between Datalog and LogiQL?

The LogicBlox database is programmed using the LogiQL language, which is according to their site some sort of variant of Datalog: Applications are written using the LogiQL language, an extended version of Datalog What exactly are the differences…
Nanne
  • 64,065
  • 16
  • 119
  • 163
3
votes
1 answer

How do I create a autoNumbered predicate in LogiQL?

I'm wondering how to work with autoNumbered refmode predicates in LogicBlox / LogiQL I followed the example in the manual but then am having trouble asserting facts into the entity predicate, the first one would be added but subsequent attempts…
Ryan W Gough
  • 157
  • 7
2
votes
2 answers

How to query logicblox

I have an entity predicate eg. "Person" with related functional predicates storing attributes about the entity. Eg. Person(x), Person:id(x:s) -> string(s). Person:dateOfBirth[a] = b -> Person(a), datetime(b). Person:height[a] = b -> Person(a),…
Jayd
  • 880
  • 1
  • 12
  • 16
1
vote
1 answer

How do I use entities that have a constructor predicate in TDX in LogiQL

I want to convert an existing entity that uses a refmode into one that has a multidimensional constructor predicate. However, I am unsure of how to update a TDX service that creates those entities. Attempting to use the service unchanged from when…
Ryan W Gough
  • 157
  • 7
0
votes
1 answer

How to avoid materialization of recursive logical predicates in logicblox/logiQL?

I am trying to play around with the features of LogicBlox as a Datalog solver. I have performance issues and I think I am using LB wrong because it behaves as if it is materializing all relations (which a Datalog solver with e.g. magic sets would…
Louis
  • 133
  • 4
0
votes
1 answer

Logical Data Modeling with logiQL

I was following the tutorial named logical data modeling by Terry Halpin (link stated below) but was unable to insert data. https://www.brcommunity.com/articles.php?id=b760 Here is the code: addblock 'Country(c), hasCountryCode(c:cc) ->…
Bayzid
  • 105
  • 11
0
votes
1 answer

How to create autonumbered predicates in .logic files in LogiQL?

I am trying to set up a project with autoNumbered predicates. I couldn't use the lang:autoNumbered option in .logic files as it gave me the error that it expected a constraint or a lang:ordered. So I rewrote my code in a .lb file, which worked. The…
0
votes
1 answer

LB 4.1: uid is not installed

I am trying to use the unique id as described in the Reference Manual. However, I get the following error: Error: P2PMapping defined at block_1Z1C1O1V:4(2)--7(73) requests module 'uid', but no module with that name is installed. How do I install…
meow
  • 27
  • 4
0
votes
1 answer

LogiQL: Use of Transaction ID and Unique Identifiers

I am just getting started with LoqiQL and LogicBlox. While looking at the different operators, I came across the transaction ID and the unique identifiers. What are use cases for these two operators?
meow
  • 27
  • 4
0
votes
2 answers

Querying by Keys with LogicBlox

If I have two predicates (not functional): addblock 'city(city_dim_id) -> int(city_dim_id).' addblock 'city_name[city_dim_id] = name -> int(city_dim_id), string(name).' I can add facts: exec '+city(1).' exec '+city_name[0] = "N/A".' exec…
0
votes
1 answer

Update predicate in master from workbook in loqiql

I am working on a requirement which needs a design to update a predicate@master from one of the workbooks.So, I have added below logic in an inactive block which is invoked for an user action. +predicate2@master[x,y] = flag <- predicate1@prev[x,y] =…
0
votes
2 answers

LogiQL: Find maximum value for predicate

I'm keeping track of dates in a LogiQL predicate: compilation_date[c] = d -> compilation(c), datetime(d). I'd like to find out what was the last performed compilation, i.e. what is the c for which d is the most recent in predicate…
Zef Hemel
  • 6,457
  • 3
  • 20
  • 14
0
votes
2 answers

Get current time in LogiQL

How can I get the specific date and time that a logic file is being executed in LogiQL? What I want essentially is a way to pinpoint the unique time a certain logic is being processed by the engine, in order to use this time as a unique identifier.
Zef Hemel
  • 6,457
  • 3
  • 20
  • 14