Reasonable Ontology Templates
Martin G. Skjæveland Henrik Forssell Johan W. Klüwer Daniel Lupp Evgenij Thorstensen Arild Waaler WOP2017 October 21, 2017 OTTR Reasonable Ontology Templates (OTTR) Introduction and plan for talk
Tools and methodology • A better way of constructing ontologies • OWL macros expressed in OWL • abstractions, encapsulation, clear interface • nested • template: parameters • h i 7→ O instance: arguments • h i 7→ Oarguments OWL serialisation • OWL reasoning • OTTR Leverage W3C stack and tools • Extensible framework for representing and transforming data • Demo • 2 / 8 (p1,..., pn) |{z}T | {z } name parameters
Parameters can be any concept, role, or individual name or data value • Template instance: • 1 (p1, p2, p3) p1 C, D p2.E, F(p3) T | {z } ⇒ { v v ∃ } arguments
Templates can be (non-cyclically) nested • Instances are expanded recursively •
Ontology templates
Template: • head body z }| { :: z}|{
3 / 8 (p1,..., pn) |{z}T | {z } name parameters
Parameters can be any concept, role, or individual name or data value • Template instance: • 1 (p1, p2, p3) p1 C, D p2.E, F(p3) T | {z } ⇒ { v v ∃ } arguments
Templates can be (non-cyclically) nested • Instances are expanded recursively •
Ontology templates
Template: • head body z }| { :: z}|{ O
3 / 8 (p1,..., pn) | {z } parameters
Parameters can be any concept, role, or individual name or data value • Template instance: • 1 (p1, p2, p3) p1 C, D p2.E, F(p3) T | {z } ⇒ { v v ∃ } arguments
Templates can be (non-cyclically) nested • Instances are expanded recursively •
Ontology templates
Template: • head body z }| { :: z}|{ |{z}T O name
3 / 8 Parameters can be any concept, role, or individual name or data value • Template instance: • 1 (p1, p2, p3) p1 C, D p2.E, F(p3) T | {z } ⇒ { v v ∃ } arguments
Templates can be (non-cyclically) nested • Instances are expanded recursively •
Ontology templates
Template: • head body z }| { z}|{ (p1,..., pn) :: |{z}T | {z } O name parameters
3 / 8 D p .E, F(p ) v ∃ 2 3
Template instance: • 1 (p1, p2, p3) p1 C, D p2.E, F(p3) T | {z } ⇒ { v v ∃ } arguments
Templates can be (non-cyclically) nested • Instances are expanded recursively •
Ontology templates
Template: • head body z }| { z }| { (p1,..., pn) :: p1 C, |{z}T | {z } { v } name parameters
Parameters can be any concept, role, or individual name or data value •
3 / 8 F(p3)
Template instance: • 1 (p1, p2, p3) p1 C, D p2.E, F(p3) T | {z } ⇒ { v v ∃ } arguments
Templates can be (non-cyclically) nested • Instances are expanded recursively •
Ontology templates
Template: • head body z }| { z }| { (p1,..., pn) :: p1 C, D p2.E, |{z}T | {z } { v v ∃ } name parameters
Parameters can be any concept, role, or individual name or data value •
3 / 8 Template instance: • 1 (p1, p2, p3) p1 C, D p2.E, F(p3) T | {z } ⇒ { v v ∃ } arguments
Templates can be (non-cyclically) nested • Instances are expanded recursively •
Ontology templates
Template: • head body z }| { z }| { (p1,..., pn) :: p1 C, D p2.E, F(p3) |{z}T | {z } { v v ∃ } name parameters
Parameters can be any concept, role, or individual name or data value •
3 / 8 Templates can be (non-cyclically) nested • Instances are expanded recursively •
Ontology templates
Template: • head body z }| { z }| { (p1,..., pn) :: p1 C, D p2.E, F(p3) |{z}T | {z } { v v ∃ } name parameters
Parameters can be any concept, role, or individual name or data value • Template instance: • 1 (p1, p2, p3) p1 C, D p2.E, F(p3) T | {z } ⇒ { v v ∃ } arguments
3 / 8 Instances are expanded recursively •
Ontology templates
Template: • head body z }| { z }| { (p1,..., pn) :: p1 C, D p2.E, F(p3), 2(p4,...) |{z}T | {z } { v v ∃ T } name parameters
Parameters can be any concept, role, or individual name or data value • Template instance: • 1 (p1, p2, p3) p1 C, D p2.E, F(p3) T | {z } ⇒ { v v ∃ } arguments
Templates can be (non-cyclically) nested •
3 / 8 Ontology templates
Template: • head body z }| { z }| { (p1,..., pn) :: p1 C, D p2.E, F(p3), 2(p4,...) |{z}T | {z } { v v ∃ T } name parameters
Parameters can be any concept, role, or individual name or data value • Template instance: • 1 (p1, p2, p3) p1 C, D p2.E, F(p3), 2(...) T | {z } ⇒ { v v ∃ T } arguments
Templates can be (non-cyclically) nested • Instances are expanded recursively • 3 / 8 withVariables * 1
templateRef 1 index hasArgument 0..* TemplateInstance Argument value 1 withValues * [Resource]
OTTR OWL vocabulary
1 [Resource] variable hasParameter 0..* Template Parameter index 1 xsd:int
http://ns.ottr.xyz
4 / 8 withVariables * 1
templateRef
withValues *
OTTR OWL vocabulary
1 [Resource] variable hasParameter 0..* Template Parameter index 1
1 xsd:int index hasArgument 0..* TemplateInstance Argument value 1 [Resource]
http://ns.ottr.xyz
4 / 8 withVariables *
withValues *
OTTR OWL vocabulary
1 [Resource] variable hasParameter 0..* Template Parameter index 1 1
templateRef 1 xsd:int index hasArgument 0..* TemplateInstance Argument value 1 [Resource]
http://ns.ottr.xyz
4 / 8 OTTR OWL vocabulary
withVariables * 1 [Resource] variable hasParameter 0..* Template Parameter index 1 1
templateRef 1 xsd:int index hasArgument 0..* TemplateInstance Argument value 1 withValues * [Resource]
http://ns.ottr.xyz
4 / 8 • RDF macros • not only OWL PartOf (Hammer, Handle) • use for LOD • Expansion: • copy template graph • paragraph 7→ argument • recurse • Arguments • any RDF resource • incl. e.g., RDF(S)/OWL voc. • template IRIs • lists • variable-length args • multiple instances
• Reasoning • body • head • expanded • instantiated
PartOf (Whole, Part) :: Whole hasPart.Part { v ∃ }
5 / 8 • RDF macros • not only OWL • use for LOD • Expansion: • copy template graph • paragraph 7→ argument • recurse • Arguments • any RDF resource • incl. e.g., RDF(S)/OWL voc. • template IRIs • lists • variable-length args • multiple instances
• Reasoning • body • head • expanded • instantiated
PartOf (Whole, Part) :: Whole hasPart.Part { v ∃ }
PartOf (Hammer, Handle)
5 / 8 • RDF macros • not only OWL • use for LOD • Expansion: • copy template graph • paragraph 7→ argument • recurse • Arguments • any RDF resource • incl. e.g., RDF(S)/OWL voc. • template IRIs • lists • variable-length args • multiple instances
• Reasoning • body • head • expanded • instantiated
PartOf (Whole, Part) :: Whole hasPart.Part { v ∃ }
PartOf (Hammer, Handle) ⇒ Hammer hasPart.Handle { v ∃ }
5 / 8 • RDF macros • not only OWL • use for LOD • Expansion: • copy template graph • paragraph 7→ argument • recurse • Arguments • any RDF resource • incl. e.g., RDF(S)/OWL voc. • template IRIs • lists • variable-length args PartOf (Hammer, Handle) • multiple instances • Reasoning • body • head • expanded • instantiated
PartOf (Whole, Part) :: Whole hasPart.Part { v ∃ } ### head:
### body: :Part a owl:Class . :Whole a owl:Class ; rdfs:subClassOf [ a owl:Restriction ; owl:onProperty ex:hasPart ; owl:someValuesFrom :Part].
5 / 8 • RDF macros • not only OWL • use for LOD • Expansion: • copy template graph • paragraph 7→ argument • recurse • Arguments • any RDF resource • incl. e.g., RDF(S)/OWL voc. • template IRIs • lists • variable-length args • multiple instances
• Reasoning • body • head • expanded • instantiated
PartOf (Whole, Part) :: Whole hasPart.Part { v ∃ } ### head:
### body: :Part a owl:Class . :Whole a owl:Class ; rdfs:subClassOf [ a owl:Restriction ; owl:onProperty ex:hasPart ; owl:someValuesFrom :Part].
PartOf (Hammer, Handle)
5 / 8 • RDF macros • not only OWL • use for LOD • Expansion: • copy template graph • paragraph 7→ argument • recurse • Arguments • any RDF resource • incl. e.g., RDF(S)/OWL voc. • template IRIs • lists • variable-length args • multiple instances
• Reasoning • body • head • expanded • instantiated
PartOf (Whole, Part) :: Whole hasPart.Part { v ∃ } ### head:
### body: :Part a owl:Class . :Whole a owl:Class ; rdfs:subClassOf [ a owl:Restriction ; owl:onProperty ex:hasPart ; owl:someValuesFrom :Part].
PartOf (Hammer, Handle) [] ottr:templateRef
5 / 8 • RDF macros • not only OWL • use for LOD • Expansion: • copy template graph • paragraph 7→ argument • recurse • Arguments • any RDF resource • incl. e.g., RDF(S)/OWL voc. • template IRIs • lists • variable-length args • multiple instances
• Reasoning • body • head • expanded • instantiated
PartOf (Whole, Part) :: Whole hasPart.Part { v ∃ } ### head:
### body: :Part a owl:Class . :Whole a owl:Class ; rdfs:subClassOf [ a owl:Restriction ; owl:onProperty ex:hasPart ; owl:someValuesFrom :Part].
PartOf (Hammer, Handle) [] ottr:templateRef
5 / 8 • RDF macros • not only OWL • use for LOD • Expansion: • copy template graph • paragraph 7→ argument • recurse • Arguments • any RDF resource • incl. e.g., RDF(S)/OWL voc. • template IRIs • lists • variable-length args • multiple instances
• Reasoning • body • head • expanded • instantiated
PartOf (Whole, Part) :: SubSomeValuesFrom(Whole, hasPart, Part) { } ### head:
### body: [] ottr:templateRef ottr-owl:SubSomeValuesFrom; ottr:withValues ( :Whole ex:hasPart :Part).
PartOf (Hammer, Handle) [] ottr:templateRef
5 / 8 • Expansion: • copy template graph • paragraph 7→ argument • recurse • Arguments • any RDF resource • incl. e.g., RDF(S)/OWL voc. • template IRIs • lists • variable-length args • multiple instances
• Reasoning • body • head • expanded • instantiated
PartOf (Whole, Part) :: SubSomeValuesFrom(Whole, hasPart, Part) { } • RDF macros ### head: • not only OWL
### body: [] ottr:templateRef ottr-owl:SubSomeValuesFrom; ottr:withValues ( :Whole ex:hasPart :Part).
PartOf (Hammer, Handle) [] ottr:templateRef
5 / 8 • Arguments • any RDF resource • incl. e.g., RDF(S)/OWL voc. • template IRIs • lists • variable-length args • multiple instances
• Reasoning • body • head • expanded • instantiated
PartOf (Whole, Part) :: SubSomeValuesFrom(Whole, hasPart, Part) { } • RDF macros ### head: • not only OWL
PartOf (Hammer, Handle) [] ottr:templateRef
5 / 8 • Reasoning • body • head • expanded • instantiated
PartOf (Whole, Part) :: SubSomeValuesFrom(Whole, hasPart, Part) { } • RDF macros ### head: • not only OWL
5 / 8 PartOf (Whole, Part) :: SubSomeValuesFrom(Whole, hasPart, Part) { } • RDF macros ### head: • not only OWL
5 / 8 head instance head format lifting & lowering body format XML, XSLx XSD+SAWSDL XSLT OWL OTTRs (RDF) (SHACL, ShEx) SPARQL OWL
All formats generated from templates!
Extensible framework
lifting
head body z }| { z}|{ (p1,..., pn) :: T O lowering
6 / 8 Extensible framework
lifting
head body z }| { z}|{ (p1,..., pn) :: T O lowering
head instance head format lifting & lowering body format XML, XSLx XSD+SAWSDL XSLT OWL OTTRs (RDF) (SHACL, ShEx) SPARQL OWL
All formats generated from templates!
6 / 8 CLI java tool • OTTR vocabulary: • http://ns.ottr.xyz Library of OTTRs: • http://library.ottr.xyz Online web application: • http://osl.ottr.xyz Git: • http://gitlab.com/ottr/ ISWC Poster •
Resources
http://www.ottr.xyz •
7 / 8 OTTR vocabulary: • http://ns.ottr.xyz Library of OTTRs: • http://library.ottr.xyz Online web application: • http://osl.ottr.xyz Git: • http://gitlab.com/ottr/ ISWC Poster •
Resources
http://www.ottr.xyz • CLI java tool •
7 / 8 Library of OTTRs: • http://library.ottr.xyz Online web application: • http://osl.ottr.xyz Git: • http://gitlab.com/ottr/ ISWC Poster •
Resources
http://www.ottr.xyz • CLI java tool • OTTR vocabulary: • http://ns.ottr.xyz
7 / 8 Online web application: • http://osl.ottr.xyz Git: • http://gitlab.com/ottr/ ISWC Poster •
Resources
http://www.ottr.xyz • CLI java tool • OTTR vocabulary: • http://ns.ottr.xyz Library of OTTRs: • http://library.ottr.xyz
7 / 8 Git: • http://gitlab.com/ottr/ ISWC Poster •
Resources
http://www.ottr.xyz • CLI java tool • OTTR vocabulary: • http://ns.ottr.xyz Library of OTTRs: • http://library.ottr.xyz Online web application: • http://osl.ottr.xyz
7 / 8 ISWC Poster •
Resources
http://www.ottr.xyz • CLI java tool • OTTR vocabulary: • http://ns.ottr.xyz Library of OTTRs: • http://library.ottr.xyz Online web application: • http://osl.ottr.xyz Git: • http://gitlab.com/ottr/
7 / 8 Resources
http://www.ottr.xyz Reasonable Ontology Templates Martin G. Skjæveland1 Henrik Forssell1 Johan W. Klüwer2 Daniel P. Lupp1 Evgenij Thorstensen1 Arild Waaler1 • 1Department of Informatics, University of Oslo, 2DNV GL, Norway CLI java tool • Overview OTTR OWL Vocabulary: http://ns.ottr.xyz Examples Modular macros for OWL/RDF — in OWL/RDF withVariables * Terse input and iterations with lists + use of 3 “official” OTTRs: • 1 [Resource] • Good for ontology construction and maintenance variable
7 / 8 Large-scale evaluation • Further development of templates and tools • Theory for structuring a library templates, e.g., what is a subtemplate? • Template library maintenance • Ontology as pre-condition: template heads as ontologies too • Protege plugin • Excel plugin •
The Future and Future work
Engineering ontologies using only OTTR templates • API for OWL (— or AI for OWL) • Ontology experts construct OTTRs • “Knowledge engineers” combine OTTRs to user-facing templates • Domain experts use tabular format •
8 / 8 The Future and Future work
Engineering ontologies using only OTTR templates • API for OWL (— or AI for OWL) • Ontology experts construct OTTRs • “Knowledge engineers” combine OTTRs to user-facing templates • Domain experts use tabular format • Large-scale evaluation • Further development of templates and tools • Theory for structuring a library templates, e.g., what is a subtemplate? • Template library maintenance • Ontology as pre-condition: template heads as ontologies too • Protege plugin • Excel plugin •
8 / 8