Skip to content

Commit

Permalink
new command line option --rdf-list-output to output lists as RDF lists
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Mar 1, 2023
1 parent f6314b3 commit 53e5e1f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
1 change: 1 addition & 0 deletions RELEASE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
EYE release

[v3.4.0] new command line option --rdf-list-output to output lists as RDF lists
[v3.3.6] reverting simplified RDF list handling
[v3.3.5] simplifying RDF list handling
[v3.3.4] fixing issue https://github.com/eyereasoner/eye/issues/66
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.6
3.4.0
29 changes: 17 additions & 12 deletions eye.pl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
:- use_module(library(semweb/turtle)).
:- catch(use_module(library(http/http_open)), _, true).

version_info('EYE v3.3.6 josd').
version_info('EYE v3.4.0 josd').

license_info('MIT License

Expand Down Expand Up @@ -75,6 +75,7 @@
--quantify <prefix> quantify uris with <prefix> in the output
--quiet quiet mode
--random-seed create random seed for e:random built-in
--rdf-list-output output lists as RDF lists
--restricted restricting to core built-ins
--rule-histogram output rule histogram info on stderr
--skolem-genid <genid> use <genid> in Skolem IRIs
Expand Down Expand Up @@ -1021,6 +1022,11 @@
N is random(2^120),
nb_setval(random, N),
opts(Argus, Args).
opts(['--rdf-list-output'|Argus], Args) :-
!,
retractall(flag('rdf-list-output')),
assertz(flag('rdf-list-output')),
opts(Argus, Args).
opts(['--restricted'|Argus], Args) :-
!,
retractall(flag(restricted)),
Expand Down Expand Up @@ -1413,6 +1419,8 @@
)
; ( Rt \= implies(_, _, _),
Rt \= scount(_),
Rt \= '<http://www.w3.org/1999/02/22-rdf-syntax-ns#first>'(_, _),
Rt \= '<http://www.w3.org/1999/02/22-rdf-syntax-ns#rest>'(_, _),
\+flag('no-distinct-input'),
call(Rt)
-> true
Expand Down Expand Up @@ -1619,6 +1627,8 @@
throw(builtin_redefinition(Rt))
),
( Rt \= implies(_, _, _),
Rt \= '<http://www.w3.org/1999/02/22-rdf-syntax-ns#first>'(_, _),
Rt \= '<http://www.w3.org/1999/02/22-rdf-syntax-ns#rest>'(_, _),
\+flag('no-distinct-input'),
call(Rt)
-> true
Expand Down Expand Up @@ -2179,7 +2189,7 @@
literal(Atom, DtLang),
!.
pathitem(Subject, Triples) -->
['[',name(id)],
['[', name(id)],
!,
expression(Subject, T1),
propertylist(Subject, T2),
Expand Down Expand Up @@ -3860,7 +3870,10 @@
write(' true').
wt0([]) :-
!,
write('()').
( flag('rdf-list-output')
-> write('<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>')
; write('()')
).
wt0(X) :-
number(X),
!,
Expand Down Expand Up @@ -4056,7 +4069,7 @@
).
wt2([X|Y]) :-
!,
( \+last_tail([X|Y], [])
( flag('rdf-list-output')
-> write('[ '),
wt0('<http://www.w3.org/1999/02/22-rdf-syntax-ns#first>'),
write(' '),
Expand Down Expand Up @@ -10828,14 +10841,6 @@
split(A, [B|C], D, [B|E]) :-
split(A, C, D, E).

last_tail([], []) :-
!.
last_tail([_|B], B) :-
\+is_list(B),
!.
last_tail([_|B], C) :-
last_tail(B, C).

sub_list(A, A) :-
!.
sub_list([A|B], C) :-
Expand Down
Binary file modified eye.zip
Binary file not shown.

0 comments on commit 53e5e1f

Please sign in to comment.