eyereasoner / eye

Euler Yet another proof Engine
https://eyereasoner.github.io/eye/
MIT License
125 stars 17 forks source link

list in turtle files #103

Closed giacomociti closed 5 months ago

giacomociti commented 7 months ago

the following rule:

# rule.n3
@prefix : <http://www.example.org/> .

{ :a :b ?x } => { :c :d ?x } .

applied to:

# data.ttl
@prefix : <http://www.example.org/> .

:a :b (:1 :2 :3) .

fails when using the --turtle option

 eye --nope --quiet --pass-only-new --turtle data.ttl rule.n3 

ERROR gre ** malformed_list_invalid_rest(http://www.w3.org/1999/02/22-rdf-syntax-ns#nil)

giacomociti commented 5 months ago

I can provide an even simpler repro

# data.ttl
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix : <http://ex.org/> .

# :x :items () . # ok
# :x :items rdf:nil . # ok
:x :items (1) . # ERROR
# :x :items [ rdf:first 1 ; rdf:rest rdf:nil]  .  # ERROR
# :x :items [ rdf:first 1 ; rdf:rest ()]  .  # ERROR
eye --nope --quiet --pass --turtle data.ttl 

using: EYE v9.7.10 (2024-02-10) SWI-Prolog version 9.0.4

josd commented 5 months ago

Ooops... didn't get your original message on Feb 12 but now got it. It should now be fixed in EYE v10.2.19.

giacomociti commented 5 months ago

Great! Thanks a lot

giacomociti commented 3 months ago

hi @josd, I have another little problem with --turtle and lists:

# data.ttl
@prefix : <http:/example.org/> .

:a :b (1) .
# rules.n3
@prefix list: <http://www.w3.org/2000/10/swap/list#> .
@prefix : <http:/example.org/> .

{
    :a :b ?list .
    ?list list:firstRest (?first ?rest) .
}
=>
{
    ?first :rest ?rest .
} .

the command eye --nope --quiet rules.n3 data.ttl --pass-only-new correctly returns 1 :rest ()..But using --turtle to parse the data there is no result.

josd commented 3 months ago

Thanks for finding @giacomociti and it is now fixed in EYE v10.16.1:

$ eye --nope --quiet rules.n3 --turtle data.ttl --pass-only-new
@prefix : <http:/example.org/>.

1 :rest ().