Semantic Web Technologies: Examples - HAW Hamburg

Transcription

Thomas Schmidtschmidt@informatik.haw-hamburg.deSemantic Web Technologies:Examples Representing Knowledge:Modelling Thesauri and such Web Ontology Language for Services (OWL-S) The Semantic of Hyperlinks

Representing KnowledgeThomas Schmidtschmidt@informatik.haw-hamburg.de 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. andformulate them in OWL- Use reasoner to apply OWL model Inject knowledge into applications

Thomas M ComputingClassification System

Simple RDFS Approach:Thomas Schmidtschmidt@informatik.haw-hamburg.deACM (XML): node id "B." label "Hardware" Hardware isComposedBy node id "B.0" label "GENERAL" / node id "B.1" label "CONTROL STRUCTURES " rdfs:subClassOF isComposedBy node id "B.1.1" label "Control Design Styles" OWL:ControlStructures owl:Class rdf:ID “CONTROL STRUCTURES" rdfs:subClassOF rdfs:subClassOf rdf:resource “#Hardware”/ /owl:Class ControlDesign Styles

Thomas Schmidtschmidt@informatik.haw-hamburg.deACM RelationsHardware node id "B." label "Hardware" isComposedBy rdfs:subClassOF node id "B.0" label "GENERAL" / node id "B.1" label "CONTROL STRUCTURES " isRelatedTo node id "D.3.2" label “Languages" / Control /isRelatedTo Structures isComposedBy node id "B.1.1" label "Control Design Styles" gn Styles

Additional Property: “Relation”Thomas Schmidtschmidt@informatik.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 Schmidtschmidt@informatik.haw-hamburg.deA Simpler ExampleBooks onLions::TheAfricanLionBooka:Book ;:bookTitle "The African Lion" :subClassOf:LionTypical problem::BookAboutAnimalsaowl:Class ;rdfs:subClassOf[aowl:Restriction ;owl:someValuesFrom :AnimalClass ;owl:onProperty dc:subject]

Thomas Schmidtschmidt@informatik.haw-hamburg.deOWL DL Approaches (I)Individuals inparallel:LionsLifeInThePrideBooka:Book ;:bookTitle"Lions: Life in the Pride" lass ;rdfs:subClassOf[aowl:Restriction ;owl:someValuesFrom :Animal ;owl:onProperty dc:subject]

Thomas Schmidtschmidt@informatik.haw-hamburg.deOWL DL Approaches (II)Unspecifiedclass members:LionsLifeInThePrideBooka:BookAboutAnimals ;[ a owl:Restriction ;owl:onProperty dc:subject ;owl:someValuesFrom :Lion];:bookTitleNow:"Lions: Life in the Pride" ;BookAboutAnimals ues/

Use case:ACM Computing Classification SystemA.General esA.0.1Conference ProceedingsA.0.2General literary worksA.1Introductory and SurveyA.2ReferenceA.mMiscellaneousThomas Schmidtschmidt@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 andone Miscellaneous (m) node.– Contains ‘see also’ referencesbetween certain nodes Represent in processableOntology (not OWL Full)

Use case: ScenarioThomas Schmidtschmidt@informatik.haw-hamburg.deIdea Classify content according to ACMCCS98 Enhance search mechanisms by using ACMCCS98 scheme todiscover related informationToDo Add classifier to content Build ontology representation of ACMCCS98 Implement application logic

SKOSThomas Schmidtschmidt@informatik.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 Schmidtschmidt@informatik.haw-hamburg.deSKOS OWL complaint framework forbuilding concept schemes Basic constructs:– skos:ConceptScheme– skos:Concept– skos:narrower– skos:broader– skos:related Knowledge Entities are Concepts,grouped in a Concept s/1.0/guide/

Expressing ACMCCS98 in SKOS skos:Concept rdf:about “C.2.6" skos:externalID C.2.6 /skos:externalID skos:prefLabel xml:lang "en" Internetworking /skos:prefLabel skos:inScheme rdf:resource “." / skos:narrower rdf:resource "C.2.6.1" / skos:narrower rdf:resource "C.2.6.2" / skos:related rdf:resource "C.2.2" / /skos:Concept Thomas Schmidtschmidt@informatik.haw-hamburg.de

A part of the RDF data modelThomas Schmidtschmidt@informatik.haw-hamburg.de

Code Fragments:Obtaining an Inference ModelThomas Schmidtschmidt@informatik.haw-hamburg.de1. Load SKOS schema (from the web):Model schema kos/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 OWLcapable reasoner):Reasoner reasoner ReasonerRegistry.getOWLReasoner();4. Binding schema:reasoner reasoner.bindSchema(schema);5. Creating Inference Model:InfModel infModel ModelFactory.createInfModel(reasoner,data);

Getting the non-obviousThomas Schmidtschmidt@informatik.haw-hamburg.de//get subject we want information onResource subject 998/B.8”);//get type of information (only ‘related’ concepts)Property predicate os/core#related");//get iterator to all statements matching the given conditionsStmtIterator it infModel.listStatements(subject, predicate,null);//get perfLabel of the first statement returnedString label g/2004/02/skos/core#prefLabel”).getString()

Thomas Schmidtschmidt@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 learnerToDo Map LOM relations into an ontology Implement application logic

Simple schemerepresenting LOM RelationsThomas Schmidtschmidt@informatik.haw-hamburg.de Relations referencing other eLearning Objectsowl:ObjectProperties All relation qualifiers have an inverse equivalent (eg.isBasisForisBasedOn)owl:inverseOf Qualifiers could be declared as being transitiveowl:TransitivProperty owl:ObjectProperty rdf:ID "isBasedOn" rdf:type rdf:resource "&owl;TransitiveProperty"/ rdfs:range rdf:resource "#LearningObject"/ rdfs:domain rdf:resource "#LearningObject"/ /owl:ObjectProperty owl:ObjectProperty rdf:ID "isBasisFor" owl:inverseOf rdf:resource "#isBasedOn" / /owl:ObjectProperty

Sample InstancesThomas Schmidtschmidt@informatik.haw-hamburg.de LearningObject rdf:about "&hylos;DexteReferModel/DexteReferModel.xml" title Dexter /title isBasedOn rdf:resource "&hylos;MemexVBush1945/MemexVBush1945.xml"/ hasPart rdf:resource "&hylos;DexteDefic/DexteDefic.xml" / /LearningObject LearningObject rdf:about "&hylos;DexteStora/DexteStora.xml" title Dexter Storage /title isPartOf rdf:resource "&hylos;DexteReferModel/DexteReferModel.xml" / /LearningObject LearningObject rdf:about "&hylos;AmsteHyperModel/AmsteHyperModel.xml" title Amsterdam Hypermedia Model /title isBasedOn rdf:resource "&hylos;DexteReferModel/DexteReferModel.xml"/ /LearningObject

Comfortable VocabulariesThomas Schmidtschmidt@informatik.haw-hamburg.de Use the Jena tool schemagen to build vocabulary (java) classes from OWL .html) owl:ObjectProperty rdf:ID "isBasisFor" owl:inverseOf rdf:resource "#isBasedOn" / rdfs:comment rdf:datatype "&xsd;string" LOM.Relations.kind is basis for /rdfs:comment /owl:ObjectProperty /** p The ontology model that holds the vocabulary terms /p */private static OntModel m model WL LANG );/** p LOM.Relations.kind is basis for /p */public static final ObjectProperty isBasisFor m in.de/HylosLOM#isBasisFor" );

Thomas Schmidtschmidt@informatik.haw-hamburg.deGetting something out of the Inference Model1. 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(); ent());}

Rules – Basis for inferenceThomas Schmidtschmidt@informatik.haw-hamburg.de OWL reasoner is based upon specific rules which model theOWL assertions and constraints Applied ruleset could be obtained from FBRuleReasoner viagetRules() : List Rules are created using Rules.parseRule(String)or Rules.parseRules(String) : ListFor detailed information on the inference system refer : Rule

Rule DefinitionThomas Schmidtschmidt@informatik.haw-hamburg.deRule : bare-rule .or [ bare-rule ]or [ ruleName : bare-rule ]bare-rule : term, . term - hterm, . hterm // forward ruleor term, . term - term, . term // backward rulehterm : termor [ bare-rule ]term : (node, node, node) // triple patternor (node, node, functor) // extended triple patternor builtin(node, . node) // invoke procedural primitivefunctor : functorName(node, . node) // structured literalnode : uri-ref // e.g. http://foo.com/egor prefix:localname // e.g. rdf:typeor ?varname // variableor 'a literal' // either a string or a number or number // e.g. 42 or 25.5

Creating own rules Thomas Schmidtschmidt@informatik.haw-hamburg.deIf 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)]

Extending the standard rulesetThomas Schmidtschmidt@informatik.haw-hamburg.deString 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 boundto the reasoner.

OWL-SThomas Schmidtschmidt@informatik.haw-hamburg.de 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 fordeclaring and describing services Originally DAML-S from DAML Initiative Release 1.0 by DAML (Nov 2003) Now: Release 1.1 – Submission to W3C

Motivation Use CasesThomas Schmidtschmidt@informatik.haw-hamburg.deGoals: Enable agents to discover, invoke, verify, interoperate, composeand monitor Web Services:1. Automatic Web Service Discovery: Enable declarative advertisementsof 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 forspecifying declarative APIs and parameter semantics“Buy me that lift ticket using my credit card”3. Automatic Webs Service Composition and Interoperation: Providedeclarative 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”

Ontology Structuring for ServicesThree 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 specifiesdetails of accessing the serviceThomas Schmidtschmidt@informatik.haw-hamburg.de

Service ProfileThomas Schmidtschmidt@informatik.haw-hamburg.de A description of services as offered by providers or needed byrequestors 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

Service ProfilesThomas Schmidtschmidt@informatik.haw-hamburg.de

Service ModelThomas Schmidtschmidt@informatik.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 Schmidtschmidt@informatik.haw-hamburg.de

Service 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 maybe used as WSDL operation elementThomas Schmidtschmidt@informatik.haw-hamburg.de

The 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 resourcesThomas Schmidtschmidt@informatik.haw-hamburg.de

Thomas Schmidtschmidt@informatik.haw-hamburg.deLinking & AnchoringIngredients of a link a href “./dort.html#a1" target " blank" hier /a target anchortarget objectsource object & link typesource anchorprocess instruction

Interactivity RelationThomas Schmidtschmidt@informatik.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, )

Deriving statements from Meta DataThomas dicatThis pageis titledhamster diseasesObjectAnchors provideadditional specification

Building Link Semantic Anchored content carries (RDF-) semantics“This part is about hamsters having hay fever” Simple link statement“ ‘This part titled Hay Fever handbook’ representsbackground information on ‘this part about hamstershaving hay fever’ ” Higher order statement“Link1 says that ‘the part titled Hay Fever Handbook’represents background information on ‘the partabout hamsters having hay fever.‘ ”Thomas Schmidtschmidt@informatik.haw-hamburg.de

Deriving statements from Meta DataThomas Schmidtschmidt@informatik.haw-hamburg.de

References Thomas Schmidtschmidt@informatik.haw-hamburg.deSemantic 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 guide Jena Javadoc - http://jena.sourceforge.net/javadoc/D. Martin et. al.: OWL-S: Semantic Markup for Web Services, W3C WL-S-20041122/ DAML Services - http://www.daml.org/services/owl-s/ P. Alesso, C. Smith: Developing Semantic Web Services, Peters, 2005

Thomas Schmidt schmidt@informatik. haw-hamburg.de Semantic Web Technologies: Examples Representing Knowledge: Modelling Thesauri and such Web Ontology Language for Services (OWL-S)