Skip to content

Commit

Permalink
fixing graph: and log: built-ins to deal with rdflegacy
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Nov 14, 2023
1 parent 8ad54e9 commit f885afd
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 34 deletions.
1 change: 1 addition & 0 deletions RELEASE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
EYE release

v8.6.6 (2023-11-14) fixing graph: and log: built-ins to deal with rdflegacy
v8.6.5 (2023-11-13) running sdcoding example in rdflegacy
v8.6.4 (2023-11-13) running gps example in rdflegacy
v8.6.3 (2023-11-11) automatic interpretation of variables for rdflegacy
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.6.5
8.6.6
92 changes: 59 additions & 33 deletions eye.pl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
:- use_module(library(pcre)).
:- catch(use_module(library(http/http_open)), _, true).

version_info('EYE v8.6.5 (2023-11-13)').
version_info('EYE v8.6.6 (2023-11-14)').

license_info('MIT License

Expand Down Expand Up @@ -6410,7 +6410,8 @@
when(
( nonvar(A)
),
( makevars(A, C, delta),
( map(getconj, A, Ah),
makevars(Ah, C, delta),
difference(C, B)
)
).
Expand All @@ -6419,15 +6420,17 @@
when(
( nonvar(A)
),
( intersect(A, B)
( map(getconj, A, Ah),
intersect(Ah, B)
)
).

'<http://www.w3.org/2000/10/swap/graph#length>'(A, B) :-
when(
( nonvar(A)
),
( conj_list(A, D),
( getconj(A, Ag),
conj_list(Ag, D),
( ground(D)
-> distinct(D, C)
; C = D
Expand All @@ -6437,13 +6440,15 @@
).

'<http://www.w3.org/2000/10/swap/graph#list>'(A, B) :-
conj_list(A, B).
getconj(A, Ag),
conj_list(Ag, B).

'<http://www.w3.org/2000/10/swap/graph#member>'(A, B) :-
when(
( nonvar(A)
),
( conj_list(A, C),
( getconj(A, Ag),
conj_list(Ag, C),
member(B, C)
)
).
Expand Down Expand Up @@ -6880,7 +6885,8 @@
when(
( nonvar(A)
),
( reset_gensym,
( getconj(A, Ag),
reset_gensym,
tmp_file(Tmp1),
open(Tmp1, write, Ws1, [encoding(utf8)]),
tell(Ws1),
Expand All @@ -6892,8 +6898,8 @@
),
nl
),
labelvars(A, 0, _),
wt(A),
labelvars(Ag, 0, _),
wt(Ag),
write('.'),
nl,
told,
Expand Down Expand Up @@ -6944,7 +6950,8 @@
when(
( nonvar(A)
),
( conjoin(A, M),
( map(getconj, A, Ah),
conjoin(Ah, M),
unify(M, B)
)
).
Expand Down Expand Up @@ -7126,23 +7133,20 @@
)
).

'<http://www.w3.org/2000/10/swap/log#implies>'(X, Y) :-
( nonvar(Y),
Y = set([Z])
-> true
; Z = Y
),
'<http://www.w3.org/2000/10/swap/log#implies>'(A, B) :-
getconj(A, X),
getconj(B, Y),
implies(U, V, _),
unify(U, X),
unify(V, Z),
( commonvars(X, Z, [])
-> labelvars(Z, 0, _, avar)
unify(V, Y),
( commonvars(X, Y, [])
-> labelvars(Y, 0, _, avar)
; true
),
( var(Z)
( var(Y)
-> true
; Z \= answer(_, _, _),
Z \= (answer(_, _, _), _)
; Y \= answer(_, _, _),
Y \= (answer(_, _, _), _)
).

'<http://www.w3.org/2000/10/swap/log#imports>'(_, X) :-
Expand Down Expand Up @@ -7178,7 +7182,8 @@
when(
( nonvar(Y)
),
( Y
( getconj(Y, Yg),
call(Yg)
)
).
'<http://www.w3.org/2000/10/swap/log#includes>'(X, Y) :-
Expand All @@ -7187,8 +7192,10 @@
nonvar(Y)
),
( X \= [_, _],
conj_list(X, A),
conj_list(Y, B),
getconj(X, Xg),
getconj(Y, Yg),
conj_list(Xg, A),
conj_list(Yg, B),
includes(A, B)
)
).
Expand All @@ -7199,25 +7206,29 @@
when(
( nonvar(Y)
),
( \+ \+call(Y)
( getconj(Y, Yg),
\+ \+call(Yg)
)
).
'<http://www.w3.org/2000/10/swap/log#includesNotBind>'(X, Y) :-
when(
( nonvar(X),
nonvar(Y)
),
( conj_list(X, A),
conj_list(Y, B),
( getconj(X, Xg),
getconj(Y, Yg),
conj_list(Xg, A),
conj_list(Yg, B),
\+ \+includes(A, B)
)
).

'<http://www.w3.org/2000/10/swap/log#inferences>'(A, B) :-
'<http://www.w3.org/2000/10/swap/log#conclusion>'(A, C),
( nonvar(B)
-> intersect([B, C], M),
unify(M, B)
-> getconj(B, Bg),
intersect([Bg, C], M),
unify(M, Bg)
; B = C
).

Expand Down Expand Up @@ -7307,7 +7318,8 @@
when(
( nonvar(Y)
),
( \+call(Y)
( getconj(Y, Yg),
\+call(Yg)
)
).
'<http://www.w3.org/2000/10/swap/log#notIncludes>'(X, Y) :-
Expand All @@ -7316,8 +7328,10 @@
nonvar(Y)
),
( X \= [_, _],
conj_list(X, A),
conj_list(Y, B),
getconj(X, Xg),
getconj(Y, Yg),
conj_list(Xg, A),
conj_list(Yg, B),
\+includes(A, B)
)
).
Expand Down Expand Up @@ -12227,6 +12241,8 @@
!.
getterm([], []) :-
!.
getterm('<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>', []) :-
!.
getterm([A|B], [C|D]) :-
getterm(A, C),
!,
Expand All @@ -12242,6 +12258,9 @@
getterm(D, E),
B =.. [C|E].

getconj(A, A) :-
var(A),
!.
getconj([], true) :-
!.
getconj([[S, P, O]], A) :-
Expand All @@ -12266,6 +12285,13 @@
nonvar(A),
with_output_to_chars(wg(A), B).

map(_, [], []) :-
!.
map(A, [B|C], [D|E]) :-
F =.. [A, B, D],
call(F),
map(A, C, E).

preformat([], []) :-
!.
preformat([literal(A, type('<http://www.w3.org/2001/XMLSchema#string>'))|B], [A|D]) :-
Expand Down
Binary file modified eye.zip
Binary file not shown.

0 comments on commit f885afd

Please sign in to comment.