packages-semweb
packages-semweb copied to clipboard
CHR-friendly RDF library
CHR and RDF do not play well together ATM. This is because of the following reasons:
- RDF prefix expansion does not work in CHR rules.
- The CHR store does not use the RDF database and has to copy RDF statements that are used in CHR processing.
- CHR and RDF declare the same operator
@. @JanWielemaker suggests to define@@as an alias for CHR labels.
Reproducing the @-error
Loading the following program:
:- use_module(library(chr)).
:- use_module(library(rdf11/rdf11)).
:- chr_constraint leq/2.
label @ leq(X, Y) \ leq(X, Y) <=> true.
gives:
================================================================================
CHR compiler ERROR: invalid syntax "idempotence@leq(_G20253,_G20254)".
`--> Undeclared constraint _G20259/_G20260 in head of rule number 1 (line 7).
Constraint should be one of [leq/2].
================================================================================
The use of @ for label annotations in CHR is an established practice. Any way around this?