DLGP (for Datalog Plus) is a textual exchange format at once human-friendly, concise and easy to parse. CoGui provides an editor for this language with syntax highlighting and a navigator.

Switch to graphical and DLGP representation with the factory view is a good way to become familiar with the language. See section The factory view .

DLGP files can also be imported. See section Import from Datalog±

Finally, you can also export the whole project. See section Export to Datalog±


The format can be seen as an extension of the commonly used format for plain Datalog. Datalog± may define four kinds of knowledge elements: 

  • Facts
  • Existential rules
  • Negative constraints
  • Conjunctives queries


As usually in Datalog, variables begin with an upper-case letter and constants with a lower-case letter. We distinguish between regular constants(called constants hereafter) and literals, which are values belonging to some datatype. Literals are given as double-quoted strings or numeric values(integers and floats).
The file name has the extension .dlgp or .dlp. Character encoding is assumed to be UTF-8. 
Complete syntax is described in this paper: DLGP: An extended Datalog Syntax for Existential Rules and Datalog±Version 2.0 


Some examples of different elements are available here


Some examples


Datalog± expressions

Cogui conversion

[a_fact]fatherOf(zeus,apollo),
god(zeus), god(apollo).


Every kinds of knowledge elements can be named with simple strings .

fatherOf(<Zeus>,<Apollo>), 
god(<Zeus>), god(<Apollo>).


Zeus can not be used as a constant name in DLPG language.

belongsTo(<Zeus>,<Greek+pantheon>).


Use + symbol to represent a space in the Datalog constant name.

?:-fatherOf(X,apollo).


Is there someone father of Apollo ?

distance(athens,marathon,42.195),
town(athens),town(marathon).


A ternary predicate with a literal value(float).

distance(athens,marathon,"42km195"),
town(athens),town(marathon).


A ternary predicate with a literal value(string).

distance(athens,marathon,42)
,town(athens),town(marathon).


A ternary predicate with a literal value(int).

siblingOf(Y,X):-siblingOf(X,Y).


A rule to define a symmetric relation.

parentOf(X,Z):-parentOf(X,Y),parentOf(Y,Z).


A rule to define a transitive relation.

god(Y),human(Z),
parentOf(Y,X),parentOf(Z,X):-demigod(X).


A rule with new variables in conclusion (head of the rule).
Unlike safe clauses in classic Datalog, Datalog± accepts new variables in the rule heads.

X=Y:-equals(X,Y).

 
A rule with equality as a conclusion. 
Head (conclusion) part of the rule can contains one or more equality relations between frontier concepts. They are represented as coreference links on the cogui model.


Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor