1. Introduction
1.1 Tasks
2. Features
3. Examples
3.1 Example1: one step justification
3.2 Scenario3: more evidences
4. Issues
4.1 Unresolved Issues
5. Links
resources:
http://www.w3.org/2000/10/swap/reason.n3: reason ontology which is used to
encode CWM dump.cwm example1.n3
--think --filter="example1.n3" --base=foo --why > example1-proof.n3 |
cwm http://iw.stanford.edu/doc/project/tami/example1.n3
--think --filter="http://iw.stanford.edu/doc/project/tami/example1.n3" |
cwm example1-proof.n3
http://www.w3.org/2000/10/swap/reason.n3 cwm-pml.n3 --think --filter="cwm-pml.n3"
--rdf > example1-pml.rdf |
http://people.csail.mit.edu/lkagal/scenario3.proof)cwm http://people.csail.mit.edu/lkagal/tami/tami-scenario3-data.n3
http://dig.csail.mit.edu/TAMI/cdk/scenario3/schema.n3 http://people.csail.mit.edu/lkagal/tami/tami-scenario3-rules.n3
--think --filter="http://people.csail.mit.edu/lkagal/tami/tami-scenario3-filter.n3"
--base=foo --why > tami-scenario3-proof.n3 |
cwm http://people.csail.mit.edu/lkagal/scenario3.proof
http://www.w3.org/2000/10/swap/reason.n3 cwm-pml.n3 --think --filter="cwm-pml.n3"
--rdf > tami-scenario3-pml.rdf |
| scenario3.proof actually host the following information
(a). justification trace (proof, conjunction, inference, extraction, parsing) e.g. foo:ns_g402 (b). justification trace (facts) e.g. foo:_g33 a pr:Fact; pr:gives {....} . (c). formula definition (kb) e.g. {formula-blah} pr:representedBy foo:_g2; = = foo:_g0,... g_26 .
|
| 1. We don't need to embed the huge-formula in PML
conclusion and we can always use an URI to reference a formula; therefore,
the conclusion can be as simple as foo:_g2 a :TamiData . where foo:_g2 is an URI whose absolute URI is http://people.csail.mit.edu/lkagal/scenario3.proof#_g2 When parsing this N3 conclusion, a N3 parse may decide retrieve related data from http://people.csail.mit.edu/lkagal/scenario3.proof, thus find one asserted fact. { huge-formula-blah... } pr:representedBy foo:_g2; 1.1 I also noticed that the N3 file http://people.csail.mit.edu/lkagal/scenario3.proof is not N3-rdf syntax, i.e. it cannot be parsed by Jena N3 reader. This solution assume the existence of scenario3.proof, which embed the fact/formula in proof. Is it a good practice? 1.2 we may even generate an N3-ref document for each huge formula, and add one more statement <document-URI> log:semantics foo:_g2 to each conclusion. Note that each huge formula is valid N3-rdf (CWM did a good job, but I'm still having problems parsing it using Jena). Example N3 formula: http://iw.stanford.edu/doc/project/tami/test/huge-conclusion-kb-g2.n3 RDF/XML generated by CWM: http://iw.stanford.edu/doc/project/tami/test/huge-conclusion-kb-g2.rdf 2. In order to access the embedded huge-formula, we may specify SourceUsage: <iw:InferenceStep rdf:about="#is__g419"> <iw:hasAntecedent rdf:resource="#ns__g465"/> <iw:hasInferenceEngine rdf:resource="http://inferenceweb.stanford.edu/registry/IE/CWM.owl#CWM"/> <iw:hasRule rdf:resource="http://inferenceweb.stanford.edu/registry/DPR/Extraction.owl#Extraction"/> <iw:hasSourceUsage rdf:parseType="Resource"> <rdf:type rdf:resource="http://inferenceweb.stanford.edu/2004/07/iw.owl#SourceUsage"/> <iw:hasSource rdf:resource="http://people.csail.mit.edu/lkagal/scenario3.proof#_g2"/> <iw:usageTime rdf:resource="cwm-pml.n3#NOW_T"/> </iw:hasSourceUsage> </iw:InferenceStep> Here, http://people.csail.mit.edu/lkagal/scenario3.proof#_g2 is the source document that stores the embedded formula. This approach enables users access the embedded formula by viewing the source data. Therefore, we don't need to add iw:usesFormula, iw:Formula, iw:hasVariable, ... I have generated an example file http://iw.stanford.edu/doc/project/tami/test/tami-scenario3-pml-en.rdf#ns__g415 more links and screen dumps can be found at http://iw.stanford.edu/doc/project/tami/#Scenario3 you may browse it using the prototype PML browser too. http://logos.cs.umbc.edu:8080/iw/pmlbrowser?sourceURI=http%3A%2F%2Fiw.stanford.edu%2Fdoc%2Fproject%2Ftami%2Ftest%2Ftami-scenario3-pml-en.rdf%23ns__g415 3. how to generate the PML the following changes need to be made in the translation rule: cwm-pml.n3. { ?NODESET iw:isConsequentOf ?C; rea:step ?S. ?S rea:gives ?G. FORMULA rea:representedBy VAR. ?G log:includes { VAR [] [] }. FORMULA log:n3String ?str. #} => { ?NODESET iw:usesFormula [ a iw:Formula; iw:hasVariable VAR; iw:hasFormula ?str ] }. }=> { ?C iw:hasSourceUsage [ a iw:SourceUsage; iw:hasSource VAR; iw:usageTime ?NOW_T ] }. { ?NODESET iw:isConsequentOf ?C; rea:step ?S. ?S rea:gives ?G. FORMULA rea:representedBy VAR. ?G log:includes { [] [] VAR }. FORMULA log:n3String ?str. #} => { ?NODESET iw:usesFormula [ a iw:Formula; iw:hasVariable VAR; iw:hasFormula ?str ] }. }=> { ?C iw:hasSourceUsage [ a iw:SourceUsage; iw:hasSource VAR; iw:usageTime ?NOW_T ] }. #{ FORMULA rea:representedBy VAR. # ?NODESET iw:usesFormula [ a iw:Formula; iw:hasVariable VAR; iw:hasFormula ?str ]. # FORMULA fromFile FILE. #} => { ?NODESET iw:usesFormula # [ a iw:Formula; iw:hasVariable VAR; iw:hasFormula ?str; iw:fromFile FILE ] #}. { FORMULA rea:representedBy VAR. ?X iw:hasSource VAR . FORMULA fromFile FILE. } => { ?X iw:hasSource FILE}. |
| If the end user need but cannot extract the definition of
a formula from the the formula's URI, we may consider using two
variations of Lalana's approach: (i) embedded approach: add iw:hasConclusionKBcontent which points to an n3 string e.g. <nodeset-URI> iw:hasConclusionKBcontent "@prefix... {formula-blah} pr:representedBy foo:_g2 ."^^XSD.string (ii) reference approach: add iw:hasConclusionKBImports which points to a N3 document e.g. <nodeset-URI> iw:hasConclusionKBImports <KB-file-URI> we also need to generate one online document that stores all the background knowledge. |
translation rules for rea:Extraction
| #### Parsing step { ?S a rea:Extraction; rea:because ?X. ?X a rea:Parsing; rea:source ?Y. ?NODESET rea:step ?S; iw:isConsequentOf ?C. "" time:localTime ?NOW. (?NOW dt:dateTime) log:dtlit ?NOW_T. } => { ?C iw:hasRule <http://inferenceweb.stanford.edu/registry/DPR/Told.owl#Told>; iw:hasSourceUsage [ a iw:SourceUsage; iw:hasSource ?Y; iw:usageTime ?NOW_T ] }. { ?S a rea:Extraction; rea:because ?X; rea:gives ?G. ?X a rea:Inference. ?G log:n3String ?str. ?NODESET1 rea:step ?S; iw:isConsequentOf ?C1. ?NODESET2 rea:step ?X. } => { ?C1 iw:hasAntecedent ?NODESET2; iw:hasRule <http://inferenceweb.stanford.edu/registry/DPR/Extraction.owl#Extraction> . ?NODESET2 iw:hasConclusion ?str; iw:hasLanguage <http://inferenceweb.stanford.edu/registry/LG/N3.owl#N3> }. ### Extraction step |
N3 translator
|
This is a joint work between W3C and KSL. This page is maintained by Li Ding. Page last updated 07/05/2006