79
From Data to Knowledge through Grailog Visualization (Long version: http://www.cs.unb.ca/~boley/talks/RuleMLGrailog.pdf ) Harold Boley Faculty of Computer Science University of New Brunswick Fredericton, NB, Canada Computational Logic Seminar – MUGS Stanford Logic Group, Stanford University, CA 11 February 2015 Editorial Update: 14 February 2015

From Data to Knowledge through Grailog Visualization

  • Upload
    bell

  • View
    44

  • Download
    0

Embed Size (px)

DESCRIPTION

From Data to Knowledge through Grailog Visualization (Long version: http://www.cs.unb.ca/~boley/talks/RuleMLGrailog.pdf ). Harold Boley Faculty of Computer Science University of New Brunswick Fredericton, NB, Canada. Decision CAMP, 4-6 November 2013 eBay Town Hall, San Jose, CA - PowerPoint PPT Presentation

Citation preview

Page 1: From Data to Knowledge through Grailog Visualization

From Data to Knowledge throughGrailog Visualization

(Long version: http://www.cs.unb.ca/~boley/talks/RuleMLGrailog.pdf)

Harold BoleyFaculty of Computer ScienceUniversity of New Brunswick

Fredericton, NB, Canada

Computational Logic Seminar – MUGSStanford Logic Group, Stanford University, CA

11 February 2015

Editorial Update: 14 February 2015

Page 2: From Data to Knowledge through Grailog Visualization

2

AcknowledgementsThanks for feedback on various versions and parts of this presentation

(the long version has all parts, hence gapless slide numbers):

From Data to Knowledge through Grailog VisualizationDecision CAMP, eBay Town Hall, San Jose, CA , 4-6 November 2013

Ontology, Rules, and Logic Programming for Reasoning and Applications (RulesReasoningLP) Ontolog Mini-Series, 31 October 2013ISO 15926 and Semantic Technologies 2013 Conference, Sogndal, Norway, 5-6 September 2013

Grailog 1.0: Graph-Logic Visualization of Ontologies and RulesThe 7th International Web Rule Symposium (RuleML 2013), University of Washington, Seattle, WA, 11-13 July 2013

The Grailog Systematics for Visual-Logic Knowledge Representation with Generalized GraphsFaculty of Computer Science Seminar Series, University of New Brunswick, Fredericton, Canada, 26 September 2012

High Performance Computing Center Stuttgart (HLRS), Stuttgart, Germany, 14 August 2012Grailog: Mapping Generalized Graphs to Computational Logic

Symposium on Natural/Unconventional Computing and its Philosophical Significance,AISB/IACAP World Congress - Alan Turing 2012, 2-6 July 2012, Birmingham, UK

The Grailog User Interface for Knowledge Bases of Ontologies & RulesOMG Technical Meeting, Ontology PSIG, Cambridge, MA, 21 June 2012

Grailog: Knowledge Representation with Extended Graphs for Extended LogicsSAP Enterprise Semantics Forum, 24 April 2012

Grailog: Towards a Knowledge Visualization StandardBMIR Research Colloquium, Stanford, CA, 4 April 2012

PARC Research Talk, Palo Alto, CA, 29 March 2012RuleML/Grailog: The Rule Metalogic Visualized with Generalized Graphs

PhiloWeb 2011, Thessaloniki, Greece, 5 October 2011Grailog: Graph inscribed logic

Course about Logical Foundations of Cognitive Science, TU Vienna, Austria, 20 October -10 December 2008

Page 3: From Data to Knowledge through Grailog Visualization

5

Visualization of Data & Knowledge: Graphs Make Logic Low-Entry-Cost• From 1-dimensional symbol-logic knowledge

specification to 2-dimensional graph-logic visualization in a systematic 2D syntax– Supports human in/on the loop of knowledge

elicitation, specification, validation, and reasoning• Combinable with graph transformation,

(‘associative’) indexing & parallel processing for efficient implementation of specifications

• Move towards model-theoretic semantics– Unique names, as graph nodes, mapped directly/

injectively to elements of semantic interpretation

Page 4: From Data to Knowledge through Grailog Visualization

9

GrailogGraph inscribed logic provides intuition for logic

Advanced cognitively motivated systematic graph standard for visual-logic data & knowledge:

Features orthogonal easy to learn,e.g. for (Business) Analytics

Generalized-graph framework as one uniform 2D syntax for major (Semantic Web) logics:

Pick subset for each targeted knowledge base,map to/fro RuleML sublanguage, and exchange &

validate it, posing queries again in Grailog

Page 5: From Data to Knowledge through Grailog Visualization

11Represent and Map Logic LanguagesAccording to Grailog 1.0 Systematics• We have used generalized graphs for representing

various logic languages, where basically:– Graph nodes (vertices) represent individuals, classes, etc.– Graph arcs (edges) represent relationships

• Next slides:What are the principles of this representation and what graph generalizations are required?

• Central slides:How are these graphs mapped (invertibly) to logic,thus specifying Grailog as a ‘GUI’ for knowledge?

• Later slides:What is the systematics of Grailog features?

• Final slides:How is RuleML transformed to Grailog in SVG?

Page 6: From Data to Knowledge through Grailog Visualization

12

Grailog Principles• Graphs should make it easier for humans to read and

write logic constructs via a 2D state-of-the-art representation with shorthand & normal forms,from Controlled English to logic

• Graphs should be natural extensions (e.g. n-ary)of Directed Labeled Graphs (DLGs), often usedto represent simple semantic nets, i.e. of atomic ground formulas in function-free dyadic predicate logic (cf. binary Datalog ground facts, RDF triples, the Open Graph, and the Knowledge Graph)

• Graphs should be compositional, e.g. allowing refinements for logic constructs: Description Logic constructors, F-logic frames, PSOA RuleML terms, ...

• Extensions to boxes & links should be orthogonal

Page 7: From Data to Knowledge through Grailog Visualization

15

Grailog Generalizations

• Directed hypergraphs: For n-ary relationships,directed relation-labeled (binary) arcs will be generalized to directed relation-labeled (n-ary) hyperarcs, e.g. representing relational-database tuples

• Recursive (hierarchical) graphs: For nested termsand formulas, modal logics, and modularization, ‘flat’ graphs will be generalized to allow other graphs as complex nodes to any level of ‘depth’

• Labelnode graphs: For allowing higher-order logicsdescribing both instances and relations (predicates),arc labels will also become usable as nodes

Page 8: From Data to Knowledge through Grailog Visualization

16

Graphical Elements: Names

• Written into boxes (nodes):Unique (canonical, distinct) names– Unique Name Assumption (UNA)

refined to Unique Name Specification (UNS)

• Written onto boxes (node labels):Non-unique (alternate, ‘aka’) names– Non-unique Name Assumption (NNA)

refined to Non-unique Name Specification (NNS)

• Grailog combines UNS and NNS: xNS, with x = U or N

unique

non-unique

Page 9: From Data to Knowledge through Grailog Visualization

23

Instances: Individual Constantswith Unique Name Specifications

unique

Warren Buffett

General: Graph (node) Logic

General Electric

Examples: Graph Logic

unique

Warren Buffett

US$ 3·109

General Electric

mapping

US$ 3·109

Page 10: From Data to Knowledge through Grailog Visualization

24

Instances: Individual Constants with Non-unique Name Specifications

General: Graph (node) Logic (vertical bar for non-uniqueness)

Examples: Graph Logic

|non-unique

|WB

|US$ 3B

|GE

mapping

WB

GE

US$ 3B

non-unique

Page 11: From Data to Knowledge through Grailog Visualization

25

Graphical Elements: Hatching Patterns

• No hatching (boxes): Constant• Hatching (elementary boxes): Variable

Page 12: From Data to Knowledge through Grailog Visualization

26

Parameters: Individual Variables

General: Graph (hatched node) Logic (italics font, POSL uses “?” prefix)

Examples: Graph Logic

variable

X

A

Y

variable

X

Y

A

Page 13: From Data to Knowledge through Grailog Visualization

27

Predicates: Binary Relations (1)

inst1

General: Graph (labeled arc) Logic

Example: Graph Logic

binrel(inst1, inst2)inst2

binrel

Warren Buffett General ElectricTrust Trust(Warren Buffett,

General Electric)

Page 14: From Data to Knowledge through Grailog Visualization

28

Predicates: Binary Relations (2)

General: Graph (labeled arc) Logic

Example: Graph Logic

binrel(var1, var2)binrel

Trust Trust(X,Y)X Y

var1 var2

Page 15: From Data to Knowledge through Grailog Visualization

36

Graphical Elements: Arrows (1)• Labeled arrows (directed links) for arcs and

hyperarcs (where hyperarcs ‘cut through’ nodes intermediate between first and last)

Page 16: From Data to Knowledge through Grailog Visualization

37

Predicates: n-ary Relations (n>1)

inst1

General: Graph (hyperarc) Logic

Example: Graph Logic(n=3)

rel(inst1, inst2, ..., instn-1, instn)

inst2

rel

Invest Invest(|WB, |GE, US$ 3·109)

instninstn-1

US$ 3·109

WB GE

Page 17: From Data to Knowledge through Grailog Visualization

40

Implicit Conjunction of Formula Graphs:Co-Occurrence on Graph Top-Level

inst1,1rel1(inst1,1, inst1,2, ..., inst1,n1)

inst1,2 inst1,n1

instm,1relm(instm,1, instm,2, ...,instm,nm)

instm,2 instm,nm

...rel1

relm

General: Graph (m hyperarcs) Logic

Example: Graph (2 hyperarcs) Logic

...

Invest(|WB, |GE, US$ 3·109) Invest(|JS, |VW, US$ 2·104)

Invest US$ 3·109

Invest US$ 2·104

WB GE

JS VW

Page 18: From Data to Knowledge through Grailog Visualization

41Explicit Conjunction of Formula Graphs:

Co-Occurrence in (parallel-processing) And Node

inst1,1(rel1(inst1,1, inst1,2, ..., inst1,n1)

inst1,2 inst1,n1

instm,1relm(instm,1, instm,2, ...,instm,nm))

instm,2 instm,nm

...rel1

relm

General: Graph (solid+linear) Logic

Example: Graph Logic

...

Invest(Invest(|WB, |GE, US$ 3·109) US$ 3·109

InvestInvest(|JS, |VW, US$ 2·104))US$ 2·104

WB GE

JS VW

Page 19: From Data to Knowledge through Grailog Visualization

44Disjunction of Formula Graphs: Co-Occurrence in Or Node

inst1,1(rel1(inst1,1, inst1,2, ..., inst1,n1)

inst1,2 inst1,n1

instm,1relm(instm,1, instm,2, ...,instm,nm) )

instm,2 instm,nm

...rel1

relm

General: Graph (solid+wavy) Logic

Example: Graph Logic

...

(Invest(|WB, |GE, US$ 3·109) Invest(|JS, |VW, US$ 2·104))

Invest US$ 3·109

Invest US$ 2·104

WB GE

JS VW

Page 20: From Data to Knowledge through Grailog Visualization

47

John Latin Paul

Mary

Hypergraph (2 hyperarcs, crossing inside a node)

John Latin Paul

Mary Kate

to

to

From Hyperarc Crossings to Node Copies as a Normalization Sequence (1)

KateTeach Teach

Show Show

DLG (4 arcs, do not specify to whom Latin is shown or taught)

Symbolic Controlled English“John shows Latin to Kate. Mary teaches Latin to Paul.”

Page 21: From Data to Knowledge through Grailog Visualization

48

From Hyperarc Crossings to Node Copies as a Normalization Sequence (1*)

John LatinShow

Paul

Mary Kate

Hypergraph (2 hyperarcs, crossing outside nodes)

John LatinShow

Paul

Mary Kate

DLG (4 arcs, do not specify to whom Latin is shown or taught)

to

toTeach Teach

Page 22: From Data to Knowledge through Grailog Visualization

49

Hypergraph (2 hyperarcs, parallel-cutting a node)

JohnLatin

Kate

Mary Teach Paul

to

to

JohnLatin

Kate

Mary Teach Paul

From Hyperarc Crossings to Node Copies as a Normalization Sequence (1**)

ShowShow

DLG (4 arcs, do not specify to whom Latin is shown or taught)

The hyperarc for, e.g., ternary Show(John,Latin,Kate) can be seen as the path composing the 2 arcs for binary Show(John,Latin) and binary to(Latin,Kate)

Page 23: From Data to Knowledge through Grailog Visualization

50

Hypergraph (2 hyperarcs, parallel-cutting a node)

JohnLatin

Kate

Mary

Teach1

Paul

JohnLatin

Kate

Mary Teach Paul

From Hyperarc Crossings to Node Copies Insert on Correct Binary Reduction

Show

Show1

DLG (8 arcs with 4 ‘reified’relation/ship nodes to point to arguments)

arg1 arg2 arg3

arg1 arg2 arg3

Show

Teach

Page 24: From Data to Knowledge through Grailog Visualization

51

Hypergraph (2 hyperarcs, employing a node copy)

Logic (2 relations, employing a symbol copy)

John Latin Show(John, Latin, Kate) Teach(Mary, Latin, Paul)

Kate

Mary Latin Paul

From Hyperarc Crossings to Node Copies as a Normalization Sequence (1***)

Teach

Show

Both ‘Latin’ occurrences remain one node even when copied for easier layout:Having a unique name, ‘Latin’ copies can be merged again.This “fully node copied” normal form can help to learn the symbolic form, is implemented by Grailog KS Viz, and demoed in the Loan Processor test suite

Page 25: From Data to Knowledge through Grailog Visualization

52From Predicate Labels on Hyperarcs to Labelnodes Starting Hyperarcs

inst1

General: Graph (hyperarc with Logic rect4vex-shaped labelnode)

Example: Graph Logic(n=3)

rel(inst1, inst2, ..., instn-1, instn)

inst2

rel

Invest(|WB, |GE, US$ 3·109)

instninstn-1

rel inst1 inst2 instninstn-1

US$ 3·109

InvestUS$ 3·109

WB GE

WB GEInvest

(Shorthand)

(Normal Form)

Page 26: From Data to Knowledge through Grailog Visualization

54

General: Graph Logic

Example: Graph Logic

unaryrel(inst1)

Frugal(Warren Buffett)

Arities Smaller than in Binary DLGs:Labelnodes Starting Unary Hyperarcs

(cf. Slide on Classes, Concepts, Types)

inst1unaryrel

Warren BuffettFrugal

Page 27: From Data to Knowledge through Grailog Visualization

66

Predicates: Unary Relations (Classes, Concepts, Types)

inst1

Example: Graph Logic

class(inst1)class

Warren Buffett

BillionaireBillionaire( Warren

Buffett)

General: Graph (class applied Logicto instance node)

HasInstance

Page 28: From Data to Knowledge through Grailog Visualization

68

Graphical Elements: Arrows (2)

• Arrows for special arcs and hyperarcs – HasInstance: Connects class, as labelnode,

with instance (hyperarc of length 1)• As in DRLHs and shown earlier, labelnodes can also

be used (instead of labels) for hyperarcs of length > 1– SubClassOf: Connects subclass, unlabeled,

with superclass (arc, i.e. of length 2)– Implies: Hyperarc from premise(s) to conclusion– Object-IDentified slots and shelves: Bulleted

arcs and hyperarcs

Page 29: From Data to Knowledge through Grailog Visualization

69

Class Hierarchies (Taxonomies): Subclass Relation

General: Graph (two nodes) (Description)Logic

Example: Graph (Description)Logic

class1 class2

class2

Rich

Billionaire Rich

class1

SubClassOf

Billionaire

Page 30: From Data to Knowledge through Grailog Visualization

71

General: Graph (solid+linear node, (Description)as for conjunction) Logic

Example: Graph (Description)Logic

class1class2

classn

. . .

Billionaire Benefactor

Environmentalist

Intensional-Class Constructions (Ontologies):Class Intersection

class2class1 classn. . .

Billionaire Benefactor Environmentalist

Page 31: From Data to Knowledge through Grailog Visualization

72

General: Graph (complex class (xNS-Description)applied to instance node) Logic

Example: Graph (xNS-Description) Logic

(Billionaire Benefactor

Environmentalist) (Warren Buffett)

Intensional-Class Applications:Class Intersection

Warren Buffett

(class1 class2

classn) (inst1)

. . .

inst1

Billionaire Benefactor Environmentalist

class2class1 classn. . .

Page 32: From Data to Knowledge through Grailog Visualization

73

General: Graph (solid+wavy node, (Description)as for disjunction) Logic

Example: Graph (Description)Logic

. . .

Billionaire Benefactor

Environmentalist

Intensional-Class Constructions (Ontologies):Class Union

class1class2

classn

class2class1 classn. . .

Billionaire Benefactor Environmentalist

Page 33: From Data to Knowledge through Grailog Visualization

74

General: Graph (complex class (xNS-Description)applied to instance node) Logic

Example: Graph (xNS-Description) Logic

Intensional-Class Applications:Class Union

Warren Buffett

inst1

(class1 class2

classn) (inst1)

. . .

(Billionaire Benefactor

Environmentalist) (Warren Buffett)

Billionaire Benefactor Environmentalist

class2class1 classn. . .

Page 34: From Data to Knowledge through Grailog Visualization

76

Class Hierarchies (Taxonomy DAGs):Top and Bottom

General: Top (special node) (Description)Logic

General: Bottom (special node) (Description)Logic

(owl:Thing)

(owl:Nothing)

Page 35: From Data to Knowledge through Grailog Visualization

78Intensional Class Constructions

(Ontologies): Class-Property RestrictionExistential (1*)

General: Graph (normal) (Description) Logic

Example: Graph (Description) Logic

binrel . class

Substance . Physical

binrel┬ class

SubstancePhysical┬

A kind of schema, where Top class is specialized to have (multi-valued)attribute/property, Substance, with at least one value typed by class Physical

Page 36: From Data to Knowledge through Grailog Visualization

80

Instance Assertions (Populated Ontologies): Using Restriction for ABoxExistential (1*)

General: Graph (normal) (xNS-Description) Logic

Example: Graph (xNS-Description) Logic

binrel.class(inst0) binrel

Substance.Physical (Socrates)

Physical(P1) Substance(Socrates, P1)

Socrates P1Substance

inst0binrel binrel(inst0, inst1)

class(inst1) inst1

Substance

┬ class

Physical┬

Page 37: From Data to Knowledge through Grailog Visualization

82Intensional Class Constructions

(Ontologies):Class-Property RestrictionUniversal (1*)

General: Graph (normal) (Description) Logic

Example: Graph (Description) Logic

binrel . classbinrel

Substance . Physical Substance

┬ class

Physical┬

A kind of schema, where Top class is specialized to have (multi-valued)attribute/property, Substance, with each value typed by class Physical

Page 38: From Data to Knowledge through Grailog Visualization

84Instance Assertions (Populated Ontologies): Using Restriction for ABoxUniversal (1*)

General: Graph (normal) (xNS-Description) Logic

Example: Graph (xNS-Description) Logic

binrel.class(inst0)

Substance.Physical (Socrates)

Physical(P1) Physical(P2) Substance(Socrates, P1) Substance(Socrates, P2)

P1Substance

inst0inst1 instn

binrel

binrel

. . .. . . binrel(inst0, inst1)

binrel(inst0, instn)

class(inst1) class(instn) . . .

. . .

SubstanceSocrates

binrel┬ class

P2Substance

SubstancePhysical┬

Page 39: From Data to Knowledge through Grailog Visualization

85Existential vs. Universal Restriction(Physical/Mental Assumed Disjoint: Can Be Explicated via Bottom Intersection)

Example: Graph (xNS-Description) Logic

Substance.Physical (Socrates)

Physical(P1) Mental(P3) Substance(Socrates, P1) Substance(Socrates, P3)

Substance

P1 P3Substance

Substance

Socrates

Example: Graph (xNS-Description) Logic

Substance.Physical (Socrates)

Physical(P1) Mental(P3) Substance(Socrates, P1) Substance(Socrates, P3)

Substance

P1 P3Substance

Substance

Socrates

Consistent

Inconsistent

┬ Physical

Mental

┬ Physical

Mental

Page 40: From Data to Knowledge through Grailog Visualization

86LuckyParent Example (1)

Poor

Doctor

Child Child

Spouse

LuckyParent

EquivalentClasses

Person

LuckyParent ≡ Person Spouse.Person Child.(Poor Child.Doctor)

Page 41: From Data to Knowledge through Grailog Visualization

87LuckyParent Example (1*)

Child Child

Spouse

LuckyParent LuckyParent ≡ Person Spouse.Person Child.(Poor Child.Doctor)

Spouse

:

Poor

Doctor

Person

Person

Page 42: From Data to Knowledge through Grailog Visualization

88LuckyParent Example (1**)

Child

LuckyParent LuckyParent ≡ Person Spouse.Person Child.(Poor Child.Doctor)

:

┬ Child

Spouse

Person

Person

Poor

Doctor

Page 43: From Data to Knowledge through Grailog Visualization

89LuckyParent Example (1**)

Child

LuckyParent LuckyParent ≡ Person Spouse.Person Child.(Poor Child.Doctor)

:

┬ Child

Spouse

Doctor

Poor

Person

Person

Page 44: From Data to Knowledge through Grailog Visualization

90Object-Centered Logic:Grouping Binary Relations Around InstanceGeneral: Graph (Object-Centered)

(inst0-centered) Logic

Example: Graph (Object-Centered)(Socrates-centered) Logic

Philosopher(Socrates) Substance(Socrates, P1) Teaching(Socrates, T1)P1

T1

Substance

inst0inst1

instn

binrel1

binreln

. . .binrel1(inst0, inst1)

binreln(inst0, instn)

class(inst0)

. . .

Teaching

Philosopher

Socrates

class

Page 45: From Data to Knowledge through Grailog Visualization

91RDF-Triple (‘Subject’-Centered) Logic: Grouping Properties Around Instance

{(Socrates, rdf:type, Philosopher), (Socrates, Substance, P1), (Socrates, Teaching, T1)}P1

T1

Substance

inst0 instn

property1

propertyn

. . . (inst0, property1, inst1),

(inst0, propertyn, instn)}

{(inst0, rdf:type, class),

. . .

TeachingSocrates

General: Graph (Subject-Centered)(inst0-centered) Logic

Example: Graph (Subject-Centered)(Socrates-centered) Logic

inst1

class

Philosopher

Page 46: From Data to Knowledge through Grailog Visualization

92Logic of Frames (‘Records’): AssociatingSlots with OID-Distinguished Instance

General: Graph (PSOA Frame)(bulleted arcs) Logic

Example: Graph (PSOA Frame) Logic

Socrates#Philosopher( Substance->P1; Teaching->T1)P1

T1

Substance

inst0 instn

slot1

slotn

. . . slot1->inst1;

slotn->instn)

inst0#class(

. . .

TeachingSocrates

inst0 class, slot1 = inst1, . . . slotn = instn

inst1

class

Philosopher

Page 47: From Data to Knowledge through Grailog Visualization

93Logic of Shelves (‘Arrays’): AssociatingTuple(s) with OID-Distinguished InstanceGeneral: Graph (PSOA Shelf)

(bulleted hyperarc) Logic

Example: Graph (PSOA Shelf) Logic

Socrates#Philosopher( c. 469 BC, 399 BC)

399 BC

inst0

inst’1, …, inst’m)inst0#class(

Socrates

inst’1inst’m. . .

c. 469 BC

class

Philosopher

Page 48: From Data to Knowledge through Grailog Visualization

94Positional-Slotted-Term Logic: Associating Tuple(s)+Slots with OID-Disting’ed Instance

General: Graph (PSOA Positional- Slotted-Term) Logic

Example: Graph (PSOA Positional- Slotted-Term) Logic

Socrates#Philosopher( c. 469 BC, 399 BC; Substance->P1; Teaching->T1)

399 BC

Substance

inst0 instn

slot1

slotn

. . . inst’1, …, inst’m;

slot1->inst1; slotn->instn)

inst0#class(

. . .

TeachingSocrates

inst’1inst’m. . .

c. 469 BC

P1T1

inst1

class

Philosopher

Page 49: From Data to Knowledge through Grailog Visualization

96

inst1,1rel1(inst1,1, inst1,2, ..., inst1,n1)

inst1,2 inst1,n1

inst2,1rel2(inst2,1, inst2,2, ...,inst2,n2)

inst2,2 inst2,n2

rel1

rel2

General: Graph (ground, Logic shorthand)

Example: Graph LogicInvest Invest(|WB, |GE,

US$ 3·109) US$ 3·109

Invest Invest(|JS, |VW, US$ 5·103)

US$ 5·103

Rules: Relations Imply Relations (1)

WB GE

JS VW

Page 50: From Data to Knowledge through Grailog Visualization

99

Rules: Relations Imply Relations (3)General: Graph (inst/var terms) Logic

Example: Graph Logic

( Y, A)Invest(|WB, Y, A)

term1,1 term1,2 term1,n1

term2,1 rel2(term2,1, term2,2, ..., term2,n2)

term2,2 term2,n2rel2

rel1 (vari,j) rel1(term1,1, term1,2, ..., term1,n1)

Invest

Invest US$ 5·103 Invest(|JS, Y, US$ 5·103)

WB

JSY A

Y

Page 51: From Data to Knowledge through Grailog Visualization

101Rules: Conjuncts Imply Relations (1*)General: Graph (prenormal) Logic

Example: Graph Logic

( Y, A)Invest(|WB, Y, A) Trust(|JS, Y)

term1,1 term1,2 term1,n1

term2,1 rel2(term2,1, term2,2, ..., term2,n2)

term2,2 term2,n2rel2

rel1(vari,j) rel1(term1,1, term1,2, ..., term1,n1)

Invest

Invest US$ 5·103Invest(|JS, Y, US$ 5·103)

term3,1 term3,2 term3,n3rel3 rel3(term3,1, term3,2, ..., term3,n3)

Trust

WB

JS

JS

Y A

Y

Y

Page 52: From Data to Knowledge through Grailog Visualization

103

<Implies closure="universal"> <And> <Atom> <Rel>Invest</Rel> <Ind unique="no">WB</Ind> <Var>Y</Var> <Var>A</Var> </Atom> <Atom> <Rel>Trust</Rel> <Ind unique="no">JS</Ind> <Var>Y</Var> </Atom> </And> <Atom> <Rel>Invest</Rel> <Ind unique="no">JS</Ind> <Var>Y</Var> <Data>US$ 5·103</Data> <!– superscript “3” to be parsed as Unicode U+00B3 --> </Atom></Implies>

Example: RuleML/XML Logic

Rules: Conjuncts Imply Relations (2)

( Y, A)(Invest(|WB, Y, A) Trust(|JS, Y) Invest(|JS, Y, US$ 5·103))

Proposing an attribute uniquewith value "no" for NNS,and "yes" for UNS as the default

Page 53: From Data to Knowledge through Grailog Visualization

Positional-Slotted-Term Logic: Rule-defined Anonymous Family Frame (Visualized from IJCAI-2011 Presentation)

Example: Graph (PSOA Positional- Slotted-Term) Logic

Group ( Forall ?Hu ?Wi ?Ch ( ?1#family(husb->?Hu wife->?Wi child->?Ch) :- And(married(?Hu ?Wi) Or(kid(?Hu ?Ch) kid(?Wi ?Ch))) )

married(Joe Sue) kid(Sue Pete) )

husb wife

family

?1

?Hu?Wi child

?Ch

married ?Hu ?Wi

?Hu ?Ch

?Ch?Wi

Joe Sue

kid Sue Pete

married

108

kid

kid

Page 54: From Data to Knowledge through Grailog Visualization

Positional-Slotted-Term Logic: Ground Facts, incl. Deduced Frame, Model Family SemanticsExample: Graph (PSOA Positional-

Slotted-Term) Logic Group (

o#family(husb->Joe wife->Sue child->Pete)

married(Joe Sue) kid(Sue Pete) )

husb

family

child

Joe Sue

kid Sue Pete

married

Joe SuePete

wifeo

Previous slide’sexistential variable ?1in rule head becomesnew OID constant oin frame fact, deduced from relational facts

For reference implementation of PSOA querying see PSOATransRun

109

Page 55: From Data to Knowledge through Grailog Visualization

Positional-Slotted-Term Logic: Conversely,Given Facts, Rule Can Be Inductively LearnedExample: Graph

husb

family

child

M1 W1

kid M1 C1

married

M1 W1C1

wifeo1

kid W1 C1

husb

family

childMn Wn

Czwife

on. . .

Mn Wnmarried

. . .

kid Mn Cx kid Wn Cy. . .

Abstracting OIDconstants o1, ... , onto regain existentialvariable ?1 of previous rule, now induced from matchingrelational and frame facts:Knowledge from data

110

Page 56: From Data to Knowledge through Grailog Visualization

115Orthogonal Graphical Features Axes of Grailog Systematics

• Box axes:• Corners: pointed vs. snipped vs. rounded

• To quote/copy vs. reify/instantiate vs. evaluate contents(cf. Lisp, Prolog, Relfun, Hilog, RIF, CL, and IKL)

• Shapes (rectangle-derived): composed from sides that are straight vs. concave vs. convex• For neutral vs. function vs. relation contents

• Contents: elementary vs. complex nodes• Arrow axes:

• Shafts: single vs. double• Heads: triangular vs. diamond• Tails: plain vs. bulleted vs. colonized

• Box & Arrow (line-style) axes:solid vs. dashed, linear vs. (box only) wavy

Page 57: From Data to Knowledge through Grailog Visualization

116

Mnemonics for Basic Box Shapes

“skateboard halfpipe”

“database barrel”

concave

convex

functioncontents

relationcontents

Page 58: From Data to Knowledge through Grailog Visualization

117Graphical Elements: Box Systematics Axes of Shapes and Corners

Per … Copy … Instantiation … ValueRect- Snip- Round-

Neutral-angle

Individual(Function Application)-2cave

Function-4cave

Proposition(Relation Application)-2vex

Relation(incl. Class)-4vex

Shape:Corner:

Page 59: From Data to Knowledge through Grailog Visualization

118

Graphical Elements: Boxes Function/Relation-Neutral Shape of Angles Varied w.r.t. Corner Dimension

– Rectangle: Neutral ‘per copy’ nodes quote their contents

– Snipangle (octagon): Neutral ‘per instantiation’ nodes

dereference contained variables to values from context

– Roundangle (rounded angles): Neutral ‘per value’ nodes evaluate their contents through instantiation of variables and activation of function/relation applications

2XX=3 :

2XX=3 : 23

2XX=3 : 6Assuming Multbuilt-in functionMult

Mult

Mult 2XMult

Mult

Page 60: From Data to Knowledge through Grailog Visualization

119

Functional Shapes: Boxes Concave– Rect2cave (rectangle with 2 concave - top/bottom - sides):

Elementary nodes for individuals (instances).Complex nodes for quoted instance-denoting terms (constructor-function applications)

– Snip2cave (snipped): Elementary nodes for variables. Complex nodes for instantiated (reified)function applications

– Round2cave (rounded): Complex nodes for evaluatedbuilt-in or equation-defined function applications

– Rect4cave (4 concave sides): Elementary nodes for fct’s.Complex nodes for quoted functional (function-denoting) terms

– Snip4cave: Complex nodes for instantiated funct’l terms– Round4cave: Complex nodes for evaluated functional

applications (active, function-returning applications)

Page 61: From Data to Knowledge through Grailog Visualization

120

Relational Shapes: Boxes Convex– Rect2vex (rectangle with 2 convex - top/bottom - sides):

Elementary nodes for truth constants (true, false, unknown).Complex nodes for quoted truth-denoting propositions (embedded relation applications)

– Snip2vex: Complex nodes for instantiated (reified)relation applications

– Round2vex: Complex nodes for evaluatedrelation applications (e.g. as atomic formulas) and for connective uses

– Rect4vex: Elementary nodes for relations, e.g. unary ones (classes). Complex nodes for quoted relational (relation-denoting) terms

– Snip4vex: Complex nodes for instantiated relat’l terms– Round4vex (oval): Complex nodes for evaluated relat’l

applications (active, relation-returning applications)

Page 62: From Data to Knowledge through Grailog Visualization

Grailog KS Viz 1.6: Subset ofHorn Logic with Equality in SVG (1)

KS Viz slides by Leah Bidlake

• XML documents containing hornlogeq RuleML are transformed using an XSLT stylesheet and processor into a Grailog visualization in SVG format that contains JavaScript for positioning calculations and variable naming

• Postprocessing removes the no longer needed JavaScript for more readable code

121

Page 63: From Data to Knowledge through Grailog Visualization

122

Grailog KS Viz 1.6: Subset ofHorn Logic with Equality in SVG (2)

Page 64: From Data to Knowledge through Grailog Visualization

Supported Grailog Elements (1)• Predicates with n-ary relations for n ≥ 1

• Equality (Datalog+)

123

rel inst1 inst2 instninstn-1

inst1unaryrel

inst1 inst2

Page 65: From Data to Knowledge through Grailog Visualization

Supported Grailog Elements (2)Single-premise rules containing:•n-ary relations (n ≥ 1)

124

• Equality (Datalog+)

Page 66: From Data to Knowledge through Grailog Visualization

Supported Grailog Elements (3)Multi-premise rules containing:•n-ary relations (n ≥ 1)

125

• Equality (Datalog+)

Page 67: From Data to Knowledge through Grailog Visualization

Supported Grailog Elements (4)• Function Applications

• Predicates with function as final element

126

inst1 inst2 instninstn-1fun

rel inst1 instn-1 inst1 instnfun

Page 68: From Data to Knowledge through Grailog Visualization

Grailog KS Viz Structure (1)• Set up SVG file with an initial viewbox to

contain the drawings. Dimensions of viewbox are determined using JavaScript– Determine height using a variable that is

updated with each new drawing– Determine width using method maxx

• Datalog RuleML XML files cannot contain namespace

127

Page 69: From Data to Knowledge through Grailog Visualization

Grailog KS Viz Structure (2)• Distinguish between Rules and Facts:• Search for <Implies>, <And>

– Check for single premise rule andmulti-premise rule containing <Atom>

– Check for single premise rule andmulti-premise rule containing <Equal>

128

Page 70: From Data to Knowledge through Grailog Visualization

Grailog KS Viz Structure (3)• Search for <Atom>

– Check for unary and n-ary relations– Check the parent of <Atom> to determine if

it is contained in a single or multi-premise rule– For n-ary relations, check if last element is

<Expr>• Search for <Equal>

– Check the parent of <Equal> to determine ifit is contained in a single or multi-premise rule

• Search for <Expr>

129

Page 71: From Data to Knowledge through Grailog Visualization

Grailog KS Viz Structure (4)• SVG

– Drawings contain text, rectangles, rounded rectangles, polygons, straight paths, convex and concave paths using cubic Bézier curve, patterns, markers

130

Page 72: From Data to Knowledge through Grailog Visualization

Grailog KS Viz Structure (5)• JavaScript

– Calculates the coordinates used in the SVG drawings

– Creates unique variable names used in the SVG drawings by concatenating constants (type) and position of the element

– Updates the variable used to determine the SVG viewbox height

– Uses method maxx to determine the SVG viewbox width

131

Page 73: From Data to Knowledge through Grailog Visualization

Datalog Example: Multi-Premise Rule• “If an edge connects two vertices and the vertices are

the same, then the edge is a loop”

132

<RuleML> <Assert> <Implies> <And>

<Atom> <Rel>connects</Rel> <Var>edge</Var> <Var>v1</Var> <Var>v2</Var></Atom><Atom> <Rel>same_as</Rel> <Var>v1</Var> <Var>v2</Var></Atom>

</And> <Atom>

<Rel>Loop</Rel><Var>edge</Var>

</Atom> </Implies> </Assert></RuleML>

Page 74: From Data to Knowledge through Grailog Visualization

Datalog+ Example: (Head) Equality• Visualizes head equality as in Datalog+, represented

as a special binary predicate

<RuleML> <Assert>

<Equal> <Ind>point</Ind> <Ind>vertex</Ind></Equal><Equal> <Ind>line</Ind> <Ind>edge</Ind></Equal>

</Assert></RuleML>

133

Page 75: From Data to Knowledge through Grailog Visualization

Horn Logic Example: Function• Currently only predicates with a function application as

the final element can be visualized

134

<RuleML> <Assert>

<Rel>contains</Rel><Ind>NullGraph</Ind>

<Var>set_V</Var><Expr> <Fun per="copy">connectingEdges</Fun> <Data>0</Data></Expr>

</Assert></RuleML>

Page 76: From Data to Knowledge through Grailog Visualization

135

Conclusions (1)• Grailog 1.0 incorporates feedback on earlier versions• Graphical elements for novel box & arrow systematics

using orthogonal graphical features– Leaving color (except for variables and IRIs) for other purposes,

e.g. highlighting subgraphs (for retrieval and inference)• Introducing Unique vs. Non-unique Name Specification• Mapping to a family of logics, exchangeable in RuleML• Use cases from cognition to technology to business

– eLearning: Part of courses 384.126 LFCS and CS 6795 SWT– eTourism: Publication rules for multi-channel communication

• Processing of earlier Grailog-like DRLHs studied in Lisp, FIT, and Relfun

• Querying of Grailog knowledge with RuleML/POSL:http://wiki.ruleml.org/index.php/Grailog (Loan Processor test suite)

Page 77: From Data to Knowledge through Grailog Visualization

136

Conclusions (2)• Symbolic-to-visual translator implementation:

– A Grailog Visualizer for Datalog RuleML via XSLT 2.0 Translation to SVG by Sven Schmidt and Martin Koch:An Int'l Rule Challenge 2013 paper & demo introduced Grailog KS Viz

– A Framework for Graph-Logic Knowledge VisualizationMCS Thesis Proposal by Leah Bidlake, Dec 15, 2014 Grailog KS Viz 1.6 (subset of Horn Logic with Equality) …

• Grailog invites feature choice or combination– E.g. n-ary hyperarcs or n-slot frames or both

• Grailog Initiative on open standardization calls for further feedback for future 1.x versions

Page 78: From Data to Knowledge through Grailog Visualization

137

Future Work (1)• Refine/extend Grailog, e.g. along with API4KB effort

– Compare with other graph formalisms, e.g. Conceptual Graphs (http://conceptualstructures.org) and CoGui tool

– Define mappings to/fro UML structure diagrams + OCL, adopting UML behavior diagrams (http://www.uml.org)

• Improve/implement tools– … Grailog KS Viz 2.0 (full Horn Logic with Equality)– More mappings between graphs, logic, and RuleML/XML:

Grailog generators: Further symbolic-to-visual mappingsGrailog parsers: Initial visual-to-symbolic mappings

– Graph indexing & querying (cf. http://www.hypergraphdb.org)– Graph transformations (normal form, typing homomorphism, merge, ...)

– Advanced graph-theoretical operations (e.g., path tracing)– Exploit Grailog parallelism in implementation

Page 79: From Data to Knowledge through Grailog Visualization

138

Future Work (2)• Develop a Grailog structure editor, e.g. supporting:

– Auto-specialize of neutral application boxes (angles) tofunction apps (2caves) or relation apps (2vexes), depending on contents

– Auto-specialize of neutral operator boxes (angles) tofunctions (4caves) or relations (4vexes), depending on context

• Synergize with Jarvis/Dexter (for data and LP rules), Jambalaya/OntoGraf and OWLViz (for OWL ontologies) and Axiomé (for SWRL rules), etc.

• Proceed from the 2-dimensional (planar) Grailog to a 3-dimensional (spatial) one– Utilize advantages of crossing-free layout, spatial shortcuts,

and analogical representation of 3D worlds– Mitigate disadvantages of occlusion and

of harder spatial orientation and navigation• Consider the 4th (temporal) dimension of animations

to visualize logical inferences, graph processing, etc.