27
Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé Ralph Schäfermeier, Adrian Paschke, Alexandru Todor Corporate Semantic Web Institute for Computer Science Freie Universität Berlin 4th DBpedia Community Meeting @BIS 2015 in Poznan

Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Embed Size (px)

Citation preview

Page 1: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke, Alexandru Todor Corporate Semantic Web Institute for Computer Science Freie Universität Berlin

4th DBpedia Community Meeting @BIS 2015 in Poznan

Page 2: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

• Motivation

• Aspect-Oriented Programming

• Aspect-Oriented Ontologies

• Aspects in the DBpedia ontology

Outline

Page 3: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

• Provenance metadata

• Quality metadata • different with different languages

• Alignment to external ontologies • possibly contradicting

• Enhance overall development/evolution process • but unobtrusive

Motivation

Page 4: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

• Used for separation of cross-cutting concerns

• Decomposition of a system based on functional and non-functional requirements

• Generally provides semantics for: • describing a module

• re-combining modules at runtime

Aspect-Oriented Programming

Page 5: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Example: Authentication

void makeDeposit(Account a, float amount) { AuthService as = getAuthService (); if (!as.authenticated(a.user)) as.authenticate (a.user); a.balance +=amount;}

void makeWithdrawal(Account a, float amount) { AuthService as = getAuthService (); if (!as.authenticated(a.user)) as.authenticate (a.user); a.balance −= amount;}

Page 6: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Example: Authentication

void makeDeposit(Account a, float amount) { AuthService as = getAuthService (); if (!as.authenticated(a.user)) as.authenticate (a.user); a.balance +=amount;}

void makeWithdrawal(Account a, float amount) { AuthService as = getAuthService (); if (!as.authenticated(a.user)) as.authenticate (a.user); a.balance −= amount;}

Actual business logic

Page 7: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Example: Authentication

void makeDeposit(Account a, float amount) { AuthService as = getAuthService (); if (!as.authenticated(a.user)) as.authenticate (a.user); a.balance +=amount;}

void makeWithdrawal(Account a, float amount) { AuthService as = getAuthService (); if (!as.authenticated(a.user)) as.authenticate (a.user); a.balance −= amount;} Re-occuring authentication concern

→ strong inter-dependencies

Page 8: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Example: Authentication Aspect

Aspect Authentication () { AuthService as = getAuthService (); if (!as.authenticated(a.user)) as.authenticate (a.user);}

void makeWithdrawal(Account a, float amount) { a.balance −= amount;}

void makeDeposit(Account a, float amount) { a.balance +=amount;}

Separation into self-contained aspect

Page 9: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Example: Authentication Aspect

Aspect Authentication () { AuthService as = getAuthService (); if (!as.authenticated(a.user)) as.authenticate (a.user);}

@before Authenticationvoid makeWithdrawal(Account a, float amount) { a.balance −= amount;}

@before Authenticationvoid makeDeposit(Account a, float amount) { a.balance +=amount;}

Separation into self-contained aspect

Connection via "Join Points"

Page 10: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

• A pointcut is a set of join points defined by quantification

Two Principles: Quantification and Obliviousness

8m(p1, . . . , pn) 2 M :

s(m(p1, . . . , pn)) ! (m(p1, . . . , pn) ! a(p1, . . . , pn))[Steimann 2005, Rashid 2006]

m(p1 , . . . , pn ) ∈ M: a method adhering to the signature m(p1, . . . , pn),M: set of all methods defined in the software systems: a query specifying a matching criterion,a(p1, . . . , pn): the execution of the aspect with all the parameters of each method, respectively

Page 11: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

• A pointcut is a set of join points defined by quantification

Two Principles: Quantification and Obliviousness

8m(p1, . . . , pn) 2 M :

s(m(p1, . . . , pn)) ! (m(p1, . . . , pn) ! a(p1, . . . , pn))[Steimann 2005, Rashid 2006]

• Example: void makeDeposit(Account a, float amount) {…}void makeWithdrawal(Account a, float amount) {…}

@Aspect class AuthenticationAspect () { @Before(”execution(*.make*(Account,float))”) void authenticate(Account a, float amount) { AuthService as = getAuthService () ; if (!as.authenticated(a.user )) as.authenticate (a.user ) ;} }

Pointcut = abstract definition of a set of join points

Page 12: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

• Improvement of reasoning and query result retrieval performance

• Scalability for ontology evolution and maintenance

• Complexity management

• Amelioration of understandability

• (Partial) reuse

• Context-awareness

• Personalization

[Parent and Spaccapietra, 2009]

Modular Ontologies: Motivation

Page 13: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Aspect-Oriented Ontology Development: Overview

to make statements about axioms. The OWL 2 language, however, does permit this kindof statements in the form of annotations, with the limitation that such annotations are notinterpreted under the OWL 2 semantics. This property of OWL 2 is advantageous withrespect to the obliviousness property of AOP, since adding annotation axioms to an OWL2 ontology does not alter the semantics of the ontology.

Furthermore, OWL 2 allows the object of an annotation axiom to be any kind ofOWL 2 construct, which makes it very flexible with regard to the definition of complexaspects as described in Section 3.2. This way, it is possible to use all features of thelanguage in order to define aspects, as well as inference on aspects.

4.2. Aspect Ontology

In order to permit a formal specification of aspects, we developed an ontology withan initial classification schema of aspects (see Figure 1e) and an annotation propertyhasAspect. This property can either be used in order to assign aspects to axioms, ormore specialized subproperties can be added. The range of the hasAspect property isdefined as the base class of all aspects, Aspect.

4.3. Module Selection

We have implemented our approach in the form of a plug-in3 to the widely-knownProtege ontology editor4.

As described in Section 2.4, the connections between aspects and their targets mayeither established by using an extensional description (by providing a complete set oftargets), or intensionally (by specifying the properties of the targets using an abstractquery or quantification). Functionality for the first variant involves manually creating theappropriate annotation axioms (see Figure 2, middle).

Query based aspect annotation

Query Manual annotation/selected editing context in tool

Original ontology

Ontology with aspect annotations

Aspect-based module selection

Aspect namesor descriptions

Ontologymodule

Figure 2. Our approach to aspect-oriented ontology modularization. Axioms of the original ontology (left)are annotated with entities from an external aspect ontology (center). Axiom selection is based on queries or isperformed manually. Module extraction happens dynamically, as a particular part of the ontology is requested(right). The parameters of the request are one or several aspect names. The result is an ontology moduleincluding exactly those axioms that belong to the given aspects.

The intensional specification by quantification is realized through a SPARQL inter-face. For the reasons described in Section 3.1, the ontology needs to be temporarily trans-

3http://page.mi.fu-berlin.de/schaef/aspectowl/de.fuberlin.csw.aspectowl.protege.jar

4http://protege.stanford.edu/

Definition Selection

Page 14: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Ontology of Aspects

Aspect

Graph

Advice Pointcut

hasAdvice

rdf:type

rdfs:domainrdfs:range

hasPointcut

rdf:type

owl:equivalentClass

rdf:type

hasAdvice some AdvicehasPointcut some Pointcut

rdfs:range

United_Kingdom

recognizedBy

Kosovo

self_governing

rdf:type

(a) Original FAOgeopolitical ontologyselected for reuse.

Interval_1

"2008-02-18T00:00:00"^^xsd:dateTime

hasBeginning

DateTimeInterval

rdf:type

(b) Custom extension of theoriginal ontology for repre-senting a temporal aspect.

Interval_1

"2008-02-18T00:00:00"^^xsd:dateTime

hasBeginning

United_Kingdom

recognizedBy

Kosovo

self_governing

rdf:type

DateTimeInterval

rdf:type

temporalAspect

(c) Modeling of the extension as an aspect by using anaxiom annotation.

"2008-02-18T00:00:00"^^xsd:dateTime

hasBeginning

Interval_1 United_Kingdom

recognizedBy

Kosovo

Recognition_1

self_governing

rdf:type

DateTimeInterval

rdf:type

Recognition

rdf:type

recognizingEntity validity

(d) Necessary refactoring of the reused ontology in order toallow for the extension, following the W3C n-ary relationspattern

Aspect

BuiltInAspect

ResoningComplexity

AccessRestriction

ExternalAspect

Compatibility

ProvenanceBasedTrust

≡ Provenance

Trust

rdfs:range

CustomerSpecificFeature

<<annotation>>hasAspect

<<annotation>>…

rdfs:subPropertyOf

(e) An ontology of aspects providing an in-titial classification schema for aspects and ahasAspect annotation property intended to beextended by specialized subproperties.

Figure 1. An example involving the integration of an external ontology for reuse using aspects and the n-aryrelations pattern and the aspect ontology.

the entailment has both aspects. Algorithm 1 demonstrates the carrying over of aspectsto inferred axioms.

The set A and the boolean flag are needed for determining whether there exists a jus-tification J containing only axioms that are free of aspects. For each J 2 {J1, . . . ,Jn},where any of the axioms ex is assigned to an aspect a using the property asp, whichis a sub-property of a property hasAspect, the aspect assigning axiom is added to a setA replacing ex with ⌘ (line 6) and the flag is set to true (line 7). Once the inner loopterminates, and the flag still has the value false, then the inferred axiom can safely beconsidered aspect free, and the algorithm can terminate prematurely (line 9). Otherwise,all aspect assigning axioms are collected in A and eventually added to O (line 13).

It must be noted that if aspects are used for modularization of an ontology, and itis explicitly allowed to have contradictions in the original ontology (which are meant tobe resolved during the module selection stage), if the above algorithm is applied to the

. . .

Page 15: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Aspect-Oriented Ontologies

Page 16: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

RDF example: Provenance @prefix : <http://www.example.org/aspect123#> .@prefix this: <http://www.example.org/aspect123> ....

this: { this: a aspect:Aspect . aspect:hasPointcut :pointcut . aspect:hasAdvice :advice .}

:pointcut { dbpedia:Barack_Obama dbpedia_prop:spouse dbpedia:Michelle_Obama.}

:advice { :pointcut prov:generatedAtTime "2004-07-29T10:38:00Z"^^xsd:dateTime . :pointcut prov:entity <http://de.wikipedia.org/wiki/Barack_Obama> :pointcut prov:wasAttributedTo _:a . _:a foaf:homepage <http://de.wikipedia.org/wiki/user:Mathias_Schindler>}

Page 17: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Generating views by querying aspects with named graphs

@prefix aspect: <http://www.corporate-semantic web.de/ontologies/aspects#> .prefix : <…>

select ?G ?s ?p ?o where { {graph ?G {: a aspect:Aspect}} UNION {graph ?H {: a aspect:Aspect {: aspect:hasPointcut ?G} UNION {: aspect:hasAdvice ?G}}} graph ?G {?s ?p ?o}}

Page 18: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Arbitrarily many overlapping concerns encapsulated in aspects

Page 19: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Arbitrarily many overlapping concerns encapsulated in aspects

:pointcut prov:generatedAtTime "2004-07-29T10:38:00Z"^^xsd:dateTime . :pointcut prov:entity <http://de.wikipedia.org/wiki/Barack_Obama> :pointcut prov:wasAttributedTo _:a . _:a foaf:homepage <http://de.wikipedia.org/wiki/user:Mathias_Schindler>

provenance

Page 20: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Arbitrarily many overlapping concerns encapsulated in aspects

:pointcut prov:generatedAtTime "2004-07-29T10:38:00Z"^^xsd:dateTime . :pointcut prov:entity <http://de.wikipedia.org/wiki/Barack_Obama> :pointcut prov:wasAttributedTo _:a . _:a foaf:homepage <http://de.wikipedia.org/wiki/user:Mathias_Schindler>

provenance temporal semantics

Page 21: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Arbitrarily many overlapping concerns encapsulated in aspects

:pointcut prov:generatedAtTime "2004-07-29T10:38:00Z"^^xsd:dateTime . :pointcut prov:entity <http://de.wikipedia.org/wiki/Barack_Obama> :pointcut prov:wasAttributedTo _:a . _:a foaf:homepage <http://de.wikipedia.org/wiki/user:Mathias_Schindler>

http://trustyuri.net/RAq2h8A83lGbT2015ua85K

temporal semanticsprovenance

digital signature

Page 22: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Arbitrarily many overlapping concerns encapsulated in aspects

:pointcut prov:generatedAtTime "2004-07-29T10:38:00Z"^^xsd:dateTime . :pointcut prov:entity <http://de.wikipedia.org/wiki/Barack_Obama> :pointcut prov:wasAttributedTo _:a . _:a foaf:homepage <http://de.wikipedia.org/wiki/user:Mathias_Schindler>

http://trustyuri.net/RAq2h8A83lGbT2015ua85K

schema.org

DUL

temporal semanticsprovenance

digital signature aligments to external ontologies

Page 23: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Protégé-Plugin

(a) An aspect defined using a SPARQL query. Theaspect definition consists of the query, an aspect an-notation property, and an aspect entity. All axiomsselected by the query will be annotated with the se-lected aspect entity, using the selected aspect anno-tation property.

(b) Inferred axioms with inferred aspect annota-tions.

Figure 3. Example screenshots.

formed to its triple-based representation in RDF. Using SPARQL CONSTRUCT queries,the subgraph of the triple based ontology representation that corresponds to the desiredaxioms is selected. The resulting subgraph is transformed back into an OWL 2 model,which then contains the desired set of axioms. For each axiom in the result set, an aspectannotation axiom is then added to the ontology, with the axiom as annotation subject andthe specified aspect as the annotation object (see Figure 2, to the left, and Figure 3a).

4.4. Module Extraction

The extraction process involves providing a set of aspects and results in the extractionof the corresponding ontology modules (see Figure2, to the right). The provided aspectscan be the result of manual selection or of a query, e.g., by using the DL-query facilityprovided by Protege.

4.5. Aspects and Entailment

The checking for aspects of entailed axioms has been implemented as described in Sec-tion 3.3. Since OWL 2 permits the creation of subproperties of annotation properties, andthe aspect ontology encourages users to do so, it is necessary to transitively check for allsubproperties of the hasAspect property. Inferred axioms with aspect annotations arepresented in a special Protege view (see Figure3b).

4.6. The Ontology Reuse Case

To demonstrate the applicability and usefulness of our approach to aspect-oriented on-tology modules using annotations, we depict a scenario where an external ontology isimported and extended by additional knowledge. The case involves modeling knowledgeabout territories and their status wrt. to international recognition as a sovereign state. Asan example, we picked the Republic of Kosovo, which, at the time this writing, has beenrecognized by 108 UN member countries, leaving its status disputed.

Page 24: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Web Protégé: Aspect as Modeling Context

• List of preconfigured named aspects

• Selected aspects are added to all axioms

Page 25: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

• universal

• unobtrusive

• use would be optional

• easy to use for ontology modelers

• reasoning on meta-model for modules possible (e.g. module selection based on complex time constraints).

Benefits

Page 26: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

Thanks

Page 27: Modular Development of the DBpedia Ontology with Ontology Aspects and Web Protégé

Ralph Schäfermeier, Adrian Paschke Aspect-Orientation in the DBpedia ontology DBpedia Community Meeting 2015 Poznan

[d'Aquin 2012] Mathieu d’Aquin. Modularizing Ontologies. In Mari Carmen Suárez-Figueroa, Asunción Gómez- Pérez, Enrico Motta, and Aldo Gangemi, editors, Ontology Engineering in a Networked World, pages 213–233. Springer Berlin Heidelberg, 2012

[Priss 2008] Uta Priss. Facet-like Structures in Computer Science. Axiomathes, 18(2):243–255, June 2008.

[Steimann 2005] Friedrich Steimann. Domain Models Are Aspect Free. In Lionel Briand and Clay Williams, editors, Model Driven Engineering Languages and Systems, number 3713 in Lecture Notes in Computer Science, pages 171–185. Springer Berlin Heidelberg, January 2005.

[Rashid 2006] Awais Rashid and Ana Moreira. Domain Models Are NOT Aspect Free. In Oscar Nierstrasz, Jon Whittle, David Harel, and Gianna Reggio, editors, Model Driven Engineering Languages and Sys- tems, number 4199 in Lecture Notes in Computer Science, pages 155–169. Springer Berlin Heidelberg, January 2006.

[Konev 2009] Boris Konev, Carsten Lutz, Dirk Walther, and Frank Wolter. Formal Properties of Modularisation. In Heiner Stuckenschmidt, Christine Parent, and Stefano Spaccapietra, editors, Modular Ontologies, number 5445 in Lecture Notes in Computer Science, pages 25–66. Springer Berlin Heidelberg, January 2009.

References