Skip to content

Commit

Permalink
fixing rdfreasoning for variable conclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Nov 21, 2023
1 parent dc3f020 commit 96f9d08
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 3 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.16 (2023-11-21) fixing rdfreasoning for variable conclusions
v8.6.15 (2023-11-20) taking out sequents in blogic and checking if list-of-3-tuples are unambigous for all built-ins used in rdfreasoning
v8.6.14 (2023-11-20) renaming recent work to rdfreasoning
v8.6.13 (2023-11-18) beautifying output for looking-through-rdf-glasses
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.6.15
8.6.16
16 changes: 14 additions & 2 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.15 (2023-11-20)').
version_info('EYE v8.6.16 (2023-11-21)').

license_info('MIT License

Expand Down Expand Up @@ -5379,6 +5379,14 @@
djiti_conc(answer((A, B), void, void), (answer(A, void, void), D)) :-
!,
djiti_conc(answer(B, void, void), D).
djiti_conc(answer(A, void, void), answer(B, void, void)) :-
is_lott(A),
!,
getconj(A, B).
djiti_conc(A, B) :-
is_lott(A),
!,
getconj(A, B).
djiti_conc(A, A).

djiti_fact(answer(P, S, O), answer(P, S, O)) :-
Expand Down Expand Up @@ -7512,7 +7520,11 @@
wg(U),
write(' TRACE '),
copy_term_nat(Y, V),
wg(V),
( number(X),
X < 0
-> fm(V)
; wg(V)
),
nl,
told,
( flag('output', Output)
Expand Down
Binary file modified eye.zip
Binary file not shown.
5 changes: 5 additions & 0 deletions rdfreasoning/unpack/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---------
Packaging
---------

An example of packaging and unpackaging in RDF.
4 changes: 4 additions & 0 deletions rdfreasoning/unpack/out/unpack.ttl.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@prefix : <urn:example:>.

:a :b _:e_c_1
:u :v _:e_w_1.
2 changes: 2 additions & 0 deletions rdfreasoning/unpack/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash -x
eye --quiet --nope unpack.ttl --output out/unpack.ttl.out
92 changes: 92 additions & 0 deletions rdfreasoning/unpack/unpack.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix rule: <http://eyereasoner.github.io/rule#>.
@prefix : <urn:example:>.

# sample data from RubenD
_:b1 :data (
(_:b2 :package (
(_:b3 :content (
(:a :b _:c)
(_:b4 :package (
(_:b5 :content (
(:u :v _:w)
(_:b6 :package (
(_:b7 :content (
(:x :y _:z)
))
(_:b7 :usable_until :yesterday)
))
(_:b6 :tag :invalid)
))
(_:b5 :usable_until :tomorrow)
(_:b5 :p :o)
))
(_:b4 :tag :valid)
))
(_:b3 :usable_until :next_week)
))
(_:b2 :tag :valid)
).

# the logic for unpack using backward rules
[] a rule:BackwardRule;
rule:premise ();
rule:conclusion (
(() :unpackLott ())
).

[] a rule:BackwardRule;
rule:premise (
(_:g list:firstRest (_:f _:r))
(_:f :unpack _:a)
(_:r :unpackLott _:b)
((_:a _:b) list:append _:h)
);
rule:conclusion (
(_:g :unpackLott _:h)
).

[] a rule:BackwardRule;
rule:premise (
(_:p list:member (_:a :content _:c))
(_:p list:member (_:a :usable_until _:t))
((:tomorrow :next_week) list:member _:t)
(_:c :unpackLott _:f)
);
rule:conclusion (
((_:b :package _:p) :unpack _:f)
).

[] a rule:BackwardRule;
rule:premise (
(_:p list:member (_:a :content _:c))
(_:p list:member (_:a :usable_until _:t))
((:yesterday :last_week) list:member _:t)
);
rule:conclusion (
((_:b :package _:p) :unpack ())
).

[] a rule:BackwardRule;
rule:premise ();
rule:conclusion (
((_:b :tag _:p) :unpack ())
).

[] a rule:BackwardRule;
rule:premise (
((_:g) list:notMember (_:a :package _:p))
((_:g) list:notMember (_:b :tag _:q))
);
rule:conclusion (
(_:g :unpack (_:g))
).

# unpack the triples that are usable in the future
[] a rule:QueryRule;
rule:premise (
(_:b :data _:g)
(_:g :unpackLott _:m)
);
rule:conclusion _:m.

0 comments on commit 96f9d08

Please sign in to comment.