packages-semweb icon indicating copy to clipboard operation
packages-semweb copied to clipboard

CHR-friendly RDF library

Open wouterbeek opened this issue 9 years ago • 0 comments

CHR and RDF do not play well together ATM. This is because of the following reasons:

  1. RDF prefix expansion does not work in CHR rules.
  2. The CHR store does not use the RDF database and has to copy RDF statements that are used in CHR processing.
  3. 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?

wouterbeek avatar May 27 '16 13:05 wouterbeek