Skip to content

Commit

Permalink
fixing output for looking-through-rdf-glasses
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Nov 16, 2023
1 parent 19f8ad1 commit 5343086
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 16 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.10 (2023-11-16) fixing output for looking-through-rdf-glasses
v8.6.9 (2023-11-16) rdflegacy is now rdflanguage and --legacy is not needed anymore
v8.6.8 (2023-11-15) using qnames in the output of urn: uris
v8.6.7 (2023-11-14) further fixing graph: and log: built-ins to deal with rdflegacy
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.6.9
8.6.10
46 changes: 31 additions & 15 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.9 (2023-11-16)').
version_info('EYE v8.6.10 (2023-11-16)').

license_info('MIT License

Expand Down Expand Up @@ -418,8 +418,8 @@
; true
),
args(Args),
( flag(rdflanguage)
-> rdflanguage
( flag(looking_through_rdf_glasses)
-> looking_through_rdf_glasses
; true
),
( flag(blogic)
Expand Down Expand Up @@ -481,7 +481,7 @@
\+query(_, _),
\+flag('pass-only-new'),
\+flag(strings),
\+flag(rdflanguage),
\+flag(looking_through_rdf_glasses),
\+flag(blogic)
-> throw(halt(0))
; true
Expand Down Expand Up @@ -620,7 +620,7 @@
% RDF Language
%

rdflanguage :-
looking_through_rdf_glasses :-
% create list terms
( pred(P),
P \= '<http://www.w3.org/1999/02/22-rdf-syntax-ns#first>',
Expand Down Expand Up @@ -1462,8 +1462,8 @@
Triple =.. [Predicate, Subject, Object],
djiti_assertz(Triple),
( Predicate = '<http://eyereasoner.github.io/rule#premise>',
\+flag(rdflanguage)
-> assertz(flag(rdflanguage))
\+flag(looking_through_rdf_glasses)
-> assertz(flag(looking_through_rdf_glasses))
; true
),
( flag(intermediate, Out)
Expand Down Expand Up @@ -1524,8 +1524,8 @@
; true
),
( Rt = '<http://eyereasoner.github.io/rule#premise>'(_, _),
\+flag(rdflanguage)
-> assertz(flag(rdflanguage))
\+flag(looking_through_rdf_glasses)
-> assertz(flag(looking_through_rdf_glasses))
; true
),
( functor(Rt, F, _),
Expand Down Expand Up @@ -2607,8 +2607,8 @@
{ prolog_verb(Item, Verb),
( atomic(Verb),
Verb = '\'<http://eyereasoner.github.io/rule#premise>\'',
\+flag(rdflanguage)
-> assertz(flag(rdflanguage))
\+flag(looking_through_rdf_glasses)
-> assertz(flag(looking_through_rdf_glasses))
; true
),
( atomic(Verb),
Expand Down Expand Up @@ -4640,11 +4640,21 @@
-> write('"'),
writeq(X),
write('"')
; wg(S),
; ( flag(looking_through_rdf_glasses),
\+nb_getval(indentation, 0)
-> write('(')
; true
),
wg(S),
write(' '),
wp(P),
write(' '),
wg(O)
wg(O),
( flag(looking_through_rdf_glasses),
\+nb_getval(indentation, 0)
-> write(')')
; true
)
).

wtn(exopred(P, S, O)) :-
Expand Down Expand Up @@ -4707,7 +4717,10 @@
; F = ':-'
)
)
-> write('{'),
-> ( flag(looking_through_rdf_glasses)
-> write('(')
; write('{')
),
indentation(4),
( flag(strings)
-> true
Expand All @@ -4732,7 +4745,10 @@
indent
)
),
write('}')
( flag(looking_through_rdf_glasses)
-> write(')')
; write('}')
)
; wt(X)
).

Expand Down
Binary file modified eye.zip
Binary file not shown.
3 changes: 3 additions & 0 deletions looking-through-rdf-glasses/temp/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---------------------------
Looking through RDF glasses
---------------------------
8 changes: 8 additions & 0 deletions looking-through-rdf-glasses/temp/out/union.ttl.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@prefix : <urn:example:>.

(((:A :B :C) (:A :X :C) (:D :E :F)) ((:A :Y :C))) :union (
(:A :B :C).
(:A :X :C).
(:D :E :F).
(:A :Y :C).
).
2 changes: 2 additions & 0 deletions looking-through-rdf-glasses/temp/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash -x
eye --quiet --nope union.ttl --output out/union.ttl.out
24 changes: 24 additions & 0 deletions looking-through-rdf-glasses/temp/union.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@prefix graph: <http://www.w3.org/2000/10/swap/graph#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix rule: <http://eyereasoner.github.io/rule#>.
@prefix : <urn:example:>.

:Let :param1 (
(:A :B :C)
(:A :X :C)
(:D :E :F)
).

:Let :param2 (
(:A :Y :C)
).

[] a rule:QueryRule;
rule:premise (
(:Let :param1 _:X1)
(:Let :param2 _:X2)
((_:X1 _:X2) graph:union _:Y)
);
rule:conclusion (
((_:X1 _:X2) :union _:Y)
).

0 comments on commit 5343086

Please sign in to comment.