From: <jm...@us...> - 2010-03-14 12:29:37
|
Revision: 1300 http://eulergui.svn.sourceforge.net/eulergui/?rev=1300&view=rev Author: jmvanel Date: 2010-03-14 12:29:29 +0000 (Sun, 14 Mar 2010) Log Message: ----------- add example optional.n3 Added Paths: ----------- trunk/eulergui/examples/optional.n3 trunk/eulergui/examples/optional.n3p Added: trunk/eulergui/examples/optional.n3 =================================================================== --- trunk/eulergui/examples/optional.n3 (rev 0) +++ trunk/eulergui/examples/optional.n3 2010-03-14 12:29:29 UTC (rev 1300) @@ -0,0 +1,18 @@ +@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#> . +@prefix foaf: <http://xmlns.com/foaf/0.1/> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix : <http://example.com#> . + +# One can use e:optional to match a criterium and succeed anyway +# works with Euler; does not work with Drools + +:p1 foaf:name "X" + ; rdfs:label "XL" . +:p2 foaf:name "Y" . + +{ + ?P foaf:name ?N . + _:d e:optional { ?P rdfs:label ?L } . +} => { + :result :is ( ?P "rdfs:label" ?L " ; foaf:name" ?N ) . +}. \ No newline at end of file Added: trunk/eulergui/examples/optional.n3p =================================================================== --- trunk/eulergui/examples/optional.n3p (rev 0) +++ trunk/eulergui/examples/optional.n3p 2010-03-14 12:29:29 UTC (rev 1300) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<java version="1.6.0_18" class="java.beans.XMLDecoder"> + <object class="eulergui.project.Project"> + <void property="n3Query"> + <object class="eulergui.project.N3Source"> + <void property="URI"> + <string>./catch_allQ.n3</string> + </void> + </object> + </void> + <void property="sources"> + <void method="put"> + <string>./optional.n3</string> + <object class="eulergui.project.N3Source"> + <void property="URI"> + <string>./optional.n3</string> + </void> + </object> + </void> + </void> + </object> +</java> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-03-18 10:13:49
|
Revision: 1330 http://eulergui.svn.sourceforge.net/eulergui/?rev=1330&view=rev Author: jmvanel Date: 2010-03-18 10:13:42 +0000 (Thu, 18 Mar 2010) Log Message: ----------- add examples to show the use of log:includes and @keywords (from N3 specification) Added Paths: ----------- trunk/eulergui/examples/log_includes.n3 trunk/eulergui/examples/log_includes2.n3 Added: trunk/eulergui/examples/log_includes.n3 =================================================================== --- trunk/eulergui/examples/log_includes.n3 (rev 0) +++ trunk/eulergui/examples/log_includes.n3 2010-03-18 10:13:42 UTC (rev 1330) @@ -0,0 +1,18 @@ +@prefix log: <http://www.w3.org/2000/10/swap/log#>. +@prefix : <http://jos.org#>. +@keywords. + +# this example shows the use of @keywords to avoid writing : before every term. + +Bob lives Boston. +Bob wrote { Boston weather sunny }. +Alice lives Adelaide. +Alice wrote { Boston weather cold }. + +@forAll x, y, z, w. +{ x wrote y. + y log:includes {z weather w}. + x lives z +} log:implies { + z weather w +} . Added: trunk/eulergui/examples/log_includes2.n3 =================================================================== --- trunk/eulergui/examples/log_includes2.n3 (rev 0) +++ trunk/eulergui/examples/log_includes2.n3 2010-03-18 10:13:42 UTC (rev 1330) @@ -0,0 +1,23 @@ +@prefix log: <http://www.w3.org/2000/10/swap/log#>. +@prefix : <http://jos.org#>. +@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#> . + +# cf http://www.w3.org/DesignIssues/N3Logic +# This means: "We believe statements about the weather at a place only from people who live there." +# Works only with Euler. + +:Bob :lives :Boston. +:Bob :wrote {:Boston :weather :sunny}. + +:Alice :lives :Adelaide. +:Alice :wrote {:Boston :weather :cold}. + + +{ ?x :wrote ?y. + ?y log:includes {?z :weather ?w}. + ?x :lives ?z +} log:implies { + ?z :weather ?w +} . + +# expected ==> :Boston :weather :sunny . This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-03-23 21:22:01
|
Revision: 1344 http://eulergui.svn.sourceforge.net/eulergui/?rev=1344&view=rev Author: jmvanel Date: 2010-03-23 21:21:55 +0000 (Tue, 23 Mar 2010) Log Message: ----------- swrl-n3-rules.n3: At last ! I could do recursive variable substitution: from {:x :sibling :y} :substituteVariableList ( (:x ?X)(:y ?Y) ) . to: ({_:sk1 :sibling :y} (:y _:sk12)) :variableSubstitution {_:sk1 :sibling _:sk12} Modified Paths: -------------- trunk/eulergui/examples/swrl-n3-rules.n3 trunk/eulergui/examples/swrl-n3-rulesQ.n3 Modified: trunk/eulergui/examples/swrl-n3-rules.n3 =================================================================== --- trunk/eulergui/examples/swrl-n3-rules.n3 2010-03-23 18:38:34 UTC (rev 1343) +++ trunk/eulergui/examples/swrl-n3-rules.n3 2010-03-23 21:21:55 UTC (rev 1344) @@ -31,7 +31,10 @@ ?RULE :hasVariableTable ?VT. ?VT :has_variable ( ?A1 ?VAR ) . } => { - ?RULE :n3_antecedent_has { ?VAR rdf:type ?CLASS } . + ?CRIT :criterium_in_n3_is { ?VAR rdf:type ?CLASS } . + ?CRIT :criterium_in_n3_is2{ ?A1 rdf:type ?CLASS } . + ?RULE :n3_antecedent_has { ?VAR rdf:type ?CLASS } . + ?RULE :n3_antecedent_has_var_subject ?CRIT . }. { @@ -41,10 +44,13 @@ swrl:argument2 ?A2 ; swrl:propertyPredicate ?P . ?RULE :hasVariableTable ?VT. - ?VT :has_variable ( ?A1 ?VAR1 ) . - ?VT :has_variable ( ?A2 ?VAR2 ) . + ?VT :has_variable ?A1 . + ?VT :has_variable ?A2 . } => { - ?RULE :n3_antecedent_has { ?VAR1 ?P ?VAR2 } . + ?CRIT :criterium_in_n3_is { ?VAR1 ?P ?VAR2 } . + ?CRIT :criterium_in_n3_is2{ ?A1 ?P ?A2 } . + ?RULE :n3_antecedent_has { ?VAR1 ?P ?VAR2 } . + ?RULE :n3_antecedent_has_var_subject_object ?CRIT . }. ######### consequent ######### @@ -68,22 +74,13 @@ swrl:argument1 ?A1 ; swrl:classPredicate ?CLASS . ?RULE :hasVariableTable ?VT. - ?VT :has_variable ( ?A1 ?VAR ) . + ?VT :has_variable ?A1 . } => { ?RULE :n3_consequent_has { ?VAR rdf:type ?CLASS } . }. ######### gather variables ######### -{ # create variable table - ?RULE a swrl:Imp ; -} => { - ?RULE :hasVariableTable ?VT. - # ?RULE :hasVariableTableBody ?VTB. - # ?RULE :hasVariableTableHead ?VTH. - ?VT a :VariableTable. -}. - { ?CRIT :swrl_body_in ?RULE ; swrl:argument1 ?A @@ -110,35 +107,84 @@ ?A :swrl_head_variable_in ?RULE . }. +{ # create variable table + ?RULE a swrl:Imp ; +} => { + ?RULE :hasVariableTable ?VT. + ?VT a :VariableTable. +}. + { ?A :swrl_body_variable_in ?RULE . ?RULE :hasVariableTable ?VT. } => { - ?VT :has_variable ( ?A ?VAR ) . + ?RULE :hasVariable ?A . + ?VT :has_variable ?A . }. { ?A :swrl_head_variable_in ?RULE . ?RULE :hasVariableTable ?VT. } => { - ?VT :has_variable ( ?A ?VAR ) . # a blank node that will become a ? variable in the final query + ?RULE :hasVariable ?A . + ?VT :has_variable ?A . }. -######## assembly ######### +{ + ?RULE a swrl:Imp . + _:d e:findall ( ?A + { ?RULE :hasVariable ?A . } + ?LA ). + ?LA e:distinct ?LAD . +} => { + ?RULE :distinctVariables ?LAD . +}. +######## variable substitution ######### + +# variable substitution of ?V by ?VT in a triple ?T == {?S ?P ?O} +{ {?V ?P ?O} :substituteVariable (?V ?VT). +} => { # the subject is substituted + ( {?V ?P ?O} (?V ?VT) ) :variableSubstitution {?VT ?P ?O} +}. +{ {?S ?P ?V} :substituteVariable (?V ?VT). +} => { # the object is substituted + ( {?S ?P ?V} (?V ?VT) ) :variableSubstitution {?S ?P ?VT} +}. + +#** What: :substituteVariableList - substitution of a list of variable substitutions ?L in a triple +# @subject an RDF statement +# @object list of variable substitutions, e.g. ( (:x ?X)(:y ?Y) ) +{ + ?STAT :substituteVariableList ?L . + ?STAT log:includes {?S ?P ?O} . + ?L a rdf:List . + ?L rdf:first (?V ?VT) . + # _:d e:trace ( rdf:first :substituteVariableList ?L log:includes {?V ?P ?O} ). +} => { + {?S ?P ?O} :substituteVariable (?V ?VT). +}. + { - _:d e:findall ( ?A {?RULE :n3_antecedent_has ?A} ?LA ). - _:d e:findall ( ?C {?RULE :n3_consequent_has ?C} ?LC ). - ?LA log:conjunction ?FA . - ?LC log:conjunction ?FC . + ?STAT :substituteVariableList ?L . + ?STAT log:includes {?S ?P ?O} . + ?L a rdf:List . + ?L rdf:rest ?REST . + + # recover result from preceding rule: + ?L rdf:first (?V ?VT) . + ( {?S ?P ?O} (?V ?VT) ) :variableSubstitution {?SS ?P ?OS} . + + #_:d e:trace ( rdf:rest :substituteVariableList ?L + # :variableSubstitution {?SS ?P ?OS} ). } => { - ?RULE :n3RuleParts ( ?FA ?FC ) . + ?REST a rdf:List . + {?SS ?P ?OS} :substituteVariableList ?REST . }. -# { -# _:d e:findall ( ?A {?RULE :n3_antecedent_has ?A} ?LA ). -# _:d e:findall ( ?C {?RULE :n3_consequent_has ?C} ?LC ). -# ?LA log:conjunction ?FA . -# ?LC log:conjunction ?FC . -# } => { -# ?RULE :asN3 { ?FA => ?FC } -# }. +# test +{:x :sibling :y} :substituteVariableList +( (:x ?X)(:y ?Y) ) . +( (:x ?X)(:y ?Y) ) a rdf:List . + +{ ?LC :substituteVariable ?L . } => { _:dd :print (?LC :substituteVariable ?L) . }. +{ ?LC :variableSubstitution ?L . } => { _:dd :print (?LC :variableSubstitution ?L) . }. Modified: trunk/eulergui/examples/swrl-n3-rulesQ.n3 =================================================================== --- trunk/eulergui/examples/swrl-n3-rulesQ.n3 2010-03-23 18:38:34 UTC (rev 1343) +++ trunk/eulergui/examples/swrl-n3-rulesQ.n3 2010-03-23 21:21:55 UTC (rev 1344) @@ -11,16 +11,19 @@ @prefix fn: <http://www.w3.org/2005/xpath-functions#>. { - ?RULE :n3RuleParts ( ?FA ?FC ) . + _:d e:findall ( ?A { ?RULE :n3_antecedent_has ?A } ?LA ). + _:d e:findall ( ?C {?RULE :n3_consequent_has ?C} ?LC ). + ?LA log:conjunction ?FA . + ?LC log:conjunction ?FC . } => { - ?FA => ?FC + ?FA => ?FC }. -# { -# ?RULE :asN3 { ?FA => ?FC } -# } => { -# ?FA => ?FC -# }. +{ ?BC a :BadChild} => { ?BC a :BadChild}. -{ ?BC a :BadChild} => -{ ?BC a :BadChild}. \ No newline at end of file +# { ?C rdf:first ?D} => { ?C rdf:first ?D}. +# { ?C rdf:rest ?D} => { ?C rdf:rest ?D}. +# { ?C ?D rdf:nil } => { ?C ?D rdf:nil }. +# +{ ?LC :print ?L . } => { ?LC :print ?L . }. + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-03-26 14:23:56
|
Revision: 1358 http://eulergui.svn.sourceforge.net/eulergui/?rev=1358&view=rev Author: jmvanel Date: 2010-03-26 14:23:49 +0000 (Fri, 26 Mar 2010) Log Message: ----------- add N3 examples: clone-rdf-list-forward Added Paths: ----------- trunk/eulergui/examples/clone-rdf-list-forward.n3 trunk/eulergui/examples/clone-rdf-list-forward2.n3 Added: trunk/eulergui/examples/clone-rdf-list-forward.n3 =================================================================== --- trunk/eulergui/examples/clone-rdf-list-forward.n3 (rev 0) +++ trunk/eulergui/examples/clone-rdf-list-forward.n3 2010-03-26 14:23:49 UTC (rev 1358) @@ -0,0 +1,24 @@ +@prefix : <http://jmv.fr#>. +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. + +# clone an RDF list by a forward recursion - design pattern + +:l0 rdf:first :v0 ; + rdf:rest :l1 . +:l1 rdf:first :v1 ; + rdf:rest :l2 . +:l2 rdf:first :v2 ; + rdf:rest rdf:nil . + +# initial condition +:l0c :clone_of :l0 . + +{ + ?L rdf:first ?F . + ?L rdf:rest ?R . + ?LC :clone_of ?L . +} => { + ?LC :first ?F . + ?LC :rest ?RC . + ?RC :clone_of ?R . +} . Added: trunk/eulergui/examples/clone-rdf-list-forward2.n3 =================================================================== --- trunk/eulergui/examples/clone-rdf-list-forward2.n3 (rev 0) +++ trunk/eulergui/examples/clone-rdf-list-forward2.n3 2010-03-26 14:23:49 UTC (rev 1358) @@ -0,0 +1,18 @@ +@prefix : <http://jmv.fr#>. +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. + +# clone a list by a forward recursion - design pattern + +# initial condition +:l0c :clone_of (:v0 :v1 :v2) . +# not needed anymore since Euler Revision 3350: (:v0 :v1 :v2) a rdf:List . + +{ + ?L rdf:first ?F . + ?L rdf:rest ?R . + ?LC :clone_of ?L . +} => { + ?LC :first ?F . + ?LC :rest ?RC . + ?RC :clone_of ?R . +} . This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-03-26 17:33:08
|
Revision: 1360 http://eulergui.svn.sourceforge.net/eulergui/?rev=1360&view=rev Author: jmvanel Date: 2010-03-26 17:33:02 +0000 (Fri, 26 Mar 2010) Log Message: ----------- swrl-n3-rules: extract variableSubstitution.n3 from swrl-n3-rules.n3 Modified Paths: -------------- trunk/eulergui/examples/swrl-n3-rules.n3 trunk/eulergui/examples/swrl-n3-rules.n3p Added Paths: ----------- trunk/eulergui/examples/variableSubstitution.n3 Modified: trunk/eulergui/examples/swrl-n3-rules.n3 =================================================================== --- trunk/eulergui/examples/swrl-n3-rules.n3 2010-03-26 16:02:18 UTC (rev 1359) +++ trunk/eulergui/examples/swrl-n3-rules.n3 2010-03-26 17:33:02 UTC (rev 1360) @@ -138,111 +138,3 @@ } => { ?RULE :distinctVariables ?LAD . }. - -######## variable substitution ######### - -#** variable substitution of ?V by ?VT in a triple ?T == {?S ?P ?O} -{ {?V ?P ?O} :substituteVariable (?V ?VT). -} => { # the subject is substituted - ( {?V ?P ?O} (?V ?VT) ) :variableSubstitution {?VT ?P ?O} -}. -{ {?S ?P ?V} :substituteVariable (?V ?VT). -} => { # the object is substituted - ( {?S ?P ?V} (?V ?VT) ) :variableSubstitution {?S ?P ?VT} -}. - -#** substitution of a list of variable substitutions ?L in a statement -# Antecedent: :substituteVariableList -# @subject an RDF statement -# @object list of variable substitutions, e.g. ( (:x ?X)(:y ?Y) ) -#** Consequent: :substituteVariableList - substitution of a list of variable substitutions ?L in a triple -{ - (?STAT ?INVARIANT) :substituteVariableList ?L . - # _:d e:trace ( rdf:first :substituteVariableList ?L ). - ?STAT log:includes {?S ?P ?O} . - # ?L a rdf:List . - ?L rdf:first (?V ?VT) . - # _:d e:trace ( rdf:first :substituteVariableList ?L log:includes {?V ?P ?O} ). -} => { - {?S ?P ?O} :substituteVariable (?V ?VT). -}. - -{ - (?STAT ?INVARIANT) :substituteVariableList ?L . - ?STAT log:includes {?S ?P ?O} . - # ?L a rdf:List . - ?L rdf:rest ?REST . - - # recover result from preceding rule: - ?L rdf:first (?V ?VT) . - ( {?S ?P ?O} (?V ?VT) ) :variableSubstitution {?SS ?P ?OS} . - - # _:d e:trace ( rdf:rest :substituteVariableList ?L - # :variableSubstitution {?SS ?P ?OS} ). -} => { - # ?REST a rdf:List . - ({?SS ?P ?OS} ?INVARIANT) :substituteVariableList ?REST . -}. - -# substitution of triples in a formula ?F - WIP -{ ?F :substituteVariablesInFormula ?L . - # ?F log:includes ?STAT . - ?F log:includes {?S ?P ?O} . - # _:d e:trace ("substituteVariablesInFormula" - # ?F ?STAT # ?L ). -} => { - ( - # ?STAT - {?S ?P ?O} - # ( ?F ?STAT ?L ) # INVARIANT - ( ?F {?S ?P ?O} ?L ) # INVARIANT - ) :substituteVariableList ?L . -}. - -#** recover the fully substituted triple from the initial formula, non substituted triple ?STAT and substitution list ?L -{ - ( ?STAT (?F ?STAT ?L) # INVARIANT - ) :substituteVariableList ?L . - - #_:d e:findall ( ?STAT_ - # {(?STAT_ (?F ?STAT ?L) ) :substituteVariableList ()} ?TSUBST ). - (?TSUBST (?F ?STAT ?L) ) :substituteVariableList (). - - # _:d e:trace ("trace substitutedTriple" - # ?F ?STAT ?L ). - -} => { - (?F ?L) :substitutedTriplesInFormula ?TSUBST. -}. - -{ ?F :substituteVariablesInFormula ?L . - _:d e:findall ( ?TSUBST_ - { (?F ?L) :substitutedTriplesInFormula ?TSUBST_ . } - ?TSUBST ). - ?TSUBST log:conjunction ?FSUBST . -} => { - (?F ?L) :substitutedFormula ?FSUBST. -}. - -# substitution of triples in a pair of formulas (?A ?C) . TODO - - -# test substituteVariableList -# ( {:x :sibling :y} -# ( {:x :sibling :y} ( (:x ?X)(:y ?Y) ) ) -# ) :substituteVariableList -# ( (:x ?X)(:y ?Y) ) . -# ( (:x ?X)(:y ?Y) ) a rdf:List . - - {:x :sibling :y. :x :hates :y.} :substituteVariablesInFormula - ( (:x _:x)(:y _:y ) ) . -# ( (:x _:x)(:y _:y ) ) a rdf:List . # useless with latest Euler - -{ ?LC :substituteVariable ?L . } => { _:dd :print (?LC :substituteVariable ?L) . }. -{ ?LC :variableSubstitution ?L . } => { _:dd :print (?LC :variableSubstitution ?L) . }. -{ ?LC :substituteVariableList ?L . } => { _:dd :print (?LC :substituteVariableList ?L) . }. -{ ?LC :substitutedTriple ?L . } => { _:dd :print (?LC :substitutedTriple ?L) . }. -{ ?LC :substitutedTriplesInFormula ?L . } => { _:dd :print (?LC :substitutedTriplesInFormula ?L) . }. -{ ?LC :substitutedFormula ?L . } => { _:dd :print (?LC :substitutedFormula ?L) . }. -# -{ ?LC :substituteVariablesInFormula ?L . } => { _:dd :print (?LC :substituteVariablesInFormula ?L) . }. Modified: trunk/eulergui/examples/swrl-n3-rules.n3p =================================================================== --- trunk/eulergui/examples/swrl-n3-rules.n3p 2010-03-26 16:02:18 UTC (rev 1359) +++ trunk/eulergui/examples/swrl-n3-rules.n3p 2010-03-26 17:33:02 UTC (rev 1360) @@ -1,6 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<java version="1.6.0_18" class="java.beans.XMLDecoder"> +<java version="1.6.0_18-ea" class="java.beans.XMLDecoder"> <object class="eulergui.project.Project"> + <void property="eulerArguments"> + <string></string> + </void> <void property="n3Query"> <object class="eulergui.project.N3Source"> <void property="URI"> @@ -33,6 +36,14 @@ </void> </object> </void> + <void method="put"> + <string>./variableSubstitution.n3</string> + <object class="eulergui.project.N3Source"> + <void property="URI"> + <string>./variableSubstitution.n3</string> + </void> + </object> + </void> </void> </object> </java> Added: trunk/eulergui/examples/variableSubstitution.n3 =================================================================== --- trunk/eulergui/examples/variableSubstitution.n3 (rev 0) +++ trunk/eulergui/examples/variableSubstitution.n3 2010-03-26 17:33:02 UTC (rev 1360) @@ -0,0 +1,88 @@ +@prefix : <http://owldl.com/ontologies/dl-safe.owl#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. +@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#> . +@prefix log: <http://www.w3.org/2000/10/swap/log#> . + +######## variable substitution ######### + +#** variable substitution of ?V by ?VT in a triple ?T == {?S ?P ?O} +{ {?V ?P ?O} :substituteVariable (?V ?VT). +} => { # the subject is substituted + ( {?V ?P ?O} (?V ?VT) ) :variableSubstitution {?VT ?P ?O} +}. +{ {?S ?P ?V} :substituteVariable (?V ?VT). +} => { # the object is substituted + ( {?S ?P ?V} (?V ?VT) ) :variableSubstitution {?S ?P ?VT} +}. + +#** substitution of a list of variable substitutions ?L in a statement +# Antecedent: :substituteVariableList +# @subject an RDF statement +# @object list of variable substitutions, e.g. ( (:x ?X)(:y ?Y) ) +#** Consequent: :substituteVariableList - substitution of a list of variable substitutions ?L in a triple +{ + (?STAT ?INVARIANT) :substituteVariableList ?L . + # _:d e:trace ( rdf:first :substituteVariableList ?L ). + ?STAT log:includes {?S ?P ?O} . + ?L rdf:first (?V ?VT) . +} => { + {?S ?P ?O} :substituteVariable (?V ?VT). +}. + +{ + (?STAT ?INVARIANT) :substituteVariableList ?L . + ?STAT log:includes {?S ?P ?O} . + ?L rdf:rest ?REST . + + # recover result from preceding rule: + ?L rdf:first (?V ?VT) . + ( {?S ?P ?O} (?V ?VT) ) :variableSubstitution {?SS ?P ?OS} . +} => { + ({?SS ?P ?OS} ?INVARIANT) :substituteVariableList ?REST . +}. + +# substitution of triples in a formula ?F - WIP +{ ?F :substituteVariablesInFormula ?L . + # ?F log:includes ?STAT . + ?F log:includes {?S ?P ?O} . +} => { + ( + {?S ?P ?O} + ( ?F {?S ?P ?O} ?L ) # INVARIANT + ) :substituteVariableList ?L . +}. + +#** recover the fully substituted triple from the initial formula, non substituted triple ?STAT and substitution list ?L +{ + ( ?STAT (?F ?STAT ?L) # INVARIANT + ) :substituteVariableList ?L . + (?TSUBST (?F ?STAT ?L) ) :substituteVariableList (). +} => { + (?F ?L) :substitutedTriplesInFormula ?TSUBST. +}. + +#** recover the fully substituted formula from the initial formula and substitution list ?L +{ ?F :substituteVariablesInFormula ?L . + _:d e:findall ( ?TSUBST_ + { (?F ?L) :substitutedTriplesInFormula ?TSUBST_ . } + ?TSUBST ). + ?TSUBST log:conjunction ?FSUBST . +} => { + (?F ?L) :substitutedFormula ?FSUBST. +}. + +# substitution of triples in a pair of formulas (?A ?C) . TODO + +# test data + {:x :sibling :y. :x :hates :y.} :substituteVariablesInFormula + ( (:x _:x)(:y _:y ) ) . + +# test print +{ ?LC :substituteVariable ?L . } => { _:dd :print (?LC :substituteVariable ?L) . }. +{ ?LC :variableSubstitution ?L . } => { _:dd :print (?LC :variableSubstitution ?L) . }. +{ ?LC :substituteVariableList ?L . } => { _:dd :print (?LC :substituteVariableList ?L) . }. +{ ?LC :substitutedTriple ?L . } => { _:dd :print (?LC :substitutedTriple ?L) . }. +{ ?LC :substitutedTriplesInFormula ?L . } => { _:dd :print (?LC :substitutedTriplesInFormula ?L) . }. +{ ?LC :substitutedFormula ?L . } => { _:dd :print (?LC :substitutedFormula ?L) . }. +# +{ ?LC :substituteVariablesInFormula ?L . } => { _:dd :print (?LC :substituteVariablesInFormula ?L) . }. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-03-29 16:28:15
|
Revision: 1370 http://eulergui.svn.sourceforge.net/eulergui/?rev=1370&view=rev Author: jmvanel Date: 2010-03-29 16:28:09 +0000 (Mon, 29 Mar 2010) Log Message: ----------- swrl-n3-rules : I'm getting very near the goal. Now I need to generate several different N3 variables, each corresponding to an SWRL variable. I have a list a SWRL variables (resources actually) : :BadChildRule :distinctVariables (:x :y) . and for each of them, I need to create a new different N3 variable. Modified Paths: -------------- trunk/eulergui/examples/swrl-n3-rules.n3 trunk/eulergui/examples/swrl-n3-rulesQ.n3 trunk/eulergui/examples/variableSubstitution.n3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-03-29 19:46:10
|
Revision: 1371 http://eulergui.svn.sourceforge.net/eulergui/?rev=1371&view=rev Author: jmvanel Date: 2010-03-29 19:46:04 +0000 (Mon, 29 Mar 2010) Log Message: ----------- swrl-n3-rules: apply latest trick from Jos: ?VARNEW e:tuple ?VAR_ORIG. I think I have all the ingredients now for complete translation SWRL ==> N3 ! Modified Paths: -------------- trunk/eulergui/examples/swrl-n3-rules.n3 trunk/eulergui/examples/swrl-n3-rulesQ.n3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-03-29 21:32:21
|
Revision: 1372 http://eulergui.svn.sourceforge.net/eulergui/?rev=1372&view=rev Author: jmvanel Date: 2010-03-29 21:32:15 +0000 (Mon, 29 Mar 2010) Log Message: ----------- Translator from SWRL to N3 logic, implemented in N3 logic OK !!!!!!!!!!!!!!!!! Answers gotten from Jos, about e:tuple(). Now we get the right thing : {?t0 a :Grandchild. ?t0 :sibling ?t1. ?t0 :hates ?t1} => {?t0 a :BadChild}. (plus same chaff) Forgot the case when nothing is substituted; begin removing useless stuff. Modified Paths: -------------- trunk/eulergui/examples/swrl-n3-rules.n3 trunk/eulergui/examples/swrl-n3-rulesQ.n3 trunk/eulergui/examples/variableSubstitution.n3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-03-30 09:50:21
|
Revision: 1373 http://eulergui.svn.sourceforge.net/eulergui/?rev=1373&view=rev Author: jmvanel Date: 2010-03-30 09:50:15 +0000 (Tue, 30 Mar 2010) Log Message: ----------- Translator from SWRL to N3 logic, implemented in N3 logic removed true criteria in rule, removed useless stuff. TODO: consequent: IndividualPropertyAtom; add a post-processing project to launch the newly created rule. Modified Paths: -------------- trunk/eulergui/examples/swrl-n3-rules.n3 trunk/eulergui/examples/swrl-n3-rules.n3p trunk/eulergui/examples/variableSubstitution.n3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-03-30 20:51:29
|
Revision: 1382 http://eulergui.svn.sourceforge.net/eulergui/?rev=1382&view=rev Author: jmvanel Date: 2010-03-30 20:51:21 +0000 (Tue, 30 Mar 2010) Log Message: ----------- swrl-n3-rules: - add a larger example; - N3 refactoring: Inline a rule Modified Paths: -------------- trunk/eulergui/examples/swrl-n3-rules.n3 Added Paths: ----------- trunk/eulergui/examples/dl-safe.n3 trunk/eulergui/examples/swrl-n3-rules-big.n3p This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-03-31 09:30:25
|
Revision: 1383 http://eulergui.svn.sourceforge.net/eulergui/?rev=1383&view=rev Author: jmvanel Date: 2010-03-31 09:30:19 +0000 (Wed, 31 Mar 2010) Log Message: ----------- add N3 examples: transitive_closure TODO flatten the list of list result Modified Paths: -------------- trunk/eulergui/examples/swrl-n3-rules-big.n3p Added Paths: ----------- trunk/eulergui/examples/transitive_closure.n3 trunk/eulergui/examples/transitive_closure.n3p trunk/eulergui/examples/transitive_closureQ.n3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-03-31 14:21:55
|
Revision: 1388 http://eulergui.svn.sourceforge.net/eulergui/?rev=1388&view=rev Author: jmvanel Date: 2010-03-31 14:21:48 +0000 (Wed, 31 Mar 2010) Log Message: ----------- Translator from SWRL to N3 logic: implemented swrl:IndividualPropertyAtom in consequent and swrl:DifferentIndividualsAtom in antecedent TESTED with swrl-n3-rules-big.n3p : now the 4 rules are correctly translated. Modified Paths: -------------- trunk/eulergui/examples/swrl-n3-rules-big.n3p trunk/eulergui/examples/swrl-n3-rules.n3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-04-04 19:05:21
|
Revision: 1413 http://eulergui.svn.sourceforge.net/eulergui/?rev=1413&view=rev Author: jmvanel Date: 2010-04-04 19:05:15 +0000 (Sun, 04 Apr 2010) Log Message: ----------- newproject.n3p.n3 : add Example The EulerGUI "Project" ontology Proposal for a new N3 format for RDF + OWL + rules projects Added Paths: ----------- trunk/eulergui/examples/newproject.n3p.n3 trunk/eulergui/examples/subproject.n3p.n3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-04-15 16:06:48
|
Revision: 1459 http://eulergui.svn.sourceforge.net/eulergui/?rev=1459&view=rev Author: jmvanel Date: 2010-04-15 16:06:41 +0000 (Thu, 15 Apr 2010) Log Message: ----------- newproject.n3p.n3 : to facilitate tests with OWLAPI and Proege 4.1: converted to OWL ; and remove the """ that OWLAPI does not understand Modified Paths: -------------- trunk/eulergui/examples/newproject.n3p.n3 trunk/eulergui/examples/subproject.n3p.n3 Added Paths: ----------- trunk/eulergui/examples/newproject.n3p.n3.owl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-05-14 13:55:30
|
Revision: 1634 http://eulergui.svn.sourceforge.net/eulergui/?rev=1634&view=rev Author: jmvanel Date: 2010-05-14 13:55:24 +0000 (Fri, 14 May 2010) Log Message: ----------- new example with SPARQL plus N3 rule : dplb_rule.n3p Added Paths: ----------- trunk/eulergui/examples/dplb_creators.sparql trunk/eulergui/examples/dplb_foaf_name.sparql trunk/eulergui/examples/dplb_nothing_created.sparql trunk/eulergui/examples/dplb_rule.n3 trunk/eulergui/examples/dplb_rule.n3p trunk/eulergui/examples/dplb_ruleQ.n3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-05-25 15:34:03
|
Revision: 1677 http://eulergui.svn.sourceforge.net/eulergui/?rev=1677&view=rev Author: jmvanel Date: 2010-05-25 15:33:57 +0000 (Tue, 25 May 2010) Log Message: ----------- add example of a form with computations : acceleration_form.n3p Added Paths: ----------- trunk/eulergui/examples/acceleration.n3 trunk/eulergui/examples/acceleration_form.n3p This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-11-23 11:37:36
|
Revision: 1919 http://eulergui.svn.sourceforge.net/eulergui/?rev=1919&view=rev Author: jmvanel Date: 2010-11-23 11:37:30 +0000 (Tue, 23 Nov 2010) Log Message: ----------- - add a version of owl-rules.n3 in examples/ ; just move log:notEqualTo at the end of the antecedent. TODO The problem is that the implementation of log:notEqualTo expects that all variables were already used in preceding triples in same rule. This is not easy to implement with Drools. The translation should be postponed to end of the antecedent. Added Paths: ----------- trunk/eulergui/examples/owl-rules.n3 trunk/eulergui/examples/software_companies.sparql This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-11-29 16:13:34
|
Revision: 1929 http://eulergui.svn.sourceforge.net/eulergui/?rev=1929&view=rev Author: jmvanel Date: 2010-11-29 16:13:28 +0000 (Mon, 29 Nov 2010) Log Message: ----------- slightly enhance examples/ dbpedia.sparql and dbpedia-construct2.sparql Modified Paths: -------------- trunk/eulergui/examples/dbpedia-construct2.sparql trunk/eulergui/examples/dbpedia.sparql This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2010-12-17 16:20:25
|
Revision: 1997 http://eulergui.svn.sourceforge.net/eulergui/?rev=1997&view=rev Author: jmvanel Date: 2010-12-17 16:20:18 +0000 (Fri, 17 Dec 2010) Log Message: ----------- examples/parents.n3p was wrong Modified Paths: -------------- trunk/eulergui/examples/parents.n3 trunk/eulergui/examples/parents.n3p This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2011-01-02 19:18:16
|
Revision: 2053 http://eulergui.svn.sourceforge.net/eulergui/?rev=2053&view=rev Author: jmvanel Date: 2011-01-02 19:18:08 +0000 (Sun, 02 Jan 2011) Log Message: ----------- ass example owl-infer.n3p : this example outputs the possible RDF Statements, given an OWL model, and a class assignment; this kind of rule is used in deductions/n3_logical/swing-rules3.n3p Added Paths: ----------- trunk/eulergui/examples/owl-infer.n3p trunk/eulergui/examples/owl-infer_data.n3 trunk/eulergui/examples/owl-infer_prop_assign.n3 trunk/eulergui/examples/owl-infer_q.n3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2011-01-09 22:26:31
|
Revision: 2074 http://eulergui.svn.sourceforge.net/eulergui/?rev=2074&view=rev Author: jmvanel Date: 2011-01-09 22:26:25 +0000 (Sun, 09 Jan 2011) Log Message: ----------- context-rule.n3 ( cf chat with RZ ) Added Paths: ----------- trunk/eulergui/examples/context-rule.n3 trunk/eulergui/examples/context-rule1.n3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2011-02-09 18:34:53
|
Revision: 2099 http://eulergui.svn.sourceforge.net/eulergui/?rev=2099&view=rev Author: jmvanel Date: 2011-02-09 18:34:47 +0000 (Wed, 09 Feb 2011) Log Message: ----------- correct projects having file: URI; remove useless project Modified Paths: -------------- trunk/eulergui/examples/build-list.n3p trunk/eulergui/examples/graph.n3p Removed Paths: ------------- trunk/eulergui/examples/java_import.n3p This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2011-02-20 22:07:18
|
Revision: 2130 http://eulergui.svn.sourceforge.net/eulergui/?rev=2130&view=rev Author: jmvanel Date: 2011-02-20 22:07:12 +0000 (Sun, 20 Feb 2011) Log Message: ----------- add example : triangles.n3p : WIP : try to infer with Euler that a 4th point is actually equal to another ... Added Paths: ----------- trunk/eulergui/examples/triangles.n3 trunk/eulergui/examples/triangles.n3p trunk/eulergui/examples/trianglesQ.n3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2011-02-22 06:58:29
|
Revision: 2131 http://eulergui.svn.sourceforge.net/eulergui/?rev=2131&view=rev Author: horus Date: 2011-02-22 06:58:23 +0000 (Tue, 22 Feb 2011) Log Message: ----------- family ontology and sample data from http://www.co-ode.org/ (retired public project) - to be adapted for eulergui and its unit tests Added Paths: ----------- trunk/eulergui/examples/generations-individuals.xml trunk/eulergui/examples/generations.n3p trunk/eulergui/examples/generations.owl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm...@us...> - 2011-02-22 09:56:45
|
Revision: 2132 http://eulergui.svn.sourceforge.net/eulergui/?rev=2132&view=rev Author: jmvanel Date: 2011-02-22 09:56:38 +0000 (Tue, 22 Feb 2011) Log Message: ----------- add examples to understand e:disjunction Added Paths: ----------- trunk/eulergui/examples/disjunction.n3 trunk/eulergui/examples/disjunction.n3p trunk/eulergui/examples/disjunction2.n3 trunk/eulergui/examples/disjunctionQ.n3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |