semanticweb examples

download semanticweb examples

of 41

Transcript of semanticweb examples

  • 7/30/2019 semanticweb examples

    1/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.de

    Semantic Web Technologies:Examples

    Representing Knowledge:

    Modelling Thesauri and such Web Ontology Language for Services (OWL-S)

    The Semantic of Hyperlinks

  • 7/30/2019 semanticweb examples

    2/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deRepresenting Knowledge

    In the Semantic Web we want to discover and apply knowledge

    More specifically: we want to built ontologies from existing knowledgeand 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

  • 7/30/2019 semanticweb examples

    3/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.de

    Example:

    ACM Computing

    Classification System

  • 7/30/2019 semanticweb examples

    4/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deSimple RDFS Approach:

    ACM (XML):

    Hardware

    ControlStructures

    ControlDesign Styles

    rdfs:subClassOF

    rdfs:subClassOF

    OWL:

  • 7/30/2019 semanticweb examples

    5/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deACM Relations

  • 7/30/2019 semanticweb examples

    6/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deAdditional Property: Relation

    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

  • 7/30/2019 semanticweb examples

    7/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deA Simpler Example

    Books on

    Lions:

    :TheAfricanLionBooka :Book ;:bookTitle "The African Lion" ;

    dc:subject :AfricanLion

    :AfricanLiona owl:Class;rdfs:subClassOf :Lion

    Typical problem:

    :BookAboutAnimalsa owl:Class ;rdfs:subClassOf[ a owl:Restriction ;owl:someValuesFrom :AnimalClass ;owl:onProperty dc:subject

    ]

  • 7/30/2019 semanticweb examples

    8/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deOWL DL Approaches (I)

    Individuals inparallel

    :LionsLifeInThePrideBooka :Book ;:bookTitle "Lions: Life in the Pride" ;dc:subject :LionSubject

    Now:

    :BookAboutAnimalsa owl:Class ;rdfs:subClassOf[ a owl:Restriction ;

    owl:someValuesFrom :Animal ;owl:onProperty dc:subject

    ]

  • 7/30/2019 semanticweb examples

    9/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deOWL DL Approaches (II)

    Unspecified

    class members

    :LionsLifeInThePrideBook

    a :BookAboutAnimals ;[ a owl:Restriction ;owl:onProperty dc:subject ;owl:someValuesFrom :Lion

    ];

    :bookTitle "Lions: Life in the Pride" ;

    Now:

    BookAboutAnimals predefined

    http://www.w3.org/TR/swbp-classes-as-values/

  • 7/30/2019 semanticweb examples

    10/41

    Use case:

    ACM Computing Classification System

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.de

    ACMCCS 1998 (latest version)http://www.acm.org/class

    Widely used in classification ofconference papers and articles incomputer sciences.

    Structure:

    11 first level nodes

    Each list of children for a first orsecond level node contains atleast one General (0) node and

    one Miscellaneous (m) node.

    Contains see also referencesbetween certain nodes

    Represent in processableOntology (not OWL Full)

    A.

    General Literature

    A.0

    General

    A.2

    Reference

    A.1

    Introductory and Survey

    A.m

    Miscellaneous

    A.0.0

    Biographies/

    autobiographies

    A.0.1Conference Proceedings

    A.0.2

    General literary works

  • 7/30/2019 semanticweb examples

    11/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deUse case: Scenario

    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

  • 7/30/2019 semanticweb examples

    12/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deSKOS

    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

    http://www.w3.org/2004/02/skos/http://www.w3.org/2004/02/skos/
  • 7/30/2019 semanticweb examples

    13/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deSKOS

    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/

  • 7/30/2019 semanticweb examples

    14/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deExpressing ACMCCS98 in SKOS

  • 7/30/2019 semanticweb examples

    15/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deA part of the RDF data model

  • 7/30/2019 semanticweb examples

    16/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deCode Fragments:

    Obtaining an Inference Model1. 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);

  • 7/30/2019 semanticweb examples

    17/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deGetting the non-obvious

    //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()

  • 7/30/2019 semanticweb examples

    18/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deUse Case:

    eLearning Objects content augmentationIdea

    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

  • 7/30/2019 semanticweb examples

    19/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deSimple scheme

    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

    S

  • 7/30/2019 semanticweb examples

    20/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deSample Instances

    Dexter

    Dexter Storage

    Amsterdam Hypermedia Model

    Th S h idt

  • 7/30/2019 semanticweb examples

    21/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deComfortable Vocabularies

    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" );

    Th S h idt

  • 7/30/2019 semanticweb examples

    22/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deGetting something out of the Inference Model

    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

  • 7/30/2019 semanticweb examples

    23/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deRules Basis for inference

    OWL reasoner is based upon specific rules which model the

    OWL assertions and constraints

    Applied ruleset could be obtained from FBRuleReasoner viagetRules() : List

    Rules are created using Rules.parseRule(String) : Rule

    orRules.parseRules(String) : List

    For detailed information on the inference system refer to

    http://jena.sourceforge.net/inference/index.html

    Thomas Schmidt

  • 7/30/2019 semanticweb examples

    24/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deRule DefinitionRule:= bare-rule.

    or [ bare-rule]or [ ruleName : bare-rule]

    bare-rule:= term, ... term-> hterm, ... hterm// forward ruleorterm, ... term

  • 7/30/2019 semanticweb examples

    25/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deCreating own rules

    If A is based on B and B has part C then A is also based on C[myrule1: (?Ahttp://hylos.fhtw-berlin.de/HylosLOM#isBasedOn

    ?B) (?B http://hylos.fhtw-berlin.de/HylosLOM#hasPart ?C) ->(?Ahttp://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: (?Ahttp://hylos.fhtw-berlin.de/HylosLOM#isBasedOn?B) (?C http://hylos.fhtw-berlin.de/HylosLOM#isPartOf ?B) ->

    (?Ahttp://hylos.fhtw-berlin.de/HylosLOM#isBasedOn ?C)]

    Thomas Schmidt

  • 7/30/2019 semanticweb examples

    26/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deExtending the standard ruleset

    String RULE_FILE = own.rules;

    //load rules from file own.rulesList 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

  • 7/30/2019 semanticweb examples

    27/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deOWL-S

    Web Ontology Language for Services

    Idea: Provide a computer-interpretable description of a Web Serviceand 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

  • 7/30/2019 semanticweb examples

    28/41

    Thomas Schmidt

    schmidt@informatik.

    haw-hamburg.deMotivation + Use Cases

    Goals: Enable agents to discover, invoke, verify, interoperate, compose

    and monitorWeb 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 interactionDetermine the place with best snow height and then buy me the lift card

    Thomas Schmidt

  • 7/30/2019 semanticweb examples

    29/41

    schmidt@informatik.

    haw-hamburg.deOntology Structuring for Services

    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 usedto describe the process model

    How to interact with it?ServiceGrounding class specifies

    details of accessing the service

    Thomas Schmidt

  • 7/30/2019 semanticweb examples

    30/41

    schmidt@informatik.

    haw-hamburg.deService Profile

    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

  • 7/30/2019 semanticweb examples

    31/41

    schmidt@informatik.

    haw-hamburg.deService Profiles

    Thomas Schmidt

  • 7/30/2019 semanticweb examples

    32/41

    schmidt@informatik.

    haw-hamburg.deService Model

    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

  • 7/30/2019 semanticweb examples

    33/41

    schmidt@informatik.

    haw-hamburg.de

    Thomas Schmidt

  • 7/30/2019 semanticweb examples

    34/41

    schmidt@informatik.

    haw-hamburg.deService Grounding

    Concrete service access description

    Extends WSDL on atomic processes

    Extensions:

    - WSDL message may use owl-sparameter objects

    - EncodingStyle may be OWL

    - Process composition

    - OWL-S process attribute may

    be used as WSDL operation element

    Thomas Schmidt

    h idt@i f tik

  • 7/30/2019 semanticweb examples

    35/41

    schmidt@informatik.

    haw-hamburg.deThe Semantic of a Hyperlink

    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

    h idt@i f tik

  • 7/30/2019 semanticweb examples

    36/41

    schmidt@informatik.

    haw-hamburg.deLinking & Anchoring

    Ingredients of a link

  • 7/30/2019 semanticweb examples

    37/41

    schmidt@informatik.

    haw-hamburg.deInteractivity + Relation

    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

  • 7/30/2019 semanticweb examples

    38/41

    schmidt@informatik.

    haw-hamburg.deDeriving statements from Meta Data

    This page is titled

    hamster diseases

    Subject Predicat

    Object

    Anchors provideadditional specification

    Thomas Schmidt

    schmidt@informatik

  • 7/30/2019 semanticweb examples

    39/41

    schmidt@informatik.

    haw-hamburg.deBuilding Link Semantic

    Anchored content carries (RDF-) semantics

    This part is about hamsters having hay fever

    Simple link statement

    This part titled Hay Fever handbookrepresents

    background information onthis part about hamstershaving hay fever

    Higher order statementLink1 says thatthe part titled Hay Fever Handbookrepresents background information onthe partabout hamsters having hay fever.

    Thomas Schmidt

    schmidt@informatik

  • 7/30/2019 semanticweb examples

    40/41

    schmidt@informatik.

    haw-hamburg.deDeriving statements from Meta Data

    Thomas Schmidt

    schmidt@informatik

    f

  • 7/30/2019 semanticweb examples

    41/41

    schmidt@informatik.

    haw-hamburg.deReferences

    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

    http://www.w3.org/2001/sw/http://www.w3.org/TR/owl-semantics/http://www.w3.org/TR/swbp-classes-as-valueshttp://www.w3.org/2001/sw/Europe/reports/thes/1.0/guidehttp://www.w3.org/2001/sw/Europe/reports/thes/1.0/guidehttp://jena.sourceforge.net/javadoc/http://www.w3.org/Submission/2004/SUBM-OWL-S-20041122/http://www.daml.org/services/owl-s/http://www.daml.org/services/owl-s/http://www.daml.org/services/owl-s/http://www.w3.org/Submission/2004/SUBM-OWL-S-20041122/http://jena.sourceforge.net/javadoc/http://www.w3.org/2001/sw/Europe/reports/thes/1.0/guidehttp://www.w3.org/TR/swbp-classes-as-valueshttp://www.w3.org/TR/owl-semantics/http://www.w3.org/2001/sw/