Annexe : À propos des règles mécaniques (informatif)

La spécification GRDDL utilisent des définitions formelles telle que celle-ci :

Déclaration normativeRègle mécanique
(informatif)
Si F et G sont des résultats GRDDL de IR, alors la fusion [RDF-MT] de F et G est aussi un résultat GRDDL de IR.
?IR grddl:result ?F, ?G.
(?F ?G) log:conjunction ?H.

?IR grddl:result ?H.

Les prémisses et les conclusions des règles mécaniques sont écrites comme des motifs de graphes SPARQL [SPARQL].

Le terme grddl:result est introduit et défini dans ces règles. Le document de la « sémantique RDF » [RDF-MT] ne définit pas de propriété RDF pour la fusion de deux documents RDF, mais après quelques recherches, on trouve dans le document « Mode d'emploi du Web sémantique avec N3 la définition d'une extension sémantique de RDFlog:conjunction relie une liste/ensemble de graphes RDF à leur fusion, ce que nous utilisons.

Les autres termes provenant de divers espaces de noms sont utilisés comme suit :

Dans le premier exemple de la spécification, <http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html> a deux résultats GRDDL. Voici une dérivation de l'un deux à partir des sources suivantes :

Cf. Makefile pour le détail.

1: <http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html> :uri "http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html" .
 [by built-in Axiom log:uri]

2: """glean_title.xsl http://www.w3.org/2001/sw/grddl-wg/td/getAuthor.xsl""" :normalize-space "glean_title.xsl http://www.w3.org/2001/sw/grddl-wg/td/getAuthor.xsl" .
 [by built-in Axiom fn:normalize-space]

3: ( "glean_title.xsl http://www.w3.org/2001/sw/grddl-wg/td/getAuthor.xsl" "[ \t\r\n]+" ) :tokenize ( "glean_title.xsl" "http://www.w3.org/2001/sw/grddl-wg/td/getAuthor.xsl" ) .
 [by built-in Axiom fn:tokenize]

4: ( "glean_title.xsl" "http://www.w3.org/2001/sw/grddl-wg/td/getAuthor.xsl" ) :member "glean_title.xsl" .
 [by built-in Axiom list:member]

5: ( "glean_title.xsl" "http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html" ) :resolve-uri "http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl" .
 [by built-in Axiom fn:resolve-uri]

6: <http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl> :uri "http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl" .
 [by built-in Axiom log:uri]

7: ...
 [by parsing <grddl-rule-tests.n3>]

8: @forSome :_g28, :_g29, g:_g6 . ( g:_g6 "/*" ) gspec:xpath :_g28 . ( g:_g6 """/*/@*[local-name()="transformation" and namespace-uri()= "http://www.w3.org/2003/g/data-view#"]""" ) gspec:xpath :_g29 . :_g28 fn:base-uri "http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html" . :_g29 fn:string """glean_title.xsl http://www.w3.org/2001/sw/grddl-wg/td/getAuthor.xsl""" .
 [by erasure from step 7]

9: ...
 [by parsing <grddl-rules3.n3>]

10: @forAll :BASE, :E, :N, :REF, :TX, :TXURI, :V, :Vnorm . { @forSome run:_g30, run:_g31 . ( :N "/*" ) gspec:xpath :E . ( :N """/*/@*[local-name()="transformation" and namespace-uri()= "http://www.w3.org/2003/g/data-view#"]""" ) gspec:xpath run:_g30 . ( :REF :BASE ) fn:resolve-uri :TXURI . ( :Vnorm "[ \t\r\n]+" ) fn:tokenize run:_g31 . run:_g30 fn:string :V . run:_g31 list:member :REF . :E fn:base-uri :BASE . :TX log:uri :TXURI . :V fn:normalize-space :Vnorm . } log:implies {:N grddl:transformation :TX . } .
 [by erasure from step 9]

11: ...
 [by rule from step 10 applied to steps [2, 3, 4, 5, 6, 8]
  with bindings {'E': '[...]', 'TX': '<http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl>', '_g_L14C16': '[...]', 'TXURI': '"http....xsl"', 'N': '<grddl-rule-tests.n3#_g6>', 'Vnorm': '"glea....xsl"', 'BASE': '"http...html"', 'V': '"glea....xsl"', '_g_L16C35': '?', 'REF': '"glea....xsl"'}]

12: @forSome :_g6 . :_g6 grddl:transformation <http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl> .
 [by erasure from step 11]

13: ...
 [by parsing <data-view.rdf>]

14: :Transformation owl:onProperty :transformationProperty; owl:someValuesFrom :TransformationProperty .
 [by erasure from step 13]

15: :transformation s:range :Transformation .
 [by erasure from step 13]

16: @forSome :_g6 . :_g6 grddl:transformation <http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl> .
 [by erasure from step 11]

17: ...
 [by parsing <owlAx.n3>]

18: @forAll :C, :O . { @forSome run:_g32, run:_g33 . run:_g32 run:_g33 :O . run:_g33 s:range :C . } log:implies {:O a :C . } .
 [by erasure from step 17]

19: ...
 [by rule from step 18 applied to steps [15, 16]
  with bindings {'C': '<http://www.w3.org/2003/g/data-view#Transformation>', '_g_L2C6': '<http://www.w3.org/2003/g/data-view#transformation>', '_g_L2C3': '<grddl-rule-tests.n3#_g6>', 'O': '<http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl>'}]

20: <http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl> a :Transformation .
 [by erasure from step 19]

21: @forAll :C, :P, :S . { @forSome run:_g34 . run:_g34 owl:onProperty :P; owl:someValuesFrom :C . :S a run:_g34 . } log:implies { @forSome run:_g35 . run:_g35 a :C . :S :P run:_g35 . } .
 [by erasure from step 17]

22: ...
 [by rule from step 21 applied to steps [14, 20]
  with bindings {'P': '<http://www.w3.org/2003/g/data-view#transformationProperty>', 'C': '<http://www.w3.org/2003/g/data-view#TransformationProperty>', '_g_L3C8': '<http://www.w3.org/2003/g/data-view#Transformation>', 'S': '<http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl>'}]

23: @forSome :_g24 . <http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl> grddl:transformationProperty :_g24 .
 [by erasure from step 22]

24: @forSome :_g6 . "http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html" fn:doc :_g6 .
 [by erasure from step 7]

25: <http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl> :uri "http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl" .
 [by built-in Axiom log:uri]

26: @forSome :_g24 . <http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl> grddl:transformationProperty :_g24 .
 [by erasure from step 22]

27: @forSome :_g1, :_g6 . "http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl" fn:doc :_g1 . ( :_g1 :_g6 ) gspec:resultTree [ gspec:rdfParse {<http://musicbrainz.org/mm-2.1/album/6b050dcf-7ab1-456d-9e1b-c3c41c18eed2> <http://purl.org/dc/elements/1.1/title> "Are You Experienced?" . } ] .
 [by erasure from step 7]

28: @forAll :G, :R, :RDFXML, :TP, :TXDOC, :TXNODE . { @forSome run:_g25 . ( :TXNODE :R ) gspec:resultTree :RDFXML . run:_g25 fn:doc :TXNODE . :RDFXML gspec:rdfParse :G . :TXDOC log:uri run:_g25; grddl:transformationProperty :TP . } log:implies {:R :TP :G . } .
 [by erasure from step 9]

29: ...
 [by rule from step 28 applied to steps [25, 26, 27]
  with bindings {'TXDOC': '<http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl>', '_g_L111C11': '"http....xsl"', 'G': '{6b050dcf-7ab1-456d-9e1b-c3c41c18eed2 dc:title "Are ...ced?"}', 'TP': '[...]', 'R': '<grddl-rule-tests.n3#_g6>', 'RDFXML': '[...]', 'TXNODE': '<grddl-rule-tests.n3#_g1>'}]

30: @forSome :_g24, g:_g6 . g:_g6 :_g24 {<http://musicbrainz.org/mm-2.1/album/6b050dcf-7ab1-456d-9e1b-c3c41c18eed2> <http://purl.org/dc/elements/1.1/title> "Are You Experienced?" . } .
 [by erasure from step 29]

31: @forAll :G, :IR, :R, :TP . { @forSome run:_g26, run:_g27 . run:_g26 fn:doc :R . run:_g27 grddl:transformationProperty :TP . :IR log:uri run:_g26 . :R grddl:transformation run:_g27; :TP :G . } log:implies {:IR grddl:result :G . } .
 [by erasure from step 9]

32: ...
 [by rule from step 31 applied to steps [1, 12, 23, 24, 30]
  with bindings {'_g_L24C13': '"http...html"', '_g_L25C25': '<http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl>', 'G': '{6b050dcf-7ab1-456d-9e1b-c3c41c18eed2 dc:title "Are ...ced?"}', 'IR': '<http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html>', 'TP': '[...]', 'R': '<grddl-rule-tests.n3#_g6>'}]

33: <http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html> :result {<http://musicbrainz.org/mm-2.1/album/6b050dcf-7ab1-456d-9e1b-c3c41c18eed2> <http://purl.org/dc/elements/1.1/title> "Are You Experienced?" . } .
 [by erasure from step 32]

Changements

$Log: spec_rules.html,v $
Revision 1.1  2007/09/10 14:17:46  connolly
copied from PR-grddl-20070716

Revision 1.2  2007/07/16 21:31:17  connolly
absolute link to Makefile
link to ./ rather than spec

Revision 1.1  2007/07/16 18:39:55  jean-gui
from /2004/01/rdxh/spec

Revision 1.11  2007/04/26 15:07:32  connolly
introduce htmlBase

Revision 1.10  2007/03/01 17:45:09  connolly
fix httpLink id

Revision 1.9  2007/03/01 17:44:32  connolly
add doctype for pubrules-happiness

Revision 1.8  2007/02/20 18:24:45  connolly
simplify HTML linking constructs while mixing in HTTP stuff

Revision 1.7  2007/02/20 01:38:07  connolly
elaborated rules appendix; rationalized namespaces

Revision 1.6  2007/02/15 18:34:39  connolly
2 more steps to get to the relevant result

Revision 1.5  2007/02/15 06:58:48  connolly
replace nicely marked-up proof with one that's
un-retouched (other than truncation after the first
interesting result at step 24 of 149)

Revision 1.4  2007/02/15 06:54:22  connolly
add x:xpath in 2007/ont/xml namespace
add webarch namespace (not sure it's needed)

Revision 1.3  2007/02/07 08:21:50  connolly
move mechanical rule explanation to this separate file