<<

Thomas Schmidt schmidt@informatik. haw-hamburg.de

Semantic Web Technologies: Examples

• Representing Knowledge: Modelling Thesauri and such • for Services (OWL-S) • The Semantic of Thomas Schmidt schmidt@informatik. Representing Knowledge haw-hamburg.de

• In the Semantic Web we want to discover and apply knowledge … • More specifically: we want to built ontologies from existing knowledge and use these for inference … • Practical approach: - Take available taxonomies, thesauri, etc. and formulate them in OWL - Use reasoner to apply OWL model • Inject knowledge into applications Thomas Schmidt schmidt@informatik. haw-hamburg.de

Example:

ACM Computing Classification System Thomas Schmidt schmidt@informatik. Simple RDFS Approach: haw-hamburg.de

ACM (XML):

Hardware rdfs:subClassOF Control OWL: Structures

rdfs:subClassOF … Control Design Styles Thomas Schmidt schmidt@informatik. ACM Relations haw-hamburg.de

Hardware rdfs:subClassOF Control Structures rdfs:subClassOF

Control Languages ACM:isRelatedTo Design Styles Thomas Schmidt schmidt@informatik. Additional Property: “Relation” haw-hamburg.de

• Not expressible in a class hierarchy • Can be characterised in OWL & applied • transitive, symmetric … • But: class-valued (≠ rdf:type …) ⇒ OWL Full needed

⇒ Expression of simple thesauri problematic in OWL Thomas Schmidt schmidt@informatik. A Simpler Example haw-hamburg.de

Books on Lions:

:TheAfricanLionBook Typical problem: a :Book ; :bookTitle "The African Lion" ; dc:subject :AfricanLion :BookAboutAnimals a owl:Class ; rdfs:subClassOf :AfricanLion [ a owl:Restriction ; a owl:Class; owl:someValuesFrom :AnimalClass ; rdfs:subClassOf :Lion owl:onProperty dc:subject ] Thomas Schmidt schmidt@informatik. OWL DL Approaches (I) haw-hamburg.de

Individuals in parallel Now:

:LionsLifeInThePrideBook :BookAboutAnimals a :Book ; a owl:Class ; :bookTitle "Lions: Life in the Pride" ; rdfs:subClassOf dc:subject :LionSubject [ a owl:Restriction ; owl:someValuesFrom :Animal ; owl:onProperty dc:subject ] Thomas Schmidt schmidt@informatik. OWL DL Approaches (II) haw-hamburg.de

Unspecified class members

:LionsLifeInThePrideBook a :BookAboutAnimals ; [ a owl:Restriction ; owl:onProperty dc:subject ; Now: owl:someValuesFrom :Lion ]; BookAboutAnimals predefined :bookTitle "Lions: Life in the Pride" ; http://www.w3.org/TR/swbp-classes-as-values/ Thomas Schmidt Use case: schmidt@informatik. haw-hamburg.de ACM Computing Classification System

A. • ACMCCS 1998 (latest version) General Literature http://www.acm.org/class

A.0 • Widely used in classification of General conference papers and articles in A.0.0 computer sciences. Biographies/ autobiographies • Structure: A.0.1 Conference Proceedings – 11 first level nodes

A.0.2 – Each list of children for a first or General literary works second level node contains at

A.1 least one General (0) node and Introductory and Survey one Miscellaneous (m) node. A.2 – Contains ‘see also’ references Reference between certain nodes A.m Miscellaneous • Represent in processable Ontology (not OWL Full) Thomas Schmidt schmidt@informatik. Use case: Scenario haw-hamburg.de

Idea • Classify content according to ACMCCS98 • Enhance search mechanisms by using ACMCCS98 scheme to discover related information

ToDo • Add classifier to content • Build ontology representation of ACMCCS98 • Implement application logic ☺ Thomas Schmidt schmidt@informatik. SKOS haw-hamburg.de

• SKOS = Simple Knowledge Organisation Systems (http://www.w3.org/2004/02/skos/) • Outcome of the European SWAD project • Meta Model for representing thesauri a.s. • Built as RDF Schema with OWL property characteristics • Semantic of ‘Concepts’ less restrictive than OWL classes • Provides association of (several) words or phrases to concepts Thomas Schmidt schmidt@informatik. SKOS haw-hamburg.de

• OWL complaint framework for building concept schemes • Basic constructs: – skos:ConceptScheme – skos:Concept – skos:narrower – skos:broader – skos:related • Knowledge Entities are Concepts, grouped in a Concept Scheme

http://www.w3.org/2001/sw/Europe/reports/thes/1.0/guide/ Thomas Schmidt schmidt@informatik. Expressing ACMCCS98 in SKOS haw-hamburg.de

C.2.6 Internetworking Thomas Schmidt schmidt@informatik. ☺ A part of the RDF data model haw-hamburg.de Thomas Schmidt Code Fragments: schmidt@informatik. haw-hamburg.de Obtaining an Inference Model

1. Load SKOS schema (from the web): Model schema = ModelLoader.loadModel( "http://www.w3.org/2004/02/skos/core.rdf"); 2. Load data (ACM instances of SKOS from local file): Model data = ModelLoader.loadModel("acmskos.rdf“); 3. Obtain reasoner (SKOS is build upon OWL, so we need an OWL- capable reasoner): Reasoner reasoner = ReasonerRegistry.getOWLReasoner(); 4. Binding schema: reasoner = reasoner.bindSchema(schema); 5. Creating Inference Model: InfModel infModel = ModelFactory.createInfModel(reasoner, data); Thomas Schmidt schmidt@informatik. Getting the non-obvious haw-hamburg.de

//get subject we want information on Resource subject = infModel.getResource( “http://www.acm.org/class/1998/B.8”);

//get type of information (only ‘related’ concepts) Property predicate = infModel.getProperty( "http://www.w3.org/2004/02/skos/core#related");

//get iterator to all statements matching the given conditions StmtIterator it = infModel.listStatements(subject, predicate, null);

//get perfLabel of the first statement returned String label = it.nextStatement().getProperty( “http://www.w3.org/2004/02/skos/core#prefLabel”).getString() Thomas Schmidt Use Case: schmidt@informatik. haw-hamburg.de eLearning Objects content augmentation Idea • LOM relations expressing connection between eLOs • Relations are qualified • Use LOM relations to suggest further content to the learner

ToDo • Map LOM relations into an ontology • Implement application logic Thomas Schmidt Simple scheme schmidt@informatik. haw-hamburg.de representing LOM Relations • Relations referencing other eLearning Objects owl:ObjectProperties • All relation qualifiers have an inverse equivalent (eg. isBasisFor isBasedOn) owl:inverseOf • Qualifiers could be declared as being transitive owl:TransitivProperty

Thomas Schmidt schmidt@informatik. Sample Instances haw-hamburg.de

Dexter Storage

Amsterdam <a href="/tags/Hypermedia/" rel="tag">Hypermedia</a> Model Thomas Schmidt schmidt@informatik. Comfortable Vocabularies haw-hamburg.de

• Use the Jena tool schemagen to build vocabulary (java) classes from OWL files (http://jena.sourceforge.net/how-to/schemagen.html)

LOM.Relations.kind is basis for

/**

The ontology model that holds the vocabulary terms

*/ private static OntModel m_model = ModelFactory.createOntologyModel(ProfileRegistry.OWL_LANG );

/**

LOM.Relations.kind is basis for

*/ public static final ObjectProperty isBasisFor = m_model.createObjectProperty( "http://hylos.fhtw-berlin.de/HylosLOM#isBasisFor" ); Thomas Schmidt schmidt@informatik. Getting something out of the Inference Modelhaw-hamburg.de

1. Create Inference Model: Model schema = ModelFactory.loadModel(“hylosLOM.owl”); Model data = ModelFactory.loadModel(“lomData.rdf”); Reasoner reasoner = ReasonerRegistry.createOWLReasoner(); reasoner = reasoner.bindSchema(schema); InfModel infModel = ModelFactory.createInfModel(reasoner, data); 2. Querying the model: Resource s = infModel.getResource(“…AmsteHyperModel.xml”); for( StmtIterator it = infModel.listStatements(s, HylosLOMVocab.isBasedOn, null); it.hasNext(); ) { System.out.println(PrintUtil.print(it.nextStatement()); } Thomas Schmidt schmidt@informatik. Rules – Basis for inference haw-hamburg.de

• OWL reasoner is based upon specific rules which model the OWL assertions and constraints

• Applied ruleset could be obtained from FBRuleReasoner via getRules() : List

• Rules are created using Rules.parseRule(String) : Rule or Rules.parseRules(String) : List

For detailed information on the inference system refer to http://jena.sourceforge.net/inference/index.html Thomas Schmidt schmidt@informatik. Rule Definition haw-hamburg.de Rule := bare-rule . or [ bare-rule ] or [ ruleName : bare-rule ] bare-rule := term, ... term -> hterm, ... hterm // forward rule or term, ... term <- term, ... term // backward rule hterm := term or [ bare-rule ] term := (node, node, node) // triple pattern or (node, node, functor) // extended triple pattern or builtin(node, ... node) // invoke procedural primitive functor := functorName(node, ... node) // structured literal node := uri-ref // e.g. http://foo.com/eg or prefix:localname // e.g. rdf:type or ?varname // variable or 'a literal' // either a string or a number or number // e.g. 42 or 25.5 Thomas Schmidt schmidt@informatik. Creating own rules haw-hamburg.de

• If A is based on B and B has part C then A is also based on C [myrule1: (?A http://hylos.fhtw-berlin.de/HylosLOM#isBasedOn ?B) (?B http://hylos.fhtw-berlin.de/HylosLOM#hasPart ?C) -> (?A http://hylos.fhtw-berlin.de/HylosLOM#isBasedOn ?C)]

• If A is based on B and B is part of C then A is also based on C [myrule2: (?A http://hylos.fhtw-berlin.de/HylosLOM#isBasedOn ?B) (?C http://hylos.fhtw-berlin.de/HylosLOM#isPartOf ?B) -> (?A http://hylos.fhtw-berlin.de/HylosLOM#isBasedOn ?C)] Thomas Schmidt schmidt@informatik. Extending the standard ruleset haw-hamburg.de

String RULE_FILE = “own.rules”;

//load rules from file own.rules List rules = Rule.parseRules(Util.loadResourceFile(RULE_FILE));

//add rules to the existing ruleset ((OWLFBRuleReasoner) reasoner).getRules().addAll(rules);

/* * bind schema to reasoner */ • Attention: ruleset has to be loaded before the schema is bound to the reasoner. Thomas Schmidt schmidt@informatik. OWL-S haw-hamburg.de

• Web Ontology Language for Services • Idea: Provide a computer-interpretable description of a Web Service and any means to access it • Ontology Standard consisting of basic classes and properties for declaring and describing services • Originally DAML-S from DAML Initiative • Release 1.0 by DAML (Nov 2003) • Now: Release 1.1 – Submission to W3C Thomas Schmidt schmidt@informatik. Motivation + Use Cases haw-hamburg.de

Goals: Enable agents to discover, invoke, verify, interoperate, compose and monitor Web Services: 1. Automatic Web Service Discovery: Enable declarative advertisements of properties and capabilities “Find a service, that sells skiing lift tickets for my place and accepts credit cards” 2. Automatic Web Service Invocation: Provide standard means for specifying declarative APIs and parameter semantics “Buy me that lift ticket using my credit card” 3. Automatic Webs Service Composition and Interoperation: Provide declarative specifications of prerequisites & consequences of apps. and a language to describe composition and data flow interaction “Determine the place with best snow height and then buy me the lift card” Thomas Schmidt schmidt@informatik. Ontology Structuring for Services haw-hamburg.de

Three essential types of knowledge about a service: • What does the service provide? Profile class used to advertise services • How is it used? ServiceModel class used to describe the process model • How to interact with it? ServiceGrounding class specifies details of accessing the service Thomas Schmidt schmidt@informatik. Service Profile haw-hamburg.de

• A description of services as offered by providers or needed by requestors • The profile provides a detailed description of a service to a registry, but is useless after service selection (→ ServiceModel) • Three types of information: - Provider information: Service Name, Contact, Description - Functional description: Input, Output, Precondition, Effects - Additional properties: Attributes, Parameters, Categories … Thomas Schmidt schmidt@informatik. Service Profiles haw-hamburg.de Thomas Schmidt schmidt@informatik. Service Model haw-hamburg.de

• Models Services as Processes • Two types of processes: Atomic or Composite • Describes: - Parameters (Input, Output) & Expressions (Precondition, Effects) -Process Type - Process composition - Data flow and parameter binding Thomas Schmidt schmidt@informatik. haw-hamburg.de Thomas Schmidt schmidt@informatik. Service Grounding haw-hamburg.de

• Concrete service access description • Extends WSDL on atomic processes • Extensions: - WSDL message may use owl-s parameter objects - EncodingStyle may be OWL - Process composition - OWL-S process attribute may be used as WSDL operation element Thomas Schmidt schmidt@informatik. The Semantic of a haw-hamburg.de

• Links encode relations between resources • Problem: What is their semantic interpretation? • Get information from - Departure & arrival of a link - Contextual information of the link itself • Treat links as separate semantic statements to

- Process Links in applications - Retrieve information about resources Thomas Schmidt schmidt@informatik. Linking & Anchoring haw-hamburg.de Ingredients of a link hier

target anchor

target object source anchor source object & link type process instruction Thomas Schmidt schmidt@informatik. Interactivity + Relation haw-hamburg.de

• Hyper references are constructed from: – Anchors marking data chunks in documents – Links connecting anchors

• Anchors and Links need not to be stored inside the documents

• XLink (2001) – W3C Standard for creating and describing links – Bidirectional and multidirectional links – Semantic attributes (title, arcrole, … ) Thomas Schmidt schmidt@informatik. Deriving statements from Meta Data haw-hamburg.de

Subject Predicat

This page is titled hamster diseases

Object

Anchors provide additional specification Thomas Schmidt schmidt@informatik. Building Link Semantic haw-hamburg.de

• Anchored content carries (RDF-) semantics “This part is about hamsters having hay fever”

• Simple link statement “ ‘This part titled Hay Fever handbook’ represents background information on ‘this part about hamsters having hay fever’ ”

• Higher order statement “Link1 says that ‘the part titled Hay Fever Handbook’ represents background information on ‘the part about hamsters having hay fever.‘ ” Thomas Schmidt schmidt@informatik. Deriving statements from Meta Data haw-hamburg.de Thomas Schmidt schmidt@informatik. References haw-hamburg.de

• Semantic Web @ W3C - http://www.w3.org/2001/sw/ • OWL Semantics & Abstract Syntax - http://www.w3.org/TR/owl-semantics/ • Representing Classes As Property Values on the Semantic Web - http://www.w3.org/TR/swbp-classes-as-values • SKOS-Core 1.0 Guide - http://www.w3.org/2001/sw/Europe/reports/thes/1.0/guide • Jena Javadoc - http://jena.sourceforge.net/javadoc/ • D. Martin et. al.: OWL-S: Semantic Markup for Web Services, W3C Submission http://www.w3.org/Submission/2004/SUBM-OWL-S-20041122/ •DAML Services -http://www.daml.org/services/owl-s/ • P. Alesso, C. Smith: Developing Semantic Web Services, Peters, 2005