A Contextualized Knowledge Repository for 
Open Data about Trentino 
Loris Bozzato Gaetano Calabrese Luciano Serafini 
Data and Knowledge Management Research Unit, 
Fondazione Bruno Kessler, Trento, Italy 
Trento, July 30, 2014 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 1 / 39
Outline 
1 Introduction: context in Semantic Web and Linked Open Data 
2 Theory of contexts in AI 
3 Contextualized Knowledge Repository (CKR) 
4 Reasoning in CKR 
5 CKR Prototype implementation 
6 A CKR for Trentino Open Data 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 2 / 39
Outline 
1 Introduction: context in Semantic Web and Linked Open Data 
2 Theory of contexts in AI 
3 Contextualized Knowledge Repository (CKR) 
4 Reasoning in CKR 
5 CKR Prototype implementation 
6 A CKR for Trentino Open Data 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 3 / 39
Introduction and motivation 
Need for context in Semantic Web 
Most of Semantic Web data holds in specific contextual space 
(time, location, topic...) 
No explicit support for modelling and reasoning 
with context sensitive knowledge in SW 
(Often handcrafted in implementation) 
Ô Need for well-defined theory of contexts 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 4 / 39
Introduction and motivation 
Need for context in Semantic Web 
Most of Semantic Web data holds in specific contextual space 
(time, location, topic...) 
No explicit support for modelling and reasoning 
with context sensitive knowledge in SW 
(Often handcrafted in implementation) 
Ô Need for well-defined theory of contexts 
Contextualized Knowledge Repository (CKR) 
DL based framework for representation and reasoning with 
contextual knowledge in the Semantic Web 
Contextual theory: based on formal AI theories of context 
[McCarthy, 1993, Lenat, 1998, Giunchiglia and Ghidini, 2001] 
Other DL contextual frameworks: 
[Bao et al., 2010, Klarman and Gutiérrez-Basulto, 2010]. 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 4 / 39
Contextual modelling needs 
A study on typical use of context in SW lead us to the definition of 
a set of representation requirements: 
Requirements 
Statement contextualization: associate context to facts 
Symbols locality: local meaning for symbols 
Cross-context TBox statements: knowledge relations across contexts 
Complex contextualization: more than one contextual values to facts 
Modularity: separation of knowledge in independent modules 
Unified reasoning and query: inference and query use context structure 
. . . 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 5 / 39
Contextual modelling needs 
A study on typical use of context in SW lead us to the definition of 
a set of representation requirements: 
Requirements 
Statement contextualization: associate context to facts 
Symbols locality: local meaning for symbols 
Cross-context TBox statements: knowledge relations across contexts 
Complex contextualization: more than one contextual values to facts 
Modularity: separation of knowledge in independent modules 
Unified reasoning and query: inference and query use context structure 
. . . 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 5 / 39
Outline 
1 Introduction: context in Semantic Web and Linked Open Data 
2 Theory of contexts in AI 
3 Contextualized Knowledge Repository (CKR) 
4 Reasoning in CKR 
5 CKR Prototype implementation 
6 A CKR for Trentino Open Data 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 6 / 39
Contextual knowledge representation and reasoning 
Every formula is asserted in a context, i.e., there is no absolute 
truth: 
ist(c1, Winner(Italy)) 
ist(c2, Winner(Spain)) 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 7 / 39
Contextual knowledge representation and reasoning 
Every formula is asserted in a context, i.e., there is no absolute 
truth: 
ist(c1, Winner(Italy)) 
ist(c2, Winner(Spain)) 
Contexts are first class objects, and the logic provides terms to 
denote contexts, and formulas to predicate about contexts: 
is_about(c1, FifaWorldCup) time(c1, 2006) 
is_about(c2, FifaWorldCup) time(c2, 2010) 
is_about(c3, Football) time(c3, 2000  2010) 
disjoint(c1, c2) covers(c3, c1) covers(c3, c2) 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 7 / 39
Contextual knowledge representation and reasoning 
Every formula is asserted in a context, i.e., there is no absolute 
truth: 
ist(c1, Winner(Italy)) 
ist(c2, Winner(Spain)) 
Contexts are first class objects, and the logic provides terms to 
denote contexts, and formulas to predicate about contexts: 
is_about(c1, FifaWorldCup) time(c1, 2006) 
is_about(c2, FifaWorldCup) time(c2, 2010) 
is_about(c3, Football) time(c3, 2000  2010) 
disjoint(c1, c2) covers(c3, c1) covers(c3, c2) 
knowledge propagates across contexts: 
8x(ist(c1,Winner(x)) ! ist(c2.Team(x)) 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 7 / 39
“Context as a box” representation paradigm 
a context is a theory—set of sentences in a logical language, 
closed under logical consequence—associated with a region in a 
contextual space; 
Location 
Time 
Topic 
South africa 
FIFA world cup 
Spain.Qualified.First 
Holland.Qualified.Second 
best_player(Cavani) 
... 
2010 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 8 / 39
Context as a Box 
C = 
time(C, 2010  06  14), location(C,World), topic(C, FIFA_WC_Match_11) 
TeamA(Team_Italy) 
TeamB(Team_Paraguay) 
Referee(Benito_Archundia) 
scored(Daniele_Derossi, 63) 
scored(Antolin_Alcaraz, 39) 
match_document(http : //www.fifa.com/mm/document/.../...5fstart.pdf ) 
match_document(http : //www.fifa.com/mm/document/.../...5lineup.pdf ) 
photo(http : //www.fifa.com/mm/pict/.../...xyz.jpg) 
. . . 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 9 / 39
Contextual dimension 
From Doug Lenat (CYC) 
TIME e.g.: 2001, 20/3/2009-20/3/2011,. . . 
TYPEOFTIME e.g., NightTime, DuringWorldWarII, . . . 
GEOLOCATION e.g. Italy, Spain, London, . . . 
TYPEOFPLACE e.g. Country, Office, Town, . . . 
CULTURE e.g., Political Culture, Democratic political culture, sport, . . . 
SOPHISTICATION/SECURITY who can access knowledge of this context? e.g, 
physicians, Manager, Human Resources stuff, . . . 
TOPIC what is a context about? Values are taken from topic classification systems 
GRANULARITY from molecular to cellular to organ to organism to society level 
MODALITY beliefs, agreements, expectations, memories, etc., 
ARGUMENT-PREFERENCE What is the (default) set of heuristics used in this 
context, to resolve pro/con argument clashes? 
JUSTIFICATION e.g., definitional, causal, statistical, appeals to intuition, by faith, by 
assumption, etc. 
DOMAIN ASSUMPTIONS . . . 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 10 / 39
Contextual dimension 
Requirements from the Semantic Web 
TIME information on when knowledge holds 
PROVENANCE information about the source from which 
knowledge comes from 
ACCESS CONTROL information on access rights on knowledge 
PROPOSITIONAL ATTITUDES beliefs and modalities 
VERSIONING/EVOLUTION information on how knowledge 
evolves 
TRUST information about bow reliable is the infomration 
contained in a context. 
generalizing. . . 
We develop a general logical framework that supports n dimensions. 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 11 / 39
Outline 
1 Introduction: context in Semantic Web and Linked Open Data 
2 Theory of contexts in AI 
3 Contextualized Knowledge Repository (CKR) 
4 Reasoning in CKR 
5 CKR Prototype implementation 
6 A CKR for Trentino Open Data 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 12 / 39
CKR introduction 
The structure of a CKR is composed by 2 layers: 
Global context 
Metaknowledge: structure of contexts, context classes, relations, 
modules and attributes 
(Global) object knowledge: 
object knowledge shared by all contexts 
(Local) contexts 
Object knowledge with references: 
local object knowledge with references to value of predicates in 
other contexts 
Knowledge distributed across different modules 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 13 / 39
SROIQ-RL 
Restriction of SROIQ to the syntax of OWL-RL axioms: 
Left-side concept C: 
C := Aj fag j C1 u C2 j C1 t C2 j 9R.C1 j 9R.fag j 9R. 
Right-side concept D: 
D := AjD1 u D2 j :C1 j 8R.D1 j 9R.fag j 6 nR.C1 j 6 nR. 
with n 2 f0, 1g 
Both-side concept E: 
E := Aj E1 u E2 j 9R.fag 
TBox axioms: C v D, E  E 
ABox axioms: D(a), R(a, b) 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 14 / 39
Metalanguage LG 
Metavocabulary: G = NCG ] NRG ] NIG 
N  NIG: context names 
M  NIG: module names 
C  NCG: context classes, including class Ctx 
R  NRG: contextual relations 
A  NRG: contextual attributes 
For A 2 A, a set DA  NIG of attribute values of A 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 15 / 39
Metalanguage LG 
Metavocabulary: G = NCG ] NRG ] NIG 
N  NIG: context names 
M  NIG: module names 
C  NCG: context classes, including class Ctx 
R  NRG: contextual relations 
A  NRG: contextual attributes 
For A 2 A, a set DA  NIG of attribute values of A 
Metalanguage LG: SROIQ-RL axioms over context expressions: 
C := B j fcg jC1 u C2 jC1 t C2 j 9R.C1 j 9R.fcg j 9R.j 9A.fdAg j 9mod.fmg 
D := B jD1 u D2 j :C1 j 8R.D1 j 9R.fcg j 9A.fdAg j 9mod.fmg j 
6 nR.C1 j 6 nR. 
E := B j E1 u E2 j 9R.fcg j 9A.fdAg j 9mod.fmg 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 15 / 39
Metalanguage LG 
Metavocabulary: G = NCG ] NRG ] NIG 
N  NIG: context names 
M  NIG: module names 
C  NCG: context classes, including class Ctx 
R  NRG: contextual relations 
A  NRG: contextual attributes 
For A 2 A, a set DA  NIG of attribute values of A 
Metalanguage LG: SROIQ-RL axioms over context expressions: 
C := B j fcg jC1 u C2 jC1 t C2 j 9R.C1 j 9R.fcg j 9R.j 9A.fdAg j 9mod.fmg 
D := B jD1 u D2 j :C1 j 8R.D1 j 9R.fcg j 9A.fdAg j 9mod.fmg j 
6 nR.C1 j 6 nR. 
E := B j E1 u E2 j 9R.fcg j 9A.fdAg j 9mod.fmg 
Individual variable this: c 2 N [ fthisg 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 15 / 39
Object language LS 
Object vocabulary: any DL vocabulary S = NCS ] NRS ] NIS 
Eval expression 
Given X an object expression in S and C a context expression in G 
eval(X,C) 
“The interpretation of X in all the contexts of type C” 
Left-side only: “imports” meaning of X from all of the contexts in C 
Object language LS: SROIQ-RL axioms over object expressions 
Object language with references Le 
S: extension with eval expressions 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 16 / 39
Contextualized Knowledge Repository 
Contextualized Knowledge Repository: 
K = hG, fKmgm2Mi 
G is a KB over G [ S, containing metalanguage axioms in LG or 
global object axioms in LS 
for every module name m 2 M, 
Km is a KB over S, containing object axioms with references in Le 
S 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 17 / 39
A CKR for representing provenance, access-control, 
and trust metadata (PlanetData EU Project 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 18 / 39
Tourism example: introduction 
Tourism example: 
Idea: Tourism recommendation for events in Trentino 
Structure of contexts represent events and tourists information 
Ô Task: find interesting events on the base of tourists’ preferences 
We model this domain in a CKR Ktour = hG, fKmgm2Mi 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 19 / 39
Tourism example: CKR structure 
Event 
CulturalEvent SportEvent 
VolleyMatch 
VolleyA1 
Competition 
Concert 
Tourist 
SportiveTourist CulturalTourist 
campionato_A1_2012-13 
G 
trento_cuneo_120922 
volley_fan_01 
trento_latina_130203 
modena_trento_130112 
hasParentEvent 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 20 / 39
Tourism example: CKR structure 
Event 
CulturalEvent SportEvent 
VolleyMatch 
VolleyA1 
Competition 
Concert 
Tourist 
SportiveTourist CulturalTourist 
campionato_A1_2012-13 
G 
trento_cuneo_120922 
volley_fan_01 
trento_latina_130203 
modena_trento_130112 
m_sport_ev 
m_event 
m_v_match 
m_match1 m_match2 m_match3 
m_tourist 
m_sp_tourist 
m_tourist01 
hasParentEvent 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 20 / 39
Tourism example: CKR structure 
Event 
CulturalEvent SportEvent 
VolleyMatch 
VolleyA1 
Competition 
Concert 
Tourist 
SportiveTourist CulturalTourist 
campionato_A1_2012-13 
G 
trento_cuneo_120922 
volley_fan_01 
trento_latina_130203 
modena_trento_130112 
Kevent 
m_sport_ev 
m_event 
m_v_match 
m_match1 m_match2 m_match3 
m_tourist 
m_sp_tourist 
m_tourist01 
hasParentEvent 
Ksport_ev Kv_match Kmatch1 ... Ktourist01 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 20 / 39
Tourism example: some modules contents 
In Kv_match: HomeTeam v Team HostTeam v Team 
Winner v Team Loser v Team 
In Kmatch2: HomeTeam(casa_modena_volley) HostTeam(itas_trentino_volley) 
Winner(casa_modena_volley) Loser(itas_trentino_volley) 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 21 / 39
Tourism example: some modules contents 
In Kv_match: HomeTeam v Team HostTeam v Team 
Winner v Team Loser v Team 
In Kmatch2: HomeTeam(casa_modena_volley) HostTeam(itas_trentino_volley) 
Winner(casa_modena_volley) Loser(itas_trentino_volley) 
... 
In Ksport_ev: “Winners of major volley matches are top teams” 
eval(Winner,VolleyMatch u 
9hasParentEvent.VolleyA1Competition) v TopTeam 
In Ksp_tourist: “Top teams are preferred teams” 
eval(TopTeam, SportEvent) v PreferredTeam 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 21 / 39
Outline 
1 Introduction: context in Semantic Web and Linked Open Data 
2 Theory of contexts in AI 
3 Contextualized Knowledge Repository (CKR) 
4 Reasoning in CKR 
5 CKR Prototype implementation 
6 A CKR for Trentino Open Data 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 22 / 39
Materialization calculus Kic 
Materialization calculus Kic: 
Calculus for instance checking in SROIQ-RL CKR 
Extension to the CKR structure of materialization calculus for 
SROEL of [Krötzsch, 2010] 
Formalizes the operation of forward closure in implementation 
Idea 
Composed by 3 sets of rules: 
Input rules I: translation of DL axioms to Datalog atoms 
Deduction rules P: forward inference rules 
Output rules O: translation for DL proved axiom 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 23 / 39
Translation and deduction rules 
EL translation rules Iel(S, c) 
C(a)7! finst(a,C, c)g R(a, b)7! ftriple(a,R, b, c)g 
fag v C7! finst(a,C, c)g A v C7! fsubClass(A,C, c)g 
A u B v C7! fsubConj(A, B,C, c)g 9R.A v C7! fsubEx(R,A,C, c)g 
R v T7! fsubRole(R, T, c)g RS v T7! fsubRChain(R, S, T, c)g 
EL deduction rules Pel 
subClass(y, z, c), inst(x, y, c) ! inst(x, z, c) 
subConj(y1, y2, z, c), inst(x, y1, c), inst(x, y2, c) ! inst(x, z, c) 
subEx(v, y, z, c), triple(x, v, x0 , c), inst(x0 , y, c) ! inst(x, z, c) 
subRole(v,w, c), triple(x, v, x0 , c) ! triple(x,w, x0 , c) 
subRChain(u, v,w, c), triple(x, u, y, c), triple(y, v, z, c) ! triple(x,w, z, c) 
Output translation O(a, c) 
C(a)7! finst(a,C, c)g R(a, b)7! ftriple(a,R, b, c)g 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 24 / 39
Translation and deduction rules 
Global rules Iglob(G) and Pglob 
C v 9mod.fmg7! fhasMod(C,m,gm)g C 2 C7! fsubClass(C, Ctx,gm)g 
C v 9A.fdg7! fhasAtt(C,A, d,gm)g c 2 N7! finst(c, Ctx,gm)g 
fcg v 9mod.fmg7! ftriple(c, mod,m,gm)g 
fcg v 9A.fdg7! ftriple(c,A, d,gm)g 
hasMod(c,m,gm), inst(x, c,gm) ! triple(x, mod,m,gm) 
hasAtt(c, a, d,gm), inst(x, c,gm) ! triple(x, a, d,gm) 
Local rules Iloc(S, c) and Ploc 
eval(A,C) v B7! fsubEval(A,C, B, c)g 
eval(R,C) v T7! fsubEvalR(R,C, T, c)g 
subEval(a, c1, b, c), inst(c0 , c1,gm), inst(x, a, c0) ! inst(x, b, c) 
subEvalR(r, c1, t, c), inst(c0 , c1,gm), triple(x, r, y, c0) ! triple(x, t, y, c) 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 25 / 39
Outline 
1 Introduction: context in Semantic Web and Linked Open Data 
2 Theory of contexts in AI 
3 Contextualized Knowledge Repository (CKR) 
4 Reasoning in CKR 
5 CKR Prototype implementation 
6 A CKR for Trentino Open Data 
L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 26 / 39
CKR Prototype: introduction 
The prototype extends the Sesame Java 
framework with three modules: 
CKR core – CKR implementation on 
top of a Sesame RDF store 
knowledge addition/removal 
closure materialization 
SPARQL 1.1 queries 
transactions 
CKR server – extension of Sesame 
Server  Workbench 
exposes CKR primitives 
includes a SPARQL endpoint 
includes an admin UI 
CKR client – library to access a 
CKR from a remote Java application 
Client JVM 
Client application 
CKR API 
CKR client 
Sesame 
HTTP API 
CKR core 
RDF store 
(Sesame native, memory, 
OWLIM, Bigdata) 
Server JVM 
SPARQL 
client 
CKR server 
persistent storage 
Web 
browser 
may 
embed 
in Java 
apps. 
CKR API 
SAIL API 
SPARQL 
endpoint 
Admin 
interface 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 27 / 39
SPRINGLES 
CKR Core is implemented on top of SPRINGLES: SParql-based Rule 
Inference over Named Graphs Layer Extending Sesame 
CKR API 
add triple to context 
CKR Core 
CKR implementation 
add triple to graph 
SPRINGLES 
RDF store 
SAIL API 
SAIL API 
CKR 
rules 
add triple; eval. rules 
and add inferences 
SPRINGLES features: 
transparent/on-demand closure 
materialization based on rules 
rules encoded as SPARQL queries 
addressing Named Graphs (NG) 
customizable rule evaluation strategy 
Why SPRINGLES: 
no inference over NGs in RDF stores 
Why SPARQL: 
exploits optimized query engines 
can scale to large KBs (cf. RETE) 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 28 / 39
CKR calculus in SPRINGLES: rule example 
:pel-c-subc a spr:Rule ; 
spr:head  GRAPH ?mx { ?x rdf:type ?z }  ; 
spr:body  GRAPH ?m1 { ?y rdfs:subClassOf ?z } 
GRAPH ?m2 { ?x rdf:type ?y } 
GRAPH sys:dep { ?mx sys:derivedFrom ?m1,?m2 } 
FILTER NOT EXISTS { 
GRAPH ?m0 { ?x rdf:type ?z } 
GRAPH sys:dep { ?mx sys:derivedFrom ?m0 } 
}  . 
Context C 
ckr:hasModule ckr:hasModule 
. . . 
triples in ckr:global 
?x rdf:type ?y ?y rdfs:subClassOf ?z 
Module ?m1 Module ?m2 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 29 / 39
CKR calculus in SPRINGLES: rule example 
:pel-c-subc a spr:Rule ; 
spr:head  GRAPH ?mx { ?x rdf:type ?z }  ; 
spr:body  GRAPH ?m1 { ?y rdfs:subClassOf ?z } 
GRAPH ?m2 { ?x rdf:type ?y } 
GRAPH sys:dep { ?mx sys:derivedFrom ?m1,?m2 } 
FILTER NOT EXISTS { 
GRAPH ?m0 { ?x rdf:type ?z } 
GRAPH sys:dep { ?mx sys:derivedFrom ?m0 } 
}  . 
Context C 
. . . 
triples in ckr:global 
triples in sys:dep 
?x rdf:type ?y ?y rdfs:subClassOf ?z 
ckr:hasModule 
sys:closureOf 
ckr:hasModule ckr:hasModule 
sys:derivedFrom 
sys:derivedFrom 
Module ?m1 Module ?m2 Module ?mx 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 29 / 39
CKR calculus in SPRINGLES: rule example 
:pel-c-subc a spr:Rule ; 
spr:head  GRAPH ?mx { ?x rdf:type ?z }  ; 
spr:body  GRAPH ?m1 { ?y rdfs:subClassOf ?z } 
GRAPH ?m2 { ?x rdf:type ?y } 
GRAPH sys:dep { ?mx sys:derivedFrom ?m1,?m2 } 
FILTER NOT EXISTS { 
GRAPH ?m0 { ?x rdf:type ?z } 
GRAPH sys:dep { ?mx sys:derivedFrom ?m0 } 
}  . 
Context C 
ckr:hasModule ckr:hasModule 
sys:derivedFrom 
. . . 
ckr:hasModule 
sys:closureOf 
sys:derivedFrom 
triples in ckr:global 
triples in sys:dep 
inference 
?x rdf:type ?y ?y rdfs:subClassOf ?z ?x rdf:type ?z 
Module ?m1 Module ?m2 Module ?mx 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 29 / 39
CKR calculus in SPRINGLES: evaluation strategy 
Composition of SPRINGLES primitives: parallel rule evaluation, 
sequence, fixpoint, repeat (not used by CKR) 
:closure-strategy 
spr:sequenceOf ( :task_add_axioms :task_global_closure 
:task_link_modules :task_ctx_closure ) . 
:task_add_axioms 
spr:evalOf ( 
:dep-glob :prp-ap :cls-thing :cls-nothing :dt-type ) . 
:task_global_closure 
spr:bind ?g_inf = ckr:global-inf ; 
spr:fixPointOf [ spr:evalOf ( 
:pel-c-subc ... :pel-r-subrc :pgl-c-addmod 
:pgl-i-addmod :pgl-c-submodc :pgl-c-subattc ) ] . 
:task_link_modules 
spr:evalOf ( :dep-local-i :dep-local-c ) . 
:task_ctx_closure 
spr:fixPointOf [ spr:evalOf ( 
:pel-c-subc ... :pel-r-subrc 
:plc-c-subevalat :plc-c-subexeval ) ] . 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 30 / 39
Outline 
1 Introduction: context in Semantic Web and Linked Open Data 
2 Theory of contexts in AI 
3 Contextualized Knowledge Repository (CKR) 
4 Reasoning in CKR 
5 CKR Prototype implementation 
6 A CKR for Trentino Open Data 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 31 / 39
Import in RDF Store 
OpenDataTN 
Data 
Package 
page 
Datasets 
Download 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 32 / 39
Import in RDF Store 
OpenDataTN 
Data 
Package 
page 
Datasets 
Download 
RDF CSV JSON XML 
Package 
Metadata 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 32 / 39
Import in RDF Store 
OpenDataTN 
Data 
Package 
page 
Datasets 
Download 
RDF CSV JSON XML 
Package 
Metadata 
Local 
storage 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 32 / 39
Import in RDF Store 
OpenDataTN 
Data 
Package 
page 
Datasets 
Download 
Package 
Metadata 
RDF 
Mapping + 
RDF conversion 
RDF CSV JSON XML 
Local 
storage 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 32 / 39
Import in RDF Store 
OpenDataTN 
Data 
Package 
page 
Datasets 
Download 
Package 
Metadata 
RDF Store 
Import 
RDF 
Mapping + 
RDF conversion 
RDF CSV JSON XML 
Local 
storage 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 32 / 39
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 33 / 39
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 34 / 39
Metalevel structure 
Package 
p_biblioteche Dataset 
hasMember 
d_biblioteche 
07/08/14 
hasCreationDate 
hasTag libri 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 35 / 39
Metalevel structure 
Package 
hasCreationDate 
p_biblioteche Dataset 
hasMember 
07/08/14 
hasTag libri 
d_biblioteche Mapping 
Activity 
d_biblioteche_ma 
usedFile 
usedMap 
wasGeneratedByMapping 
SourceFile MappingFile 
d_biblioteche_json d_biblioteche_map 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 35 / 39
RDF store measures 
RDF Store measures: 
Total of imported datasets: 2078 
RDF: 157 
JSON: 799 
CSV: 1122 
Number of asserted and inferred triples: 21,201,011 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 36 / 39
Query interface 
Query interface 
REST GET request 
REST interface 
SPARQL 1.1 
MetaReasons 
Server 
RDF Store 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 37 / 39
Thank you for listening 
OpenData Trentino Repository 
Loris Bozzato, Gaetano Calabrese, Luciano Serafini 
https://dkm.fbk.eu/ 
DKM - Data and Knowledge Management Research Unit, 
FBK-Irst, Fondazione Bruno Kessler - Trento, Italy 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 38 / 39
References I 
Bao, J., Tao, J., and McGuinness, D. (2010). 
Context representation for the semantic web. 
In Procs. of WebSci10. 
Giunchiglia, F. and Ghidini, C. (2001). 
Local Models Semantics, or Contextual Reasoning = Locality + Compatibility. 
Artificial Intelligence, 127:2001. 
Klarman, S. and Gutiérrez-Basulto, V. (2010). 
ALCALC : a context description logic. 
In JELIA. 
Krötzsch, M. (2010). 
Efficient Inferencing for OWL EL. 
In JELIA 2010, volume 6341 of Lecture Notes in Computer Science, pages 234–246. Springer. 
Lenat, D. (1998). 
The Dimensions of Context Space. 
Technical report, CYCorp. 
Published online http://www.cyc.com/doc/context-space.pdf (accessed June 21, 2009). 
McCarthy, J. (1993). 
Notes on formalizing context. 
In IJCAI. 
Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 39 / 39

A Contextualized Knowledge Repository for Open Data about Trentino

  • 1.
    A Contextualized KnowledgeRepository for Open Data about Trentino Loris Bozzato Gaetano Calabrese Luciano Serafini Data and Knowledge Management Research Unit, Fondazione Bruno Kessler, Trento, Italy Trento, July 30, 2014 L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 1 / 39
  • 2.
    Outline 1 Introduction:context in Semantic Web and Linked Open Data 2 Theory of contexts in AI 3 Contextualized Knowledge Repository (CKR) 4 Reasoning in CKR 5 CKR Prototype implementation 6 A CKR for Trentino Open Data L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 2 / 39
  • 3.
    Outline 1 Introduction:context in Semantic Web and Linked Open Data 2 Theory of contexts in AI 3 Contextualized Knowledge Repository (CKR) 4 Reasoning in CKR 5 CKR Prototype implementation 6 A CKR for Trentino Open Data L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 3 / 39
  • 4.
    Introduction and motivation Need for context in Semantic Web Most of Semantic Web data holds in specific contextual space (time, location, topic...) No explicit support for modelling and reasoning with context sensitive knowledge in SW (Often handcrafted in implementation) Ô Need for well-defined theory of contexts L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 4 / 39
  • 5.
    Introduction and motivation Need for context in Semantic Web Most of Semantic Web data holds in specific contextual space (time, location, topic...) No explicit support for modelling and reasoning with context sensitive knowledge in SW (Often handcrafted in implementation) Ô Need for well-defined theory of contexts Contextualized Knowledge Repository (CKR) DL based framework for representation and reasoning with contextual knowledge in the Semantic Web Contextual theory: based on formal AI theories of context [McCarthy, 1993, Lenat, 1998, Giunchiglia and Ghidini, 2001] Other DL contextual frameworks: [Bao et al., 2010, Klarman and Gutiérrez-Basulto, 2010]. L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 4 / 39
  • 6.
    Contextual modelling needs A study on typical use of context in SW lead us to the definition of a set of representation requirements: Requirements Statement contextualization: associate context to facts Symbols locality: local meaning for symbols Cross-context TBox statements: knowledge relations across contexts Complex contextualization: more than one contextual values to facts Modularity: separation of knowledge in independent modules Unified reasoning and query: inference and query use context structure . . . L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 5 / 39
  • 7.
    Contextual modelling needs A study on typical use of context in SW lead us to the definition of a set of representation requirements: Requirements Statement contextualization: associate context to facts Symbols locality: local meaning for symbols Cross-context TBox statements: knowledge relations across contexts Complex contextualization: more than one contextual values to facts Modularity: separation of knowledge in independent modules Unified reasoning and query: inference and query use context structure . . . L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 5 / 39
  • 8.
    Outline 1 Introduction:context in Semantic Web and Linked Open Data 2 Theory of contexts in AI 3 Contextualized Knowledge Repository (CKR) 4 Reasoning in CKR 5 CKR Prototype implementation 6 A CKR for Trentino Open Data L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 6 / 39
  • 9.
    Contextual knowledge representationand reasoning Every formula is asserted in a context, i.e., there is no absolute truth: ist(c1, Winner(Italy)) ist(c2, Winner(Spain)) L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 7 / 39
  • 10.
    Contextual knowledge representationand reasoning Every formula is asserted in a context, i.e., there is no absolute truth: ist(c1, Winner(Italy)) ist(c2, Winner(Spain)) Contexts are first class objects, and the logic provides terms to denote contexts, and formulas to predicate about contexts: is_about(c1, FifaWorldCup) time(c1, 2006) is_about(c2, FifaWorldCup) time(c2, 2010) is_about(c3, Football) time(c3, 2000 2010) disjoint(c1, c2) covers(c3, c1) covers(c3, c2) L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 7 / 39
  • 11.
    Contextual knowledge representationand reasoning Every formula is asserted in a context, i.e., there is no absolute truth: ist(c1, Winner(Italy)) ist(c2, Winner(Spain)) Contexts are first class objects, and the logic provides terms to denote contexts, and formulas to predicate about contexts: is_about(c1, FifaWorldCup) time(c1, 2006) is_about(c2, FifaWorldCup) time(c2, 2010) is_about(c3, Football) time(c3, 2000 2010) disjoint(c1, c2) covers(c3, c1) covers(c3, c2) knowledge propagates across contexts: 8x(ist(c1,Winner(x)) ! ist(c2.Team(x)) L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 7 / 39
  • 12.
    “Context as abox” representation paradigm a context is a theory—set of sentences in a logical language, closed under logical consequence—associated with a region in a contextual space; Location Time Topic South africa FIFA world cup Spain.Qualified.First Holland.Qualified.Second best_player(Cavani) ... 2010 L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 8 / 39
  • 13.
    Context as aBox C = time(C, 2010 06 14), location(C,World), topic(C, FIFA_WC_Match_11) TeamA(Team_Italy) TeamB(Team_Paraguay) Referee(Benito_Archundia) scored(Daniele_Derossi, 63) scored(Antolin_Alcaraz, 39) match_document(http : //www.fifa.com/mm/document/.../...5fstart.pdf ) match_document(http : //www.fifa.com/mm/document/.../...5lineup.pdf ) photo(http : //www.fifa.com/mm/pict/.../...xyz.jpg) . . . L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 9 / 39
  • 14.
    Contextual dimension FromDoug Lenat (CYC) TIME e.g.: 2001, 20/3/2009-20/3/2011,. . . TYPEOFTIME e.g., NightTime, DuringWorldWarII, . . . GEOLOCATION e.g. Italy, Spain, London, . . . TYPEOFPLACE e.g. Country, Office, Town, . . . CULTURE e.g., Political Culture, Democratic political culture, sport, . . . SOPHISTICATION/SECURITY who can access knowledge of this context? e.g, physicians, Manager, Human Resources stuff, . . . TOPIC what is a context about? Values are taken from topic classification systems GRANULARITY from molecular to cellular to organ to organism to society level MODALITY beliefs, agreements, expectations, memories, etc., ARGUMENT-PREFERENCE What is the (default) set of heuristics used in this context, to resolve pro/con argument clashes? JUSTIFICATION e.g., definitional, causal, statistical, appeals to intuition, by faith, by assumption, etc. DOMAIN ASSUMPTIONS . . . L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 10 / 39
  • 15.
    Contextual dimension Requirementsfrom the Semantic Web TIME information on when knowledge holds PROVENANCE information about the source from which knowledge comes from ACCESS CONTROL information on access rights on knowledge PROPOSITIONAL ATTITUDES beliefs and modalities VERSIONING/EVOLUTION information on how knowledge evolves TRUST information about bow reliable is the infomration contained in a context. generalizing. . . We develop a general logical framework that supports n dimensions. L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 11 / 39
  • 16.
    Outline 1 Introduction:context in Semantic Web and Linked Open Data 2 Theory of contexts in AI 3 Contextualized Knowledge Repository (CKR) 4 Reasoning in CKR 5 CKR Prototype implementation 6 A CKR for Trentino Open Data L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 12 / 39
  • 17.
    CKR introduction Thestructure of a CKR is composed by 2 layers: Global context Metaknowledge: structure of contexts, context classes, relations, modules and attributes (Global) object knowledge: object knowledge shared by all contexts (Local) contexts Object knowledge with references: local object knowledge with references to value of predicates in other contexts Knowledge distributed across different modules L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 13 / 39
  • 18.
    SROIQ-RL Restriction ofSROIQ to the syntax of OWL-RL axioms: Left-side concept C: C := Aj fag j C1 u C2 j C1 t C2 j 9R.C1 j 9R.fag j 9R. Right-side concept D: D := AjD1 u D2 j :C1 j 8R.D1 j 9R.fag j 6 nR.C1 j 6 nR. with n 2 f0, 1g Both-side concept E: E := Aj E1 u E2 j 9R.fag TBox axioms: C v D, E E ABox axioms: D(a), R(a, b) L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 14 / 39
  • 19.
    Metalanguage LG Metavocabulary:G = NCG ] NRG ] NIG N NIG: context names M NIG: module names C NCG: context classes, including class Ctx R NRG: contextual relations A NRG: contextual attributes For A 2 A, a set DA NIG of attribute values of A L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 15 / 39
  • 20.
    Metalanguage LG Metavocabulary:G = NCG ] NRG ] NIG N NIG: context names M NIG: module names C NCG: context classes, including class Ctx R NRG: contextual relations A NRG: contextual attributes For A 2 A, a set DA NIG of attribute values of A Metalanguage LG: SROIQ-RL axioms over context expressions: C := B j fcg jC1 u C2 jC1 t C2 j 9R.C1 j 9R.fcg j 9R.j 9A.fdAg j 9mod.fmg D := B jD1 u D2 j :C1 j 8R.D1 j 9R.fcg j 9A.fdAg j 9mod.fmg j 6 nR.C1 j 6 nR. E := B j E1 u E2 j 9R.fcg j 9A.fdAg j 9mod.fmg L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 15 / 39
  • 21.
    Metalanguage LG Metavocabulary:G = NCG ] NRG ] NIG N NIG: context names M NIG: module names C NCG: context classes, including class Ctx R NRG: contextual relations A NRG: contextual attributes For A 2 A, a set DA NIG of attribute values of A Metalanguage LG: SROIQ-RL axioms over context expressions: C := B j fcg jC1 u C2 jC1 t C2 j 9R.C1 j 9R.fcg j 9R.j 9A.fdAg j 9mod.fmg D := B jD1 u D2 j :C1 j 8R.D1 j 9R.fcg j 9A.fdAg j 9mod.fmg j 6 nR.C1 j 6 nR. E := B j E1 u E2 j 9R.fcg j 9A.fdAg j 9mod.fmg Individual variable this: c 2 N [ fthisg L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 15 / 39
  • 22.
    Object language LS Object vocabulary: any DL vocabulary S = NCS ] NRS ] NIS Eval expression Given X an object expression in S and C a context expression in G eval(X,C) “The interpretation of X in all the contexts of type C” Left-side only: “imports” meaning of X from all of the contexts in C Object language LS: SROIQ-RL axioms over object expressions Object language with references Le S: extension with eval expressions L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 16 / 39
  • 23.
    Contextualized Knowledge Repository Contextualized Knowledge Repository: K = hG, fKmgm2Mi G is a KB over G [ S, containing metalanguage axioms in LG or global object axioms in LS for every module name m 2 M, Km is a KB over S, containing object axioms with references in Le S L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 17 / 39
  • 24.
    A CKR forrepresenting provenance, access-control, and trust metadata (PlanetData EU Project L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 18 / 39
  • 25.
    Tourism example: introduction Tourism example: Idea: Tourism recommendation for events in Trentino Structure of contexts represent events and tourists information Ô Task: find interesting events on the base of tourists’ preferences We model this domain in a CKR Ktour = hG, fKmgm2Mi L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 19 / 39
  • 26.
    Tourism example: CKRstructure Event CulturalEvent SportEvent VolleyMatch VolleyA1 Competition Concert Tourist SportiveTourist CulturalTourist campionato_A1_2012-13 G trento_cuneo_120922 volley_fan_01 trento_latina_130203 modena_trento_130112 hasParentEvent L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 20 / 39
  • 27.
    Tourism example: CKRstructure Event CulturalEvent SportEvent VolleyMatch VolleyA1 Competition Concert Tourist SportiveTourist CulturalTourist campionato_A1_2012-13 G trento_cuneo_120922 volley_fan_01 trento_latina_130203 modena_trento_130112 m_sport_ev m_event m_v_match m_match1 m_match2 m_match3 m_tourist m_sp_tourist m_tourist01 hasParentEvent L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 20 / 39
  • 28.
    Tourism example: CKRstructure Event CulturalEvent SportEvent VolleyMatch VolleyA1 Competition Concert Tourist SportiveTourist CulturalTourist campionato_A1_2012-13 G trento_cuneo_120922 volley_fan_01 trento_latina_130203 modena_trento_130112 Kevent m_sport_ev m_event m_v_match m_match1 m_match2 m_match3 m_tourist m_sp_tourist m_tourist01 hasParentEvent Ksport_ev Kv_match Kmatch1 ... Ktourist01 L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 20 / 39
  • 29.
    Tourism example: somemodules contents In Kv_match: HomeTeam v Team HostTeam v Team Winner v Team Loser v Team In Kmatch2: HomeTeam(casa_modena_volley) HostTeam(itas_trentino_volley) Winner(casa_modena_volley) Loser(itas_trentino_volley) L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 21 / 39
  • 30.
    Tourism example: somemodules contents In Kv_match: HomeTeam v Team HostTeam v Team Winner v Team Loser v Team In Kmatch2: HomeTeam(casa_modena_volley) HostTeam(itas_trentino_volley) Winner(casa_modena_volley) Loser(itas_trentino_volley) ... In Ksport_ev: “Winners of major volley matches are top teams” eval(Winner,VolleyMatch u 9hasParentEvent.VolleyA1Competition) v TopTeam In Ksp_tourist: “Top teams are preferred teams” eval(TopTeam, SportEvent) v PreferredTeam L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 21 / 39
  • 31.
    Outline 1 Introduction:context in Semantic Web and Linked Open Data 2 Theory of contexts in AI 3 Contextualized Knowledge Repository (CKR) 4 Reasoning in CKR 5 CKR Prototype implementation 6 A CKR for Trentino Open Data L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 22 / 39
  • 32.
    Materialization calculus Kic Materialization calculus Kic: Calculus for instance checking in SROIQ-RL CKR Extension to the CKR structure of materialization calculus for SROEL of [Krötzsch, 2010] Formalizes the operation of forward closure in implementation Idea Composed by 3 sets of rules: Input rules I: translation of DL axioms to Datalog atoms Deduction rules P: forward inference rules Output rules O: translation for DL proved axiom L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 23 / 39
  • 33.
    Translation and deductionrules EL translation rules Iel(S, c) C(a)7! finst(a,C, c)g R(a, b)7! ftriple(a,R, b, c)g fag v C7! finst(a,C, c)g A v C7! fsubClass(A,C, c)g A u B v C7! fsubConj(A, B,C, c)g 9R.A v C7! fsubEx(R,A,C, c)g R v T7! fsubRole(R, T, c)g RS v T7! fsubRChain(R, S, T, c)g EL deduction rules Pel subClass(y, z, c), inst(x, y, c) ! inst(x, z, c) subConj(y1, y2, z, c), inst(x, y1, c), inst(x, y2, c) ! inst(x, z, c) subEx(v, y, z, c), triple(x, v, x0 , c), inst(x0 , y, c) ! inst(x, z, c) subRole(v,w, c), triple(x, v, x0 , c) ! triple(x,w, x0 , c) subRChain(u, v,w, c), triple(x, u, y, c), triple(y, v, z, c) ! triple(x,w, z, c) Output translation O(a, c) C(a)7! finst(a,C, c)g R(a, b)7! ftriple(a,R, b, c)g L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 24 / 39
  • 34.
    Translation and deductionrules Global rules Iglob(G) and Pglob C v 9mod.fmg7! fhasMod(C,m,gm)g C 2 C7! fsubClass(C, Ctx,gm)g C v 9A.fdg7! fhasAtt(C,A, d,gm)g c 2 N7! finst(c, Ctx,gm)g fcg v 9mod.fmg7! ftriple(c, mod,m,gm)g fcg v 9A.fdg7! ftriple(c,A, d,gm)g hasMod(c,m,gm), inst(x, c,gm) ! triple(x, mod,m,gm) hasAtt(c, a, d,gm), inst(x, c,gm) ! triple(x, a, d,gm) Local rules Iloc(S, c) and Ploc eval(A,C) v B7! fsubEval(A,C, B, c)g eval(R,C) v T7! fsubEvalR(R,C, T, c)g subEval(a, c1, b, c), inst(c0 , c1,gm), inst(x, a, c0) ! inst(x, b, c) subEvalR(r, c1, t, c), inst(c0 , c1,gm), triple(x, r, y, c0) ! triple(x, t, y, c) L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 25 / 39
  • 35.
    Outline 1 Introduction:context in Semantic Web and Linked Open Data 2 Theory of contexts in AI 3 Contextualized Knowledge Repository (CKR) 4 Reasoning in CKR 5 CKR Prototype implementation 6 A CKR for Trentino Open Data L. Serafini et al. (DKM - FBK) A CKR for TOD Trento, July 30, 2014 26 / 39
  • 36.
    CKR Prototype: introduction The prototype extends the Sesame Java framework with three modules: CKR core – CKR implementation on top of a Sesame RDF store knowledge addition/removal closure materialization SPARQL 1.1 queries transactions CKR server – extension of Sesame Server Workbench exposes CKR primitives includes a SPARQL endpoint includes an admin UI CKR client – library to access a CKR from a remote Java application Client JVM Client application CKR API CKR client Sesame HTTP API CKR core RDF store (Sesame native, memory, OWLIM, Bigdata) Server JVM SPARQL client CKR server persistent storage Web browser may embed in Java apps. CKR API SAIL API SPARQL endpoint Admin interface Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 27 / 39
  • 37.
    SPRINGLES CKR Coreis implemented on top of SPRINGLES: SParql-based Rule Inference over Named Graphs Layer Extending Sesame CKR API add triple to context CKR Core CKR implementation add triple to graph SPRINGLES RDF store SAIL API SAIL API CKR rules add triple; eval. rules and add inferences SPRINGLES features: transparent/on-demand closure materialization based on rules rules encoded as SPARQL queries addressing Named Graphs (NG) customizable rule evaluation strategy Why SPRINGLES: no inference over NGs in RDF stores Why SPARQL: exploits optimized query engines can scale to large KBs (cf. RETE) Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 28 / 39
  • 38.
    CKR calculus inSPRINGLES: rule example :pel-c-subc a spr:Rule ; spr:head GRAPH ?mx { ?x rdf:type ?z } ; spr:body GRAPH ?m1 { ?y rdfs:subClassOf ?z } GRAPH ?m2 { ?x rdf:type ?y } GRAPH sys:dep { ?mx sys:derivedFrom ?m1,?m2 } FILTER NOT EXISTS { GRAPH ?m0 { ?x rdf:type ?z } GRAPH sys:dep { ?mx sys:derivedFrom ?m0 } } . Context C ckr:hasModule ckr:hasModule . . . triples in ckr:global ?x rdf:type ?y ?y rdfs:subClassOf ?z Module ?m1 Module ?m2 Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 29 / 39
  • 39.
    CKR calculus inSPRINGLES: rule example :pel-c-subc a spr:Rule ; spr:head GRAPH ?mx { ?x rdf:type ?z } ; spr:body GRAPH ?m1 { ?y rdfs:subClassOf ?z } GRAPH ?m2 { ?x rdf:type ?y } GRAPH sys:dep { ?mx sys:derivedFrom ?m1,?m2 } FILTER NOT EXISTS { GRAPH ?m0 { ?x rdf:type ?z } GRAPH sys:dep { ?mx sys:derivedFrom ?m0 } } . Context C . . . triples in ckr:global triples in sys:dep ?x rdf:type ?y ?y rdfs:subClassOf ?z ckr:hasModule sys:closureOf ckr:hasModule ckr:hasModule sys:derivedFrom sys:derivedFrom Module ?m1 Module ?m2 Module ?mx Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 29 / 39
  • 40.
    CKR calculus inSPRINGLES: rule example :pel-c-subc a spr:Rule ; spr:head GRAPH ?mx { ?x rdf:type ?z } ; spr:body GRAPH ?m1 { ?y rdfs:subClassOf ?z } GRAPH ?m2 { ?x rdf:type ?y } GRAPH sys:dep { ?mx sys:derivedFrom ?m1,?m2 } FILTER NOT EXISTS { GRAPH ?m0 { ?x rdf:type ?z } GRAPH sys:dep { ?mx sys:derivedFrom ?m0 } } . Context C ckr:hasModule ckr:hasModule sys:derivedFrom . . . ckr:hasModule sys:closureOf sys:derivedFrom triples in ckr:global triples in sys:dep inference ?x rdf:type ?y ?y rdfs:subClassOf ?z ?x rdf:type ?z Module ?m1 Module ?m2 Module ?mx Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 29 / 39
  • 41.
    CKR calculus inSPRINGLES: evaluation strategy Composition of SPRINGLES primitives: parallel rule evaluation, sequence, fixpoint, repeat (not used by CKR) :closure-strategy spr:sequenceOf ( :task_add_axioms :task_global_closure :task_link_modules :task_ctx_closure ) . :task_add_axioms spr:evalOf ( :dep-glob :prp-ap :cls-thing :cls-nothing :dt-type ) . :task_global_closure spr:bind ?g_inf = ckr:global-inf ; spr:fixPointOf [ spr:evalOf ( :pel-c-subc ... :pel-r-subrc :pgl-c-addmod :pgl-i-addmod :pgl-c-submodc :pgl-c-subattc ) ] . :task_link_modules spr:evalOf ( :dep-local-i :dep-local-c ) . :task_ctx_closure spr:fixPointOf [ spr:evalOf ( :pel-c-subc ... :pel-r-subrc :plc-c-subevalat :plc-c-subexeval ) ] . Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 30 / 39
  • 42.
    Outline 1 Introduction:context in Semantic Web and Linked Open Data 2 Theory of contexts in AI 3 Contextualized Knowledge Repository (CKR) 4 Reasoning in CKR 5 CKR Prototype implementation 6 A CKR for Trentino Open Data Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 31 / 39
  • 43.
    Import in RDFStore OpenDataTN Data Package page Datasets Download Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 32 / 39
  • 44.
    Import in RDFStore OpenDataTN Data Package page Datasets Download RDF CSV JSON XML Package Metadata Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 32 / 39
  • 45.
    Import in RDFStore OpenDataTN Data Package page Datasets Download RDF CSV JSON XML Package Metadata Local storage Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 32 / 39
  • 46.
    Import in RDFStore OpenDataTN Data Package page Datasets Download Package Metadata RDF Mapping + RDF conversion RDF CSV JSON XML Local storage Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 32 / 39
  • 47.
    Import in RDFStore OpenDataTN Data Package page Datasets Download Package Metadata RDF Store Import RDF Mapping + RDF conversion RDF CSV JSON XML Local storage Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 32 / 39
  • 48.
    Francesco Corcoglioniti (DKM- FBK) A CKR for TOD Trento, July 30, 2014 33 / 39
  • 49.
    Francesco Corcoglioniti (DKM- FBK) A CKR for TOD Trento, July 30, 2014 34 / 39
  • 50.
    Metalevel structure Package p_biblioteche Dataset hasMember d_biblioteche 07/08/14 hasCreationDate hasTag libri Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 35 / 39
  • 51.
    Metalevel structure Package hasCreationDate p_biblioteche Dataset hasMember 07/08/14 hasTag libri d_biblioteche Mapping Activity d_biblioteche_ma usedFile usedMap wasGeneratedByMapping SourceFile MappingFile d_biblioteche_json d_biblioteche_map Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 35 / 39
  • 52.
    RDF store measures RDF Store measures: Total of imported datasets: 2078 RDF: 157 JSON: 799 CSV: 1122 Number of asserted and inferred triples: 21,201,011 Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 36 / 39
  • 53.
    Query interface Queryinterface REST GET request REST interface SPARQL 1.1 MetaReasons Server RDF Store Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 37 / 39
  • 54.
    Thank you forlistening OpenData Trentino Repository Loris Bozzato, Gaetano Calabrese, Luciano Serafini https://dkm.fbk.eu/ DKM - Data and Knowledge Management Research Unit, FBK-Irst, Fondazione Bruno Kessler - Trento, Italy Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 38 / 39
  • 55.
    References I Bao,J., Tao, J., and McGuinness, D. (2010). Context representation for the semantic web. In Procs. of WebSci10. Giunchiglia, F. and Ghidini, C. (2001). Local Models Semantics, or Contextual Reasoning = Locality + Compatibility. Artificial Intelligence, 127:2001. Klarman, S. and Gutiérrez-Basulto, V. (2010). ALCALC : a context description logic. In JELIA. Krötzsch, M. (2010). Efficient Inferencing for OWL EL. In JELIA 2010, volume 6341 of Lecture Notes in Computer Science, pages 234–246. Springer. Lenat, D. (1998). The Dimensions of Context Space. Technical report, CYCorp. Published online http://www.cyc.com/doc/context-space.pdf (accessed June 21, 2009). McCarthy, J. (1993). Notes on formalizing context. In IJCAI. Francesco Corcoglioniti (DKM - FBK) A CKR for TOD Trento, July 30, 2014 39 / 39