Skip to content

Commit

Permalink
fixing rdfsurfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Jul 15, 2024
1 parent d13a6d9 commit 596f417
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.5.7
5.5.8
30 changes: 28 additions & 2 deletions retina.pl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
:- dynamic('<http://www.w3.org/2000/10/swap/log#onNegativeAnswerSurface>'/2).
:- dynamic('<http://www.w3.org/2000/10/swap/log#onQuerySurface>'/2).

version_info('retina v5.5.7 (2024-07-15)').
version_info('retina v5.5.8 (2024-07-16)').

% run
run :-
Expand Down Expand Up @@ -580,6 +580,10 @@
catch(findall(A, B, E), _, E = []),
E = C.

'<http://www.w3.org/2000/10/swap/log#conjunction>'(A, B) :-
nonvar(A),
conjoin(A, B).

'<http://www.w3.org/2000/10/swap/log#equalTo>'(X, Y) :-
X = Y.

Expand Down Expand Up @@ -960,6 +964,13 @@
conj_list((A, B), [A|C]) :-
conj_list(B, C).

conj_append(A, true, A) :-
!.
conj_append((A, B), C, (A, D)) :-
conj_append(B, C, D),
!.
conj_append(A, B, (A, B)).

% exopred(?Predicate,?Subject,?Object)
% True when an ?Predicate exists that matches ?Preficate(?Subject,?Object)
% E.g. exopred(X,'<http://example.org/ns#Alice>', '<http://example.org/ns#Person>').
Expand Down Expand Up @@ -992,7 +1003,6 @@
% Y = 'exopred(_A,42,_B)'
makevars(A, B, C) :-
list_to_set(C, D),
findvars(D, G),
findall([X, _],
( member(X, D)
),
Expand Down Expand Up @@ -1190,6 +1200,22 @@
; intersect(B, C, D)
).

% conjoin(+List, -Conj)
conjoin([X], X) :-
!.
conjoin([true|Y], Z) :-
conjoin(Y, Z),
!.
conjoin([X|Y], Z) :-
conjoin(Y, U),
conj_append(X, U, V),
( ground(V)
-> conj_list(V, A),
list_to_set(A, B),
conj_list(Z, B)
; Z = V
).

%%%
% debugging tools
%
Expand Down

0 comments on commit 596f417

Please sign in to comment.