SWI-Prolog / packages-semweb

The SWI-Prolog RDF store
29 stars 15 forks source link

CHR-friendly RDF library #30

Open wouterbeek opened 8 years ago

wouterbeek commented 8 years ago

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?