Contextual knowledge CC-BY Fabian M. Suchanek
Knowledge about knowledge 2 Meta‐knowledge about a fact: - provenance - trust - degree - probability the fact is part of the truth, and we just say something about it the statement is true only in a particular context Rhazes was a Persian physician. -   we know this from the book A History of Islamic Philosophy Contextual knowledge: - beliefs - hypotheses - stories - utterances Rhazes can turn copper into gold. - this is true only in contemporary thought  Masoud Mahmoudian and Parvaneh Rahimi-Moghaddam: “The life and work of Abu ul-Ala Shirazi”, 2008
Contextual knowledge 3 President Trump ends the Ukraine War on his 1st day in office. - true only in Trump’s speeches before 1st day in office Rhazes can turn copper into gold. - this is true only in contemporary thought Harry Potter has a magic wand. - true only in the Harry Potter books You can see only the shadows of people - true only in Plato’s thought experiment Contextual knowledge is knowledge that is true only within a specific context, and not necessarily in the real world.
4 real world contexts Contexts can be nested Contextual knowledge We can imagine contextual knowledge as knowledge that lives in a “bubble” (the context).
RDF-Star 5 RDF-Star (also previously written RDF ) is a W3C standard to express contextual knowledge. <<   Rhazes   transmutes   copper  >>    believedBy    SamanidPrince 
RDF-Star 6 RDF-Star (also previously written RDF ) is a W3C standard to express contextual knowledge. <<   Rhazes   transmutes   copper  >>    believedBy    SamanidPrince statement of subject   predicate   object contextual statement of subject   predicate   object
RDF-Star 7 RDF-Star (also previously written RDF ) is a W3C standard to express contextual knowledge. Contextual knowledge can be nested. << >>      saidBy Fabian  <<   Rhazes   transmutes   copper  >>    believedBy    SamanidPrince >demo
RDF-Star: Demo 8 We use the triple store GraphDB by OntoText  We add our statement
RDF-Star: Demo 9 We ask: Who believes what?
RDF-Star: Demo 10 We ask: Who believes what? Answer: “Rhazes transmutes copper” is believed by Alice
RDF-Star: Demo 11 We ask: Who transmutes what?
RDF-Star: Demo 12 We ask: Who transmutes what? Answer:   nobody transmutes anything in real life
RDF-Star 13 RDF-Star (also previously written RDF ) is a W3C standard to express contextual knowledge. Advantages: -   simple syntax - increasingly well‐established W3C standard - good software support (Jena, RDF4J, Blazegraph, AnzoGraph, Stardog, GraphDB, Neo4j) Disadvantages: - hard to express anything else than statements of subject, predicate, and object <<   Rhazes   transmutes   copper  >>    believedBy    SamanidPrince RDF-Star has superseded the alternatives, Named Graphs, Singleton Properties, Reification. Further reading: W3C specificationHartig’s presentationOntoText summary 
Complex contextual statements 14 wrote(Nadim,                 ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper)))   Nadim wrote that all contemporaries of Rhazes believed that Rhazes could transmute copper into gold.
Complex contextual statements 15 contextual statement (a logical formula) nested contextual statement quantification over agents agent Nadim wrote that all contemporaries of Rhazes believed that Rhazes could transmute copper into gold. wrote(Nadim,                 ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper)))  
Complex contextual statements 16 ∀ φ: wrote(Nadim, φ) ⇒ φ  quantification over contextual statements extraction of statement φ  from context to reality What Nadim writes is true. Nadim wrote that all contemporaries of Rhazes believed that Rhazes could transmute copper into gold. wrote(Nadim,                 ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper)))  
Complex contextual statements 17 contemporary(Alice, Rhazes)  Nadim wrote that all contemporaries of Rhazes believed that Rhazes could transmute copper into gold. What Nadim writes is true. Alice was a contemporary of Rhazes. ∀ φ: wrote(Nadim, φ) ⇒ φ  wrote(Nadim,                 ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper)))  
Complex contextual statements 18 contemporary(Alice, Rhazes)  Nadim wrote that all contemporaries of Rhazes believed that Rhazes could transmute copper into gold. What Nadim writes is true. Alice was a contemporary of Rhazes. ∀ φ: wrote(Nadim, φ) ⇒ φ  ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper))  wrote(Nadim,                 ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper)))  
Complex contextual statements 19 contemporary(Alice, Rhazes)  Nadim wrote that all contemporaries of Rhazes believed that Rhazes could transmute copper into gold. What Nadim writes is true. Alice was a contemporary of Rhazes. ∀ φ: wrote(Nadim, φ) ⇒ φ  believes(Alice, transmutes(Rhazes, Copper))  ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper))  wrote(Nadim,                 ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper)))  
Complex contextual statements 20 contemporary(Alice, Rhazes)  Nadim wrote that all contemporaries of Rhazes believed that Rhazes could transmute copper into gold. What Nadim writes is true. Alice was a contemporary of Rhazes. ∀ φ: wrote(Nadim, φ) ⇒ φ  transmutes(Rhazes, Copper)  x believes(Alice, transmutes(Rhazes, Copper))  ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper))  wrote(Nadim,                 ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper)))  
Complex contextual statements 21 contemporary(Alice, Rhazes)  Nadim wrote that all contemporaries of Rhazes believed that Rhazes could transmute copper into gold. What Nadim writes is true. Alice was a contemporary of Rhazes. ∀ φ: wrote(Nadim, φ) ⇒ φ  transmutes(Rhazes, Copper)  x Such reasoning is not possible in standard First-Order Logic! But such statements can be translated to First-Order Logic! believes(Alice, transmutes(Rhazes, Copper))  ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper))  wrote(Nadim,                 ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper)))  
Complex contextual statements: Translation 22 Nadim wrote that all contemporaries of Rhazes believed that Rhazes could transmute copper into gold. Whatever Nadim writes is true. Alice was a contemporary of Rhazes. ∀ φ: wrote(Nadim, φ) ⇒ φ  contemporary(Alice, Rhazes)  translation First-Order Logic reasoning with a tool called Qiana with a standard automated reasoner wrote(Nadim,                 ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper)))   believes(Alice, transmutes(Rhazes, Copper))  >demo >demo&sum
Complex contextual statements: Demo 23 !wrote(nadim,  forall(x, contemporary(x, rhazes) => !believes(x, transmutes(rhazes, copper)))). !wrote(nadim, x) => x contemporary(alice,rhazes) 1. Express in logical terms Nadim wrote that all contemporaries of Rhazes believed that Rhazes could transmute copper into gold. Whatever Nadim writes is true. Alice was a contemporary of Rhazes.
Complex contextual statements: Demo 24 fof(h0,axiom,     ist(wrote(nadim), q_Forall(q_x0,          q_Not(q_And(q_contemporary(q_x0, rhazes), q_Not(q_ist(q_believes(q_x0), q_transmutes(rhazes, copper))))))) ). fof(h1,axiom,! [X] : (ist(wrote(nadim), X) => truthPredicate(X))). fof(h2,axiom, contemporary(alice,rhazes)). fof(axiom5,axiom,![XC, X1, X2] :(ist(XC, q_And(X1, X2))     => (ist(XC, X1) & ist(XC, X2)))). fof(axiom6,axiom,![XC, X1, X2] :(ist(XC, q_And(X1, X2))     <=> ist(XC, q_And(X2, X1)))). fof(axiom7,axiom,![XC, X1] :(ist(XC, q_Neg(q_Neg(X1)))     <=> ist(XC, X1))). ... 1. Express in logical terms 2. Translate with Qiana Nadim wrote that all contemporaries of Rhazes believed that Rhazes could transmute copper into gold. Whatever Nadim writes is true. Alice was a contemporary of Rhazes.
Complex contextual statements: Demo 25 result: proof found proof:  1: [in,h0] ist(wrote(nadim),q_Forall(q_x0,q_Not(q_And(      q_contemporary(q_x0,rhazes),q_Not(q_ist(q_believes(q_x0),      q_transmutes(rhazes,copper))))))).  2: [in,axiom16_ist] -ist(X,Y) | ist(Z,U).  3: [in,h3] -ist(believes(alice),q_transmutes(rhazes,copper)).  4: [mp, 1, 2, 3] false 1. Express in logical terms 2. Translate with Qiana 3. Use a classical reasoner Nadim wrote that all contemporaries of Rhazes believed that Rhazes could transmute copper into gold. Whatever Nadim writes is true. Alice was a contemporary of Rhazes.
Complex contextual statements with Qiana Qiana is a method to translate logical formulas that can contain contexts, quantifications over agents and formulas, and truth extractions into first‐order logic (where the reasoning can be done by off‐the‐shelf automated reasoners). wrote(Nadim, ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper)))   Advantages: -   adapted to complex reasoning tasks - ample software support (any standard logical reasoner will do) Disadvantages: - made for reasoning, not for storing factoids Qiana subsumes previous works on context logics and modal logic. Further reading: paperGitHub
Contextual knowledge: Summary 27 Contextual knowledge is knowledge that is true only within a specific context, and not necessarily in the real world: - beliefs - hypotheses - stories - utterances RDF-Star is a W3C standard to express contextual knowledge. Qiana is a method to translate contextual knowledge to first‐order logic for reasoning.  contexts <<   Rhazes   transmutes   copper  >>    believedBy    SamanidPrince  wrote(Nadim,                 ∀ x: contemporary(x, Rhazes)⇒ believes(x, transmutes(Rhazes, Copper)))  
Meta‐knowledge about facts 28 Meta‐knowledge about a fact: - provenance - trust - degree of truth - probability Rhazes advocated evidence‐based medicine -   we know this from the book   A History of Islamic Philosophy Rhazes criticised revealed religion - we trust this information to a degree of 0.6 Rhazes was a successful alchemist. - this information is true to a degree of 0.3 Rhazes rolls a dice. The dice shows 6. - the probability of this happening is 16% Debatable if these are still annotations of  a fact...
RDF-Star for provenance 29 RDF-Star can be used to express also provenance. Rhazes advocated evidence‐based medicine -   we know this from the book   A History of Islamic Philosophy Rhazes     advocated     evidenceBasedMed      {|   from HistoryOfIslamicPhil     |}
30 Rhazes advocated evidence‐based medicine -   we know this from the book   A History of Islamic Philosophy Rhazes     advocated     evidenceBasedMed      {|   from HistoryOfIslamicPhil     |} core statement provenance statement new syntax! RDF-Star for provenance RDF-Star can be used to express also provenance.
31 Rhazes advocated evidence‐based medicine -   we know this from the book   A History of Islamic Philosophy Rhazes     advocated     evidenceBasedMed      {|   from HistoryOfIslamicPhil     |} Rhazes     advocated     evidenceBasedMed <<    Rhazes     advocated     evidenceBasedMed    >>    from HistoryOfIslamicPhil syntactic sugar for core statement, i.e., the statement is true meta-statement about the core statement RDF-Star for provenance RDF-Star can be used to express also provenance.
32 RDF-Star for provenance with PROV Rhazes     advocated     evidenceBasedMed      {|   from HistoryOfIslamicPhil     |} Rhazes advocated evidence‐based medicine -   we know this from the book   A History of Islamic Philosophy Which terms should we use here?
RDF-Star for provenance with PROV PROV is an ontology (a vocabulary) to annotate a fact (or, more generally, any entity) with information about the process that generated it. Rhazes      advocated     evidenceBasedMed      {| wasDerivedFrom           HistoryOfIslamicPhil ; wasGeneratedBy  Fabian ; generatedAtTime  2025  |} 33
Provenance: Summary 34 Provenance information is an annotation of a fact that says how we came to know this fact. RDF-Star  is a W3C standard that can express provenance information. The vocabulary of provenance annotations can be provided by the PROV ontology. Rhazes      advocated     evidenceBasedMed      {| wasDerivedFrom           HistoryOfIslamicPhil ; wasGeneratedBy  Fabian ; generatedAtTime  2025  |} Further reading: The PROV OntologyRDF-star specification