diff --git a/RELEASE b/RELEASE index 2d38ac017..76f8a577a 100644 --- a/RELEASE +++ b/RELEASE @@ -1,5 +1,6 @@ EYE release +v10.24.0 (2024-09-25) fixing reifiedTriple implementation v10.23.4 (2024-09-25) running with rdf12 reifier v10.23.3 (2024-09-23) fixing makevars zeta v10.23.2 (2024-09-22) fixing log:copy diff --git a/VERSION b/VERSION index 2fea8da85..32521e627 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.23.4 +10.24.0 diff --git a/eye.pl b/eye.pl index d746ecb1b..f1b2e758d 100644 --- a/eye.pl +++ b/eye.pl @@ -22,7 +22,7 @@ :- catch(use_module(library(process)), _, true). :- catch(use_module(library(http/http_open)), _, true). -version_info('EYE v10.23.4 (2024-09-25)'). +version_info('EYE v10.24.0 (2024-09-25)'). license_info('MIT License @@ -2139,7 +2139,7 @@ verb(P, []), object(O, []), [rp_gt_gt]. -pathitem(edge(N, triple(S, P, O)), T) --> +pathitem(edge(N, triple(S, P, O)), ['\'\''(N, triple(S, P, O))|T]) --> [lt_lt], !, subject(S, Ts), diff --git a/eye.zip b/eye.zip index 63280cb7f..254923119 100644 Binary files a/eye.zip and b/eye.zip differ diff --git a/reasoning/dcg/dcg2-pass.n3 b/reasoning/dcg/dcg2-pass.n3 index 732391f41..180511800 100644 --- a/reasoning/dcg/dcg2-pass.n3 +++ b/reasoning/dcg/dcg2-pass.n3 @@ -1,5 +1,5 @@ @prefix : . :parseTree :is { - << :the :np :cat >> :s << :eats :vp << :a :np :bat >> >>. + <<( :the :np :cat )>> :s <<( :eats :vp <<( :a :np :bat )>> )>>. }. diff --git a/reasoning/dcg/dcg2.n3 b/reasoning/dcg/dcg2.n3 index 9e13d448d..c5eb3c817 100644 --- a/reasoning/dcg/dcg2.n3 +++ b/reasoning/dcg/dcg2.n3 @@ -3,8 +3,8 @@ [] log:dcg "sentence(''(NP, VP)) --> noun_phrase(NP), verb_phrase(VP)", - "noun_phrase(edge(_, triple(D, '', N))) --> det(D), noun(N)", - "verb_phrase(edge(_, triple(V, '', NP))) --> verb(V), noun_phrase(NP)", + "noun_phrase(triple(D, '', N)) --> det(D), noun(N)", + "verb_phrase(triple(V, '', NP)) --> verb(V), noun_phrase(NP)", "det('') --> [the]", "det('') --> [a]", "noun('') --> [cat]", diff --git a/reasoning/dcg/dcg3-pass.n3 b/reasoning/dcg/dcg3-pass.n3 index 47909307a..40bb3d95b 100644 --- a/reasoning/dcg/dcg3-pass.n3 +++ b/reasoning/dcg/dcg3-pass.n3 @@ -1,39 +1,39 @@ @prefix : . -:parseTree :is << << << :the a :Determiner >> :nounPhrase << :cat a :Noun >> >> :sentence << << :eats a :Verb >> :verbPhrase << << :a a :Determiner >> :nounPhrase << :bat a :Noun >> >> >> >>. -_:sk_9 a :ParseTree. -_:sk_9 :node :sentence. -_:sk_10 :node :nounPhrase. -_:sk_11 :node :verbPhrase. -_:sk_12 :node . -_:sk_9 :left << << :the a :Determiner >> :nounPhrase << :cat a :Noun >> >>. -_:sk_10 :left << :the a :Determiner >>. -_:sk_11 :left << :eats a :Verb >>. -_:sk_12 :left :cat. -_:sk_9 :right << << :eats a :Verb >> :verbPhrase << << :a a :Determiner >> :nounPhrase << :bat a :Noun >> >> >>. -_:sk_10 :right << :cat a :Noun >>. -_:sk_11 :right << << :a a :Determiner >> :nounPhrase << :bat a :Noun >> >>. -_:sk_12 :right :Noun. -_:sk_10 :parent _:sk_9. -_:sk_11 :parent _:sk_9. -_:sk_12 :parent _:sk_10. -_:sk_13 :node . -_:sk_14 :node . -_:sk_15 :node :nounPhrase. -_:sk_13 :left :the. -_:sk_14 :left :eats. -_:sk_15 :left << :a a :Determiner >>. -_:sk_13 :right :Determiner. -_:sk_14 :right :Verb. -_:sk_15 :right << :bat a :Noun >>. -_:sk_13 :parent _:sk_10. -_:sk_14 :parent _:sk_11. -_:sk_15 :parent _:sk_11. -_:sk_16 :node . -_:sk_17 :node . -_:sk_16 :left :a. -_:sk_17 :left :bat. -_:sk_16 :right :Determiner. -_:sk_17 :right :Noun. -_:sk_16 :parent _:sk_15. -_:sk_17 :parent _:sk_15. +:parseTree :is <<( <<( <<( :the a :Determiner )>> :nounPhrase <<( :cat a :Noun )>> )>> :sentence <<( <<( :eats a :Verb )>> :verbPhrase <<( <<( :a a :Determiner )>> :nounPhrase <<( :bat a :Noun )>> )>> )>> )>>. +_:sk_0 a :ParseTree. +_:sk_0 :node :sentence. +_:sk_1 :node :nounPhrase. +_:sk_2 :node :verbPhrase. +_:sk_3 :node . +_:sk_0 :left <<( <<( :the a :Determiner )>> :nounPhrase <<( :cat a :Noun )>> )>>. +_:sk_1 :left <<( :the a :Determiner )>>. +_:sk_2 :left <<( :eats a :Verb )>>. +_:sk_3 :left :cat. +_:sk_0 :right <<( <<( :eats a :Verb )>> :verbPhrase <<( <<( :a a :Determiner )>> :nounPhrase <<( :bat a :Noun )>> )>> )>>. +_:sk_1 :right <<( :cat a :Noun )>>. +_:sk_2 :right <<( <<( :a a :Determiner )>> :nounPhrase <<( :bat a :Noun )>> )>>. +_:sk_3 :right :Noun. +_:sk_1 :parent _:sk_0. +_:sk_2 :parent _:sk_0. +_:sk_3 :parent _:sk_1. +_:sk_4 :node . +_:sk_5 :node . +_:sk_6 :node :nounPhrase. +_:sk_4 :left :the. +_:sk_5 :left :eats. +_:sk_6 :left <<( :a a :Determiner )>>. +_:sk_4 :right :Determiner. +_:sk_5 :right :Verb. +_:sk_6 :right <<( :bat a :Noun )>>. +_:sk_4 :parent _:sk_1. +_:sk_5 :parent _:sk_2. +_:sk_6 :parent _:sk_2. +_:sk_7 :node . +_:sk_8 :node . +_:sk_7 :left :a. +_:sk_8 :left :bat. +_:sk_7 :right :Determiner. +_:sk_8 :right :Noun. +_:sk_7 :parent _:sk_6. +_:sk_8 :parent _:sk_6. diff --git a/reasoning/dcg/dcg3.n3 b/reasoning/dcg/dcg3.n3 index 748e50757..295206fea 100644 --- a/reasoning/dcg/dcg3.n3 +++ b/reasoning/dcg/dcg3.n3 @@ -2,17 +2,17 @@ @prefix : . [] log:dcg - "sentence(edge(_, triple(NP, '', VP))) --> noun_phrase(NP), verb_phrase(VP)", - "noun_phrase(edge(_, triple(D, '', N))) --> determiner(D), noun(N)", - "verb_phrase(edge(_, triple(V, '', NP))) --> verb(V), noun_phrase(NP)", - "determiner(edge(_, triple('', '', ''))) --> [the]", - "determiner(edge(_, triple('', '', ''))) --> [a]", - "noun(edge(_, triple('', '', ''))) --> [cat]", - "noun(edge(_, triple('', '', ''))) --> [bat]", - "verb(edge(_, triple('', '', ''))) --> [eats]". + "sentence(triple(NP, '', VP)) --> noun_phrase(NP), verb_phrase(VP)", + "noun_phrase(triple(D, '', N)) --> determiner(D), noun(N)", + "verb_phrase(triple(V, '', NP)) --> verb(V), noun_phrase(NP)", + "determiner(triple('', '', '')) --> [the]", + "determiner(triple('', '', '')) --> [a]", + "noun(triple('', '', '')) --> [cat]", + "noun(triple('', '', '')) --> [bat]", + "verb(triple('', '', '')) --> [eats]". {("sentence(S)" ?S) log:phrase ("the" "cat" "eats" "a" "bat")} => {:parseTree :is ?S}. -{:parseTree :is <>} => {[] a :ParseTree; :node ?P; :left ?S; :right ?O}. -{?A :left <>} => {[] :parent ?A; :node ?P; :left ?S; :right ?O}. -{?A :right <>} => {[] :parent ?A; :node ?P; :left ?S; :right ?O}. +{:parseTree :is <<( ?S ?P ?O )>>} => {[] a :ParseTree; :node ?P; :left ?S; :right ?O}. +{?A :left <<( ?S ?P ?O )>>} => {[] :parent ?A; :node ?P; :left ?S; :right ?O}. +{?A :right <<( ?S ?P ?O )>>} => {[] :parent ?A; :node ?P; :left ?S; :right ?O}. diff --git a/reasoning/n3-star/example-pass.n3 b/reasoning/n3-star/example-pass.n3 index fc682002d..15be3c0a4 100644 --- a/reasoning/n3-star/example-pass.n3 +++ b/reasoning/n3-star/example-pass.n3 @@ -3,8 +3,8 @@ :marriedTo a :SymetricRelation. :alice :marriedTo :bob. :bob :marriedTo :alice. -<< :alice :marriedTo :bob >> :since "1999". -<< :bob :marriedTo :alice >> :since "1999". +<<( :alice :marriedTo :bob )>> :since "1999". +<<( :bob :marriedTo :alice )>> :since "1999". :TEST :PASS 1 . :TEST :PASS 2 . :TEST :PASS 3 . diff --git a/reasoning/n3-star/example.n3 b/reasoning/n3-star/example.n3 index 4d27b3c90..be103a817 100644 --- a/reasoning/n3-star/example.n3 +++ b/reasoning/n3-star/example.n3 @@ -1,12 +1,12 @@ @prefix : . {?p a :SymetricRelation. ?s ?p ?o} => {?o ?p ?s}. -{?p a :SymetricRelation. <> ?p2 ?o2} => {<> ?p2 ?o2}. +{?p a :SymetricRelation. <<( ?s ?p ?o )>> ?p2 ?o2} => {<<( ?o ?p ?s )>> ?p2 ?o2}. :marriedTo a :SymetricRelation. :alice :marriedTo :bob. -<<:alice :marriedTo :bob>> :since "1999". +<<( :alice :marriedTo :bob )>> :since "1999". {:bob :marriedTo :alice} => {:TEST :PASS 1}. -{<<:bob :marriedTo :alice>> :since "1999"} => {:TEST :PASS 2}. -{<<:alice ?p :bob>> :since "1999"} => {:TEST :PASS 3}. +{<<( :bob :marriedTo :alice )>> :since "1999"} => {:TEST :PASS 2}. +{<<( :alice ?p :bob )>> :since "1999"} => {:TEST :PASS 3}. diff --git a/reasoning/rdf-star-reasoning/answer.n3 b/reasoning/rdf-star-reasoning/answer.n3 index dd64ab364..d20826141 100644 --- a/reasoning/rdf-star-reasoning/answer.n3 +++ b/reasoning/rdf-star-reasoning/answer.n3 @@ -2,19 +2,19 @@ @prefix owl: . @prefix owlstar: . -<< :x :p :y >> :s :o. -<< :y :q :x >> :s :o. +<<( :x :p :y )>> :s :o. +<<( :y :q :x )>> :s :o. :p owl:inverseOf :q. -<< :x :p :y >> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. -<< :y :p :z >> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. -<< :y :q :x >> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. -<< :z :q :y >> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. -<< :x :p :z >> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. +<<( :x :p :y )>> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. +<<( :y :p :z )>> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. +<<( :y :q :x )>> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. +<<( :z :q :y )>> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. +<<( :x :p :z )>> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. :p a owl:TransitiveProperty. -<< :x :p :y >> :probability 0.89 . -<< :y :q :z >> :probability 0.56 . -<< :y :q :x >> :probability 0.89 . -<< :x :r :z >> :probability 0.49840000000000007 . -<< :x :r :x >> :probability 0.7921 . +<<( :x :p :y )>> :probability 0.89 . +<<( :y :q :z )>> :probability 0.56 . +<<( :y :q :x )>> :probability 0.89 . +<<( :x :r :z )>> :probability 0.49840000000000007 . +<<( :x :r :x )>> :probability 0.7921 . :r owl:propertyChainAxiom (:p :q). -<< :z :q :x >> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. +<<( :z :q :x )>> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. diff --git a/reasoning/rdf-star-reasoning/socrates-pass.n3 b/reasoning/rdf-star-reasoning/socrates-pass.n3 index d41b97130..ce61641d8 100644 --- a/reasoning/rdf-star-reasoning/socrates-pass.n3 +++ b/reasoning/rdf-star-reasoning/socrates-pass.n3 @@ -1,6 +1,6 @@ @prefix : . @prefix rdfs: . -:we :have << :Socrates a :Human >>. -:we :have << :Socrates a :Mortal >>. +:we :have <<( :Socrates a :Human )>>. +:we :have <<( :Socrates a :Mortal )>>. :Human rdfs:subClassOf :Mortal. diff --git a/reasoning/rdf-star-reasoning/socrates.n3 b/reasoning/rdf-star-reasoning/socrates.n3 index ad9b1fb79..31b424e70 100644 --- a/reasoning/rdf-star-reasoning/socrates.n3 +++ b/reasoning/rdf-star-reasoning/socrates.n3 @@ -2,7 +2,7 @@ @prefix rdfs: . @prefix : . -:we :have <<:Socrates rdf:type :Human>>. +:we :have <<( :Socrates rdf:type :Human )>>. :Human rdfs:subClassOf :Mortal. -{?A rdfs:subClassOf ?B. :we :have <>} => {:we :have <>}. +{?A rdfs:subClassOf ?B. :we :have <<( ?S rdf:type ?A )>>} => {:we :have <<( ?S rdf:type ?B )>>}. diff --git a/reasoning/rdf-star-reasoning/test.n3 b/reasoning/rdf-star-reasoning/test.n3 index 86e4ea534..e03bfbf0c 100644 --- a/reasoning/rdf-star-reasoning/test.n3 +++ b/reasoning/rdf-star-reasoning/test.n3 @@ -7,36 +7,36 @@ @prefix : . # Annotations of inverse props are copied over since "inverse" is a hard/simple logical relation -{ <> ?s ?o. +{ <<( ?x ?p ?y )>> ?s ?o. ?p owl:inverseOf ?q. } => { - <> ?s ?o. + <<( ?y ?q ?x )>> ?s ?o. }. # OWLstar interpretation "SomeValuesFrom" of transitive props is copied over. # Doesn't necessarily apply to (combinations of) other interpretations -{ <> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. - <> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. +{ <<( ?x ?p ?y )>> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. + <<( ?y ?p ?z )>> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. ?p a owl:TransitiveProperty. } => { - <> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. + <<( ?x ?p ?z )>> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. }. # Multiplying probabilities of "fuzzy" statements -{ <> :probability ?p1. - <> :probability ?p2. +{ <<( ?x ?p ?y )>> :probability ?p1. + <<( ?y ?q ?z )>> :probability ?p2. ?r owl:propertyChainAxiom (?p ?q). (?p1 ?p2) math:product ?p3. } => { - <> :probability ?p3. + <<( ?x ?r ?z )>> :probability ?p3. }. # test cases -<<:x :p :y>> :s :o. +<<( :x :p :y )>> :s :o. :p owl:inverseOf :q. -<<:x :p :y>> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. -<<:y :p :z>> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. +<<( :x :p :y )>> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. +<<( :y :p :z )>> owlstar:hasInterpretation owlstar:SubClassOfSomeValuesFrom. :p a owl:TransitiveProperty. -<<:x :p :y>> :probability 0.89. -<<:y :q :z>> :probability 0.56. +<<( :x :p :y )>> :probability 0.89. +<<( :y :q :z )>> :probability 0.56. :r owl:propertyChainAxiom (:p :q). diff --git a/reasoning/temp/test b/reasoning/temp/test index 0349541af..3d1516fb3 100755 --- a/reasoning/temp/test +++ b/reasoning/temp/test @@ -1,2 +1,2 @@ #!/bin/bash -eye --quiet --nope edge.ttl --pass --output edge-output.ttl +eye --quiet --nope test.ttl --pass --output test-output.ttl diff --git a/reasoning/temp/edge-output.ttl b/reasoning/temp/test-output.ttl similarity index 73% rename from reasoning/temp/edge-output.ttl rename to reasoning/temp/test-output.ttl index a142c8541..3bcc2332b 100644 --- a/reasoning/temp/edge-output.ttl +++ b/reasoning/temp/test-output.ttl @@ -5,10 +5,15 @@ :s :p << :d :e :f >>. :s :p << :g :h :i ~ :x >>. :s :p :o. -<< :s :p :o >> :j :k. +_:bne_2 rdf:reifies <<( :d :e :f )>>. +:x rdf:reifies <<( :g :h :i )>>. :r rdf:reifies <<( :u :v :w )>>. _:e_s_1 rdf:reifies <<( :u :v :w )>>. _:e_t_1 rdf:reifies <<( :u :v :w )>>. +:r rdf:reifies <<( :a :b _:e_x_1 )>>. +:r rdf:reifies <<( :a :b _:e_y_1 )>>. +:x rdf:reifies <<( :s :p _:bn_1 )>>. +<< :s :p :o >> :j :k. :r :y :z. _:e_s_1 :y :z. _:e_t_1 :y :z. @@ -19,3 +24,5 @@ _:e_t_1 :y :z. << :liz :marriedTo :richard >> :to 2001 . << :a :b _:e_x_1 ~ :r >> :c :d. << :a :b _:e_y_1 ~ :r >> :c :d. +_:bn_1 :q1 "A". +_:bn_1 :q2 "B". diff --git a/reasoning/temp/edge.ttl b/reasoning/temp/test.ttl similarity index 91% rename from reasoning/temp/edge.ttl rename to reasoning/temp/test.ttl index 4636e1d07..a47b551d1 100644 --- a/reasoning/temp/edge.ttl +++ b/reasoning/temp/test.ttl @@ -17,3 +17,5 @@ _:t rdf:reifies <<( :u :v :w )>>; :y :z . << :a :b _:x ~ :r >> :c :d . << :a :b _:y ~ :r >> :c :d . + +<< :s :p [ :q1 "A" ; :q2 "B" ] ~ :x >> .