FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES Ontology Editing - - PowerPoint PPT Presentation

foundations of semantic web technologies
SMART_READER_LITE
LIVE PREVIEW

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES Ontology Editing - - PowerPoint PPT Presentation

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES Ontology Editing Sebastian Rudolph Dresden, July 2 Content Overview & XML 9 APR DS2 Hypertableau II 7 JUN DS5 Introduction into RDF 9 APR DS3 Tutorial 5 11 JUN DS2 RDFS Syntax &


slide-1
SLIDE 1

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

Ontology Editing

Sebastian Rudolph

Dresden, July 2

slide-2
SLIDE 2

Content

Overview & XML 9 APR DS2 Hypertableau II 7 JUN DS5 Introduction into RDF 9 APR DS3 Tutorial 5 11 JUN DS2 RDFS – Syntax & Intuition 12 APR DS5 SPARQL Syntax & Intuition 11 JUN DS3 RDFS – Semantics 16 APR DS2 SPARQL – Semantics 14 JUN DS2 RDFS Rule-based Reasoning 16 APR DS3 SPARQL Algebra 14 JUN DS3 Tutorial 1 19 APR DS5 SPARQL 1.1 14 JUN DS5 OWL – Syntax & Intuition 26 APR DS5 Tutorial 6 18 JUN DS2 Tutorial 2 3 MAY DS5 SPARQL Entailment 18 JUN DS3 OWL – Syntax & Intuition ctd. 7 MAY DS2 Ontology Editing 2 JUL DS2 OWL & Description Logics 7 MAY DS3 Ontology Engineering 2 JUL DS3 OWL 2 10 MAY DS5 Tutorial 7 9 JUL DS2 Tutorial 3 14 MAY DS2 Linked Data 9 JUL DS3 Tableau I 14 MAY DS3 Applications 12 JUL DS5 Tableau II 17 MAY DS5 Test Exam 16 JUL DS2 Tutorial 4 7 JUN DS2 Test Exam Evaluation 16 JUL DS3 Hypertableau I 7 JUN DS3 Q&A Session 19 JUL DS5

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 2 von 24

slide-3
SLIDE 3

Ontology Engineering

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 3 von 24

slide-4
SLIDE 4

Ontology Engineering

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 4 von 24

slide-5
SLIDE 5

Agenda

  • How can we work with an ontology in a programming environment?
  • How can we work with an ontology via a graphical interface?

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 5 von 24

slide-6
SLIDE 6

Agenda

  • How can we work with an ontology in a programming environment?
  • How can we work with an ontology via a graphical interface?

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 6 von 24

slide-7
SLIDE 7

Implementing OWL

What does “implementing OWL ” mean?

  • modeling – provision of data structures representing an ontology
  • parsing – conversion of the textual representation of an ontology (e.g. in

RDF/XML) into corresponding data structures

  • serialization – conversion of the internal data structure into the textual

representation

  • manipulation – provision of methods for manipulating the data structures
  • r creating new ontological elements
  • inferencing – taking into account the OWL formal semantics

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 7 von 24

slide-8
SLIDE 8

Aspects of an Implementation

  • identify functionalities and responsibilities
  • representation

– syntax vs. data model – interface vs. implementation – locality of information

  • parsing/serialization

– abstraction from the concrete representation (e.g. as triples)

  • manipulation

– granularity – dependencies – intention of the user – strategies

  • inferencing

– distinguishing explicit and implicit consequences – external imnplementations

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 8 von 24

slide-9
SLIDE 9

What is an Ontology (from the Implementer’s Perspective)

  • a certain syntactic representation?
  • facts that are represented via the syntactic representation?
  • information that is entailed by the represented facts?

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 9 von 24

slide-10
SLIDE 10

What is an Ontology (from the Implementer’s Perspective)

  • a certain syntactic representation?
  • facts that are represented via the syntactic representation?
  • information that is entailed by the represented facts?
  • these questions are important when working with OWL
  • e.g.: which answers to expect when querying these data structures

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 10 von 24

slide-11
SLIDE 11

The OWL API

  • the OWL API is such an implementation of OWL
  • meant for OWL DL
  • an ontology is represented by a set of axioms, which model information

about classes, roles and individuals

  • when is a class or role “in” an ontology?

– not precisely defined in OWL spec – somewhat depending on the implementation

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 11 von 24

slide-12
SLIDE 12

Data Structures of the OWL API

  • provides data structures forrepresenting ontologies
  • auxiliary classes for

– creating, – manipulating, – parsing, – rendering, and – inferencing over these structures

  • the basic data structures represent objects of an ontology and are
  • rganized according to the functional syntax of OWL of OWL

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 12 von 24

slide-13
SLIDE 13

The Ontology Object

  • an OWLOntology object represents an ontology
  • contains a set of axioms
  • “knows” what classes and roles are used in the ontology
  • may have an IRI as Name/ID and may be loaded from IRIs

– the ontology’s ID does not have to coincide with the IRI the

  • ntology is loaded from

– same holds for imported ontologies

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 13 von 24

slide-14
SLIDE 14

Loading an Ontology

OWLOntologyManager manager =OWLManager.createOWLOntologyManager(); OWLOntologyIRIMapper aMapper =new AutoIRIMapper(new File("/ont/"), false); manager.addIRIMapper(aMapper); IRI rem=IRI.create("http://www.ex.org/ex.owl"); IRI loc=IRI.create("file:/ont/ex.owl"); OWLOntologyIRIMapper sMapper =new SimpleIRIMapper(rem, loc); manager.addIRIMapper(sMapper); OWLOntology ont =m.loadOntologyFromOntologyDocument( IRI.create("file:/ont/ont.owl"));

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 14 von 24

slide-15
SLIDE 15

Objects for Entities

  • the class OWLClass represents an (OWL) class
  • does not contain information about which axioms use it
  • axioms referring classes belong to an OWLOntology object
  • methods in OWLClass allow acessing information about the class in the

context of the ontology (convenience methods)

  • non-atomic classes use the interface OWLClassExpression
  • analogous for properties: OWLObjectProperty and

OWLDataProperty

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 15 von 24

slide-16
SLIDE 16

Adding Axioms

OWLDataFactory df=m.getOWLDataFactory(); OWLClass student=df.getOWLClass(IRI.create("...")); OWLClass course=df.getOWLClass(IRI.create("...")); OWLObjectProperty takes =df.getOWLObjectProperty(IRI.create("...")); OWLClassExpression sup =df.getOWLObjectSomeValuesFrom(takes, course); OWLAxiom ax=df.getOWLSubClassOfAxiom(student, sup); manager.addAxiom(ont, axiom);

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 16 von 24

slide-17
SLIDE 17

Using a Reasoner

  • the class OWLReasoner is an interface, that is implemented by most of

the reasoners

  • contains methods, to interact with the reasoner

import org.semanticweb.owlapi.reasoner.OWLReasoner; import org.semanticweb.HermiT.Configuration; import org.semanticweb.HermiT.Reasoner.ReasonerFactory; ... OWLReasonerFactory reasonerFactory =new Reasoner.ReasonerFactory(); // HermiT factory OWLReasoner reasoner =reasonerFactory.createReasoner(ont); System.out.println(reasoner.isConsistent()); System.out.println(reasoner.isSatisfiable(student)); hermit.precomputeInferences( InferenceType.CLASS_HIERARCHY);

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 17 von 24

slide-18
SLIDE 18

Visitor patterns in the OWL API

  • visitor: Encapsulate an operation that is to be performed on the elements
  • f an object structure as an object. The visitor pattern allows you to define

a new operation without changing the classes of the targeted data structure. [Design Patterns, Gamma et al.]

  • allows for diverse operations over the data structures without overloading

them with application-specific code

  • good as long as the data structures don’t change
  • changes in the OWL standards (very) rare

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 18 von 24

slide-19
SLIDE 19

Example ClassExpressionVisitor

  • visitors implement the interface OWLClassExpressionVisitor which

needs a methof visit() per OWL class object

  • all implementations of the interface OWLClassExpression must

implement a method accept(OWLClassExpressionVisitor visitor)

public interface OWLClassExpressionVisitor { void visit(OWLObjectUnionOf ce); ... } public interface OWLObjectUnionOf extends OWLClassExpression { public void accept(OWLClassExpressionVisitor v) { visitor.visit(this); } ... }

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 19 von 24

slide-20
SLIDE 20

Applications for Visitors

allow for working with arbitrary OWL objects, for instance

  • conversion of classes or axioms into NNF
  • simplification of axioms
  • serialization into diverse formats

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 20 von 24

slide-21
SLIDE 21

Agenda

  • How can we work with an ontology in a programming environment?
  • How to work with an ontology via a graphical user interface?

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 21 von 24

slide-22
SLIDE 22

Ontology Editing with Protege

  • load mad-cow-start.owl in Protege
  • familiarize yourself with the ontology

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 22 von 24

slide-23
SLIDE 23

Ontology Editing mit Protege

given the following text, extend the ontology by the concepts pet+owner, dog+owner and vegetarian: Pet owners are persons who own a pet. Dog owners are special pet owners in that they own a dog. Vegetarians are animals that do not eat other animals and neither do they eat parts of other animals.

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 23 von 24

slide-24
SLIDE 24

Ontology Editing with Protege

  • classify the ontology
  • you should obtain an unsatisfiable class mad+cow

TU Dresden, July 2 Foundations of Semantic Web Technologies Folie 24 von 24