This version:
http://inference-web.org/2007/primer/
This version:
http://inference-web.org/2007/primer/
Previous version:
http://iw.stanford.edu/2005/wd-pml-primer/
Editors:
Deborah L. McGuinness
(Stanford University, Rensselaer Polytechnic Institute)
Paulo Pinheiro da Silva
(Stanford University, The University of Texas at El Paso)
Li Ding (University of
Maryland Baltimore County, Rensselaer Polytechnic Institute)
Copyright ©2007 Inference Web Group.
Abstract
This document provides a brief introduction to the Proof Markup Language (PML), an interlingua
for representing and sharing explanations generated by various intelligent systems such as hybrid web-based
question answering systems, text analytic components, theorem provers, task processors, web services, rule engines, and machine learning
components. The interlingua is split into three modules (provenance,
justification, and trust relations) to reduce maintenance and reuse costs.
We will introduce the ontologies and the use of Java API by examples using a question
answering and information-extraction scenario. We identify four types
of justifications, namely unproved goals, direct assertions, assumptions,
and derived conclusions and show how PML supports these.
Contents |
John: What type of food is Tonys' specialty? X: Tonys' specialty is Shellfish.For internal representation of sentences, Agent X uses the KIF language. Therefore, the sentences above are internally represented as follows:
Question: (type TonysSpecialty ?x) Answer: (type TonysSpecialty ShellFish)
John initially asks these simple (essentially look up questions) but later he may want to ask how the answer was derived, what knowledge was used to support the derivation, and related information such as information derivative on it such as what wines are suggested as a pairing with the restaurant's speciality, what wines are available locally, etc.
The agent answers questions using its embedded inference engine on its knowledge (potentially hand input or generated from information extraction processes) and has the option of providing explanations about its question an- swering processes. We will show portions of those processes in the following sections.
A provenance element represents an information unit describing the origin of a PML concept. For example, a Language represents a language a character string is written, and an Inference Engine represents an engine used to produce the justification for the couclusion.
In order to generate explanations, Agent X needs to first encode the questions and answers and make them referenceable. Using PML-P, users can capture the content of information as a string using the property hasRawString, and optionally annotate the processing and presentation instructions using PML-P properties such as hasLanguage, hasFormat, and hasPrettyNameMappingList. The example below shows that the content of information is encoded in the KIF language.
<pmlp:Information;>
<pmlp:hasRawString rdf:datatype="http://www.w3.org/2001/XMLSchema#string">(type TonysSpecialty SHELLFISH)</pmlp:hasRawString>
<pmlp:hasLanguage rdf:resource="http://inference-web.org/registry/LG/KIF.owl#KIF" />
</pmlp:Information>
|
The Language KIF is encoded in the following PML: (browse it in IWBrowser) (sample program code using PML Java API)
<pmlp:Language rdf:about="http://inference-web.org/registry/LG/KIF.owl#KIF"> <pmlp:hasName rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Knowledge Interchange Format (KIF)</hasName> <pmlp:hasDescription> <pmlp:Information> <pmlp:hasURL rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">http://logic.stanford.edu/kif/kif.html</hasURL> <pmlp:/Information> <pmlp:/hasDescription> <pmlp:hasAuthorList> <pmlp:AgentList> <ds:first rdf:resource="http://inference-web.org/registry/PER/MGENESERETH.owl#MGENESERETH"/> <ds:rest> <pmlp:AgentList> <ds:first rdf:resource="http://inference-web.org/registry/PER/RFIKES.owl#RFIKES"/> <pmlp:/AgentList> </ds:rest> <pmlp:/AgentList> <pmlp:/hasAuthorList> <pmlp:/Language> |
Besides directly embedding the content within the instance of Information, PML-P allows users to reference information whose content is stored elsewhere. The external content can be referenced by the value of hasURL, i.e., the information content can be obtained from an online document. The example below shows that the background knowledge content was actually obtained from an online document specified by hasURL, and that the content is written in KIF language.
<pmlp:Information>
<pmlp:hasURL>http://iw.stanford.edu/ksl/registry/storage/documents/tonys_fact.kif />
<pmlp:hasLanguage rdf:resource="http://inference-web.org/registry/LG/KIF.owl#KIF" />
</pmlp:Information>
|
In addition to annotating information, Agent X needs to annotate the sources it used. The following example defines an instance of Document (browse it in IWBrowser, sample program code using PML Java API) whose content is the information seen in the above example. Using this representation, the Inference Web Registry provides a public repository that allows users to pre-register metadata about sources as a way of increasing metadata reuse.
<pmlp:Document rdf:resource="http://inference-web.org/registry/ONT/STOntology.owl#STOntology"> <pmlp:hasContent> <pmlp:Information> <pmlp:hasURL>http://iw.stanford.edu/ksl/registry/storage/documents/tonys_fact.kif/> <pmlp:hasLanguage rdf:resource="http://inference-web.org/registry/LG/KIF.owl#KIF" /> </pmlp:Information> </pmlp:hasContent> </pmlp:Document> |
PML-P supports references at the document level or at finer grained levels such as spans of text. The example below uses the DocumentFragmentByOffset concept to annotate the location of a span of text in the original document. With this representation, an application can highlight the corresponding span of text in a raw source document.
<pmlp:DocumentFragmentByOffset>
<pmlp:hasDocument rdf:resource="http://inference-web.org/registry/ONT/STOntology.owl#STOntology"/>
<pmlp:hasFromOffset rdf:datatype="http://www.w3.org/2001/XMLSchema#int">58</pmlp:hasFromOffset>
<pmlp:hasToOffset rdf:datatype="http://www.w3.org/2001/XMLSchema#int">91</pmlp:hasToOffset>
</pmlp:DocumentFragmentByOffset>
|
Also, PML includes the notion of SourceUsage that indicates how information is associated with a given source. The encoding below shows how PML is used to represent date information.
<pmlp:SourceUsage>
<pmlp:hasSource>
<pmlp:DocumentFragmentByOffset>
<pmlp:hasDocument rdf:resource="http://inference-web.org/registry/ONT/STOntology.owl#STOntology"/>
<pmlp:hasFromOffset rdf:datatype="http://www.w3.org/2001/XMLSchema#int">58</pmlp:hasFromOffset>
<pmlp:hasToOffset rdf:datatype="http://www.w3.org/2001/XMLSchema#int">91</pmlp:hasToOffset>
</pmlp:DocumentFragmentByOffset>
</pmlp:hasSource>
<pmlp:hasUsageDateTime rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2005-10-17T10:30:00Z</pmlp:hasUsageDateTime>
</pmlp:SourceUsage>
|
'(type TonysSpecialty SHELLFISH)' is either unproved or a goal
The justification can be encoded in the following PML: (browse it in IWBrowser) (sample program code using PML Java API)
<pmlj:NodeSet rdf:about="http://inference-web.org/2007/primer/examples/proofs/tonys/goal.owl#goal"> <pmlj:hasConclusion> <pmlp:Information> <pmlp:hasRawString rdf:datatype="http://www.w3.org/2001/XMLSchema#string">(type TonysSpecialty SHELLFISH)</pmlp:hasRawString> <pmlp:hasLanguage rdf:resource="http://inference-web.org/registry/LG/KIF.owl#KIF"/> </pmlp:Information> </pmlj:hasConclusion> </pmlj:NodeSet> |
'(type TonysSpecialty SHELLFISH)' has been directly assumed by the JTP inference engine
The justification can be encoded in the following PML: (browse it in IWBrowser) (sample program code using PML Java API)
<pmlj:NodeSet rdf:about="http://inference-web.org/2007/primer/examples/proofs/tonys/assumption.owl#assumption"> <pmlj:hasConclusion> <pmlp:Information> <pmlp:hasRawString rdf:datatype="http://www.w3.org/2001/XMLSchema#string">(type TonysSpecialty SHELLFISH)</pmlp:hasRawString> <pmlp:hasLanguage rdf:resource="http://inference-web.org/registry/LG/KIF.owl#KIF"/> </pmlp:Information> </pmlj:hasConclusion> <pmlj:isConsequentOf> <pmlj:InferenceStep> <pmlj:hasInferenceEngine rdf:resource= "http://inference-web.org/registry/IE/JTP.owl#JTP" /> <pmlj:hasInferenceRule rdf:resource="http://inference-web.org/registry/DPR/Assumption.owl#Assumption" /> </pmlj:InferenceStep> </pmlj:isConsequentOf> </pmlj:NodeSet> |
'(type TonysSpecialty SHELLFISH)' has been directly asserted in Stanford's Tonys Specialty Example as a span of text between byte offset 58 and byte offset 91 as of 10:30 on 2005-10-17
The justification can be encoded in the following PML: (browse it in IWBrowser) (sample program code using PML Java API)
<pmlj:NodeSet rdf:about="http://inference-web.org/2007/primer/examples/proofs/tonys/answer_1/answer.owl#answer"> <pmlj:hasConclusion> <pmlp:Information> <pmlp:hasRawString rdf:datatype="http://www.w3.org/2001/XMLSchema#string">(type TonysSpecialty SHELLFISH)</pmlp:hasRawString> <pmlp:hasLanguage rdf:resource="http://inference-web.org/registry/LG/KIF.owl#KIF"/> </pmlp:Information> </pmlj:hasConclusion> <pmlj:ConsequentOf> <pmlj:InferenceStep> <pmlj:hasIndex rdf:datatype="http://www.w3.org/2001/XMLSchema#int">0</hasIndex> <pmlj:hasInferenceRule rdf:resource="http://inference-web.org/registry/DPR/Told.owl#Told"/> <pmlj:hasSourceUsage> <pmlp:SourceUsage> <pmlp:hasSource> <pmlp:DocumentFragmentByOffset> <pmlp:hasDocument rdf:resource="http://inference-web.org/registry/PUB/STE.owl#STE"/> <pmlp:hasFromOffset rdf:datatype="http://www.w3.org/2001/XMLSchema#int">58</pmlp:hasFromOffset> <pmlp:hasToOffset rdf:datatype="http://www.w3.org/2001/XMLSchema#int">91</pmlp:hasToOffset> </pmlp:DocumentFragmentByOffset> </pmlp:hasSource> <pmlp:hasUsageDateTime rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2005-10-17T10:30:00Z</pmlp:hasUsageDateTime> </pmlp:SourceUsage> </pmlj:hasSourceUsage> </pmlj:InferenceStep> </pmlj:isConsequentOf> </pmlj:NodeSet> |
Premise 1:
'(subClassOf CRAB SHELLFISH)' has being directly asserted in Stanford's Tony's Specialty Ontology as a span of text between byte offset 56 and byte offset 82 as of 10:30 on 2005-10-17
The justification can be encoded in the following PML: (browse it in IWBrowser) (sample program code using PML Java API)
<pmlj:NodeSet rdf:about="http://inference-web.org/2007/primer/examples/proofs/tonys/answer_2/ns1.owl#ns1"> <pmlj:hasConclusion> <pmlp:Information> <pmlp:hasRawString rdf:datatype="http://www.w3.org/2001/XMLSchema#string">(subClassOf CRAB SHELLFISH)</pmlp:hasRawString> <pmlp:hasLanguage rdf:resource="http://inference-web.org/registry/LG/KIF.owl#KIF"/> </pmlp:Information> </pmlj:hasConclusion> <pmlj:ConsequentOf> <pmlj:InferenceStep> <pmlj:hasIndex rdf:datatype="http://www.w3.org/2001/XMLSchema#int">0</hasIndex> <pmlj:hasInferenceRule rdf:resource="http://inference-web.org/registry/DPR/Told.owl#Told"/> <pmlj:hasSourceUsage> <pmlp:SourceUsage> <pmlp:hasSource> <pmlp:DocumentFragmentByOffset> <pmlp:hasFromOffset rdf:datatype="http://www.w3.org/2001/XMLSchema#int">56</pmlp:hasFromOffset> <pmlp:hasDocument rdf:resource="http://inference-web.org/registry/ONT/STOntology.owl#STOntology"/> <pmlp:hasToOffset rdf:datatype="http://www.w3.org/2001/XMLSchema#int">82</pmlp:hasToOffset> </pmlp:DocumentFragmentByOffset> </pmlp:hasSource> <pmlp:hasUsageDateTime rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2005-10-17T10:30:00Z</pmlp:hasUsageDateTime> </pmlp:SourceUsage> </pmlj:hasSourceUsage> </pmlj:InferenceStep> </pmlj:isConsequentOf> </pmlj:NodeSet> |
Premise 2:
'(or (not(subClassOf CRAB ?x)) (type TonysSpecialty ?x))' has being directly asserted in Deborah as of 10:30 on 2005-10-17
The justification can be encoded in the following PML: (browse it in IWBrowser) (sample program code using PML Java API)
<pmlj:NodeSet rdf:about="http://inference-web.org/2007/primer/examples/proofs/tonys/answer_2/ns2.owl#ns2">
<pmlj:hasConclusion>
<pmlp:Information>
<pmlp:hasRawString rdf:datatype="http://www.w3.org/2001/XMLSchema#string">(or (not(subClassOf CRAB ?x)) (type TonysSpecialty ?x))</pmlp:hasRawString>
<pmlp:hasLanguage rdf:resource="http://inference-web.org/registry/LG/KIF.owl#KIF"/>
</pmlp:Information>
</pmlj:hasConclusion>
<pmlj:ConsequentOf>
<pmlj:InferenceStep>
<pmlj:hasIndex rdf:datatype="http://www.w3.org/2001/XMLSchema#int">0</hasIndex>
<pmlj:hasInferenceRule rdf:resource="http://inference-web.org/registry/DPR/Told.owl#Told"/>
<pmlj:hasSourceUsage>
<pmlp:SourceUsage>
<pmlp:hasSource rdf:resource="http://inference-web.org/registry/PER/DLM.owl#DLM"/>
<pmlp:hasUsageDateTime rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2005-10-17T10:30:00Z</pmlp:hasUsageDateTime>
</pmlp:SourceUsage>
</pmlj:hasSourceUsage>
</pmlj:InferenceStep>
</pmlj:isConsequentOf>
</pmlj:NodeSet>
|
Agent X uses JTP to derive a justification as presented below:
'(type TonysSpecialty SHELLFISH)' is derived from the application of General Modus Ponens rule on the two premises linked by
http://inference-web.org/2007/primer/examples/proofs/tonys/answer_2/ns1.owl#ns1 and
http://inference-web.org/2007/primer/examples/proofs/tonys/answer_2/ns2.owl#ns2, and
we also record that the inference step binds the variable ?x to SHELLFISH.
The justification can be encoded in the following PML: (browse it in IWBrowser) (sample program code using PML Java API)
<pmlj:NodeSet rdf:about="http://inference-web.org/2007/primer/examples/proofs/tonys/answer_2/answer.owl#answer"> <pmlj:hasConclusion> <pmlp:Information> <pmlp:hasRawString rdf:datatype="http://www.w3.org/2001/XMLSchema#string">(type TonysSpecialty ?x)</pmlp:hasRawString> <pmlp:hasLanguage rdf:resource="http://inference-web.org/registry/LG/KIF.owl#KIF"/> </pmlp:Information> </pmlj:hasConclusion> <pmlj:ConsequentOf> <pmlj:InferenceStep> <pmlj:hasIndex rdf:datatype="http://www.w3.org/2001/XMLSchema#int">0</hasIndex> <pmlj:hasInferenceRule rdf:resource="http://inference-web.org/registry/DPR/GMP.owl#GMP"/> <pmlj:hasVariableMapping> <pmlj:Mapping> <pmlj:mapFrom rdf:datatype="http://www.w3.org/2001/XMLSchema#string">?x</pmlj:mapFrom> <pmlj:mapTo rdf:datatype="http://www.w3.org/2001/XMLSchema#string">SHELLFISH</pmlj:mapTo> </pmlj:Mapping> </pmlj:hasVariableMapping> <pmlj:hasInferenceEngine rdf:resource="http://inference-web.org/registry/IE/JTP.owl#JTP"/> <pmlj:hasAntecedentList> <pmlj:NodeSetList> <ds:first rdf:resource="http://inference-web.org/2007/primer/examples/proofs/tonys/answer_2/ns1.owl#ns1"/> <ds:rest> <pmlj:NodeSetList> <ds:first rdf:resource="http://inference-web.org/2007/primer/examples/proofs/tonys/answer_2/ns2.owl#ns2"/> </pmlj:NodeSetList> </ds:rest> </pmlj:NodeSetList> </pmlj:hasAntecedentList> </pmlj:InferenceStep> </pmlj:isConsequentOf> </pmlj:NodeSet> |
It is notable that antecedents are maintained in an ordered list to ensure consistent presentation of the antecedents during user interaction, and support some inference engines that use the order of input data.
The NodeSet concept additionally supports integrating multiple justifications for the same conclusion, therefore, one conclusion can have more than one justification, as shown in the following example:
'(type TonysSpecialty SHELLFISH)' is derived from the application of General Modus Ponens rule or, alternatively, from a direct assertion.
The justification can be encoded in the following PML: (browse it in IWBrowser) (sample program code using PML Java API)
<pmlj:NodeSet rdf:about="http://inference-web.org/2007/primer/examples/proofs/tonys/answer_3/answer.owl#answer">
<pmlj:hasConclusion>
<pmlp:Information>
<pmlp:hasRawString rdf:datatype="http://www.w3.org/2001/XMLSchema#string">(type TonysSpecialty SHELLFISH)</pmlp:hasRawString>
<pmlp:hasLanguage rdf:resource="http://inference-web.org/registry/LG/KIF.owl#KIF"/>
</pmlp:Information>
</pmlj:hasConclusion>
<pmlj:ConsequentOf>
<pmlj:InferenceStep>
<pmlj:hasIndex rdf:datatype="http://www.w3.org/2001/XMLSchema#int">0</hasIndex>
<pmlj:hasInferenceRule rdf:resource="http://inference-web.org/registry/DPR/Told.owl#Told"/>
<pmlj:hasSourceUsage>
<pmlp:SourceUsage>
<pmlp:hasSource>
<pmlp:DocumentFragmentByOffset>
<pmlp:hasFromOffset rdf:datatype="http://www.w3.org/2001/XMLSchema#int">58</pmlp:hasFromOffset>
<pmlp:hasDocument rdf:resource="http://inference-web.org/registry/PUB/STE.owl#STE"/>
<pmlp:hasToOffset rdf:datatype="http://www.w3.org/2001/XMLSchema#int">91</pmlp:hasToOffset>
</pmlp:DocumentFragmentByOffset>
</pmlp:hasSource>
<pmlp:hasUsageDateTime rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2005-10-17T10:30:00Z</pmlp:hasUsageDateTime>
</pmlp:SourceUsage>
</hasSourceUsage>
</pmlj:InferenceStep>
</pmlj:isConsequentOf>
<pmlj:ConsequentOf>
<pmlj:InferenceStep>
<pmlj:hasIndex rdf:datatype="http://www.w3.org/2001/XMLSchema#int>1</hasIndex>
<pmlj:hasInferenceRule rdf:resource="http://inference-web.org/registry/DPR/GMP.owl#GMP"/>
<pmlj:hasVariableMapping>
<pmlj:Mapping>
<pmlj:mapFrom rdf:datatype="http://www.w3.org/2001/XMLSchema#string">?x</pmlj:mapFrom>
<pmlj:mapTo rdf:datatype="http://www.w3.org/2001/XMLSchema#string">SHELLFISH</pmlj:mapTo>
</pmlj:Mapping>
</pmlj:hasVariableMapping>
<pmlj:hasInferenceEngine rdf:resource="http://inference-web.org/registry/IE/JTP.owl#JTP"/>
<pmlj:hasAntecedentList>
<pmlj:NodeSetList>
<ds:first rdf:resource="http://inference-web.org/2007/primer/examples/proofs/tonys/answer_2/ns1.owl#ns1"/>
<ds:rest>
<pmlj:NodeSetList>
<ds:first rdf:resource="http://inference-web.org/2007/primer/examples/proofs/tonys/answer_2/ns2.owl#ns2"/>
</pmlj:NodeSetList>
</ds:rest>
</pmlj:NodeSetList>
</pmlj:hasAntecedentList>
</pmlj:InferenceStep>
</pmlj:isConsequentOf>
</pmlj:NodeSet>
|
An instance of question records the original user's question, which is an English sentence in this scenario.
"What type of food is Tony's specialty?"
The question is represented in PML as below: (sample program code using PML Java API)
<Question rdf:about="http://inference-web.org/2007/primer/examples/proofs/tonys/question.owl#question">
<pmlp:hasContent>
<pmlp:Information>
<pmlp:hasRawString rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>What type of food is Tony's specialty?</pmlp:hasRawString>
</pmlp:Information>
</pmlp:hasContent>
</Question>
|
An instance of query records the translated internal representation of user's question, which is a KIF query in this scenario.
(type TonysSpecialty ?x)
The query is represented in PML as below: (browse it in IWBrowser) (sample program code using PML Java API)
<pmlj:Query rdf:about="http://inference-web.org/2007/primer/examples/proofs/tonys/query.owl#query">
<pmlp:hasContent>
<pmlp:Information>
<pmlp:hasRawString rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>(type TonysSpecialty ?x)</pmlp:hasRawString>
</pmlp:Information>
</pmlp:hasContent>
<pmlj:isFromEngine rdf:resource="http://inference-web.org/registry/IE/JTP.owl#JTP"/>
<pmlj:isQueryFor rdf:resource="http://inference-web.org/2007/primer/examples/proofs/tonys/question.owl#question"/>
<pmlj:hasAnswer rdf:resource="http://inference-web.org/2007/primer/examples/proofs/tonys/answer_1/answer.owl#answer"/>
<pmlj:hasAnswer rdf:resource="http://inference-web.org/2007/primer/examples/proofs/tonys/answer_2/answer.owl#answer"/>
<pmlj:hasAnswer rdf:resource="http://inference-web.org/2007/primer/examples/proofs/tonys/answer_3/answer.owl#answe"/>
</pmlj:Query>
|
In this query, we need to specify the following information that captures how the query has been answered.
<pmlj:NodeSet rdf:about="http://inference-web.org/2007/primer/examples/proofs/tonys/answer_2/answer.owl#answer"> ... <pmlj:InferenceStep> ... <pmlj:fromQuery rdf:resource="http://inference-web.org/2007/primer/examples/proofs/tonys/query.owl#query"/> ... </pmlj:InferenceStep> ... </pmlj:NodeSet> |
<pmlj:NodeSet rdf:about="http://inference-web.org/2007/primer/examples/proofs/tonys/answer_2/ns1.owl#ns1"> ... <pmlj:InferenceStep> ... <pmlj:fromAnswer rdf:resource=http://inference-web.org/2007/primer/examples/proofs/tonys/answer_2/answer.owl#answer"/> ... </pmlj:InferenceStep> ... </pmlj:NodeSet> |
<pmlt:FloatBelief rdf:about="#belief1">
<pmlt:hasBelievingAgent rdf:resource= "#X" />
<pmlt:hasBelievedInformation rdf:resource= "#info" />
<pmlt:hasFloatValue>0.84</pmlt:hasFloatValue >
</pmlt:FloatBelief>
|
This simple representation enables a minimal common representation for sharing trust knowledge. Some users may choose to provide an infrastructure for propagating trust information, calculate trust information, and/or build more complex trust models.
All references are available from the Inference Web publication page: http://inference-web.org/publications.html
Best PML references:
Best Inference Web reference: