SWI-Prolog / packages-semweb

The SWI-Prolog RDF store
28 stars 14 forks source link

Some instantiations of rdf/3 give incorrect results #78

Closed wouterbeek closed 4 years ago

wouterbeek commented 6 years ago

When the same variable was used in the object term position, as well as in the subject and/or predicate term position, object term bindings from the database would not be considered at all.

For example:

?- [library(semweb/rdf11)].
?- rdf_assert(s, p, o).
?- rdf(X, Y, Y).
X = s,
Y = p.
likelion commented 4 years ago

The issue is in the pair of pre_object/2, post_object/2 in library(semweb/rdf11).

?- rdf(X, Y, X).
X = s,
Y = p.

?- rdf(X, X, Y).
false.

and the original library(semweb/rdf_db) works correctly:

?- rdf_db:rdf(X, X, Y).
false.

?- rdf_db:rdf(X, Y, X).
false.

@JanWielemaker: do you think we can fix this before 8.2 release? I will work on PR.

likelion commented 4 years ago

Fixed in #95.

wouterbeek commented 4 years ago

Thanks!