Master Web Intelligence - École nationale supérieure des...
Transcript of Master Web Intelligence - École nationale supérieure des...
Lundi 21 janvier 2008 1
Master Web Intelligence 2007/2008
Web SémantiquePhilippe Beaune
ENSMSEmailto : [email protected]
Lundi 21 janvier 2008 2
Bref retour sur le TP ontologies
Modéliser une ontologie n'est pas confortable : l'énoncé du TP le reflétait, sans exagération (des choix à faire)Vous auriez pu vous poser la question : puisje utiliser Dublin Core ? Une ontologie sur le temps ? ...Dans un premier temps vous auriez dû vous éloigner du clavier avec un papier et un crayon ...
Lundi 21 janvier 2008 3
TP :astuceMaMetaClasse
template slots : créateur = PhB
MaSuperClassetemplate slots : créateur = PhB
UneClasseslots : créateur = PhBtemplate slots : créateur = PhB
UneSousClasseslots : créateur = PhBtemplate slots : créateur = PhB
Instance1slots : créateur = PhB
Instance2slots : créateur = PhB
Instance
Instance Instance
SubClass
SubClass Instance
en Protégé
Lundi 21 janvier 2008 4
Plan général(6 séances)
mardi 27 novembre am : repr. des connaissancesmardi 18 décembre am : DL & ontologiesmardi 8 janvier am : TP ontologies/Protégé
lundi 21 janvier pm : le Web Sémantique
mercredi 23 janvier am : TP Protégé : OWL & DLmardi 29 janvier am : applis industrielles + exam
Lundi 21 janvier 2008 5
Rappel
http://www.w3.org/2007/03/layerCake.png
Lundi 21 janvier 2008 6
Plan du cours
Généralités sur le Web Sémantique et applicationsLangages pour le Web Sémantique
XMLRDF et RDFSOWL (DAML+OIL)(SPARQL, RIF, microformats)
(Web Services et Semantic Web Services)
Lundi 21 janvier 2008 7
Documents pour approfondirÀ disposition, quelques articles (PDF) généralistes mais de référence sur : http://www.emse.fr/~beaune/websem/
Un dossier AFIA (avril 2003)Un article des assises 2002 du GdR I3Des articles de Tim BernersLeeLa vision d'Aaron Swartz (2002)Perspectives : rapport EUNSF (J. Euzénat, 2002)Des tutoriaux, etc.
Attention aux droits d'auteur
Lundi 21 janvier 2008 8
Le Web actuel
Navigation à très bas niveau :Clics sur des liensRecherche de pages par mots clés« c'est comme de la programmation en assembleur avec des goto »
Problèmes :Sur le Web : la machine fait peuSur le Web : l'utilisateur fait beaucoup
Lundi 21 janvier 2008 9
Le Web actuel (suite)
Recherche d'infos limitée :L'Homme doit interpréter le résultat
Interopérabilité difficile :Différents points de vue sur les documents
Services limités :Ex : comment organiser un séjour ?
Lundi 21 janvier 2008 10
Solution niv. 1 : Wrapper
Lundi 21 janvier 2008 11
Wrapper (suite)
Automatisation de l'extraction de l'information et médiationLe mediator s'occupe de l'utilisateur et les wrappers des sources de donnéesLes wrappers ont été adaptés aux données semistructurées, et tentent d'utiliser le format HTML avec des heuristiques (ex. : pour trouver un prix, chercher un nombre suivi d'un symbole monétaire, voir aussi les microformats)
Lundi 21 janvier 2008 12
Solution niv. 2 : ajout de structuration (sémantique ?)
XML : les balises peuvent indiquer la sémantique (implicite, par convention) des données <nom>Philippe Beaune</nom>
XML structure les données en arborescences<personne>
<nom>Philippe Beaune</nom><téléphone>+(33) 477 420 136</téléphone>
</personne>
XML permet de définir des balises personnelles
Lundi 21 janvier 2008 13
Ajout de structuration (suite)
RDF permet de représenter des informations sur des ressources Web :
RDF/XML : application XMLAjout de métadonnées aux documents Web
... RDFS : langage de description de vocabulaires pour RDF (extension sémantique de RDF) ... OWL
Lundi 21 janvier 2008 14
Solution niv. 3 : les ontologiesOntologies =
Spécifications formelles et consensuelles de conceptualisationsCompréhension commune et partagée d'un domaine
Mais quid de la standardisation de la structuration ?
Lundi 21 janvier 2008 15
Applications
Lundi 21 janvier 2008 16
Knowledge Management
Gestion des connaissances, gestion des compétences, ... : acquisition, maintenance et accès à la connaissance, interopérabilitéLes grandes entreprises ont des intranet très fournisLes ontologies permettent des définitions structurelles et sémantiques des documentsRecherche d'informations, échanges de documents, maintenance, ...
Lundi 21 janvier 2008 17
B2C / recherche d'infos
Parcours manuel des magasins en ligneWrappers : spécifiques à chaque magasinsInfos partielles (ex : frais de port)Avec une structuration des informations : agents intelligents pour aider au choixIl faut que ces agents comprennent l'information disponible
Lundi 21 janvier 2008 18
Commerce électronique (B2B)EDIFACT : lourd, coûteux, pas lisible, peu intégré, maintenance, pas évolutif, ...Ontologies : lisibles, interopérables, outils, ...Mais il faut quand même des traducteurs : <produit> <auto>
<type>voiture</type> <nom><nom>Renault></nom> <Renault><prix>20 000 euros</prix> </nom>
</produit> <prix>x $</prix>
</auto>
Lundi 21 janvier 2008 19
Un scénario (cf. Euzénat)
Quelques exemples illustratifs ...... mais surtout pas prédictifs.
Les usages ne précèdent pas la technologie, mais la technologie permet les usages.
Lundi 21 janvier 2008 20
ScénarioClara, en vacances à Honolulu, rencontre plusieurs personnes avec qui elle échange des vCards. Un soir, elle consulte son assistant pour les prévisions du lendemain. Son assistant lui ressort une vCard : « Ce type semble correspondre à l'offre de poste que Bill a publiée sur l'intranet. Puisje en informer Bill ? ». Clara demande des explications. L'assistant : « d'après son CV, trouvé sur le site de sa compagnie, il a les compétences requises, en temps que statisticien, à la tête d'une équipe de Data Mining, dans un labo de ... à l'Université Xx ». Clara demande le degré de confiance en tout ça. L'assistant : « il est cité plusieurs fois dans les pages de l'Université Xx et les revues dans lesquelles il a publié sont bien cotées par l'assistant de Bill... ». Clara autorise la transmission.
Bill et Peter se donnent rendezvous à tel congrès ... Grâce à l'assistant de Peter qui sait qu'il est végétarien, ils évitent un faux pas. Avant le repas, Peter examine un point qui le tracasse : Bill a utilisé le mot « Services » en parlant de ... Son assistant lui montre que « Services » en bases de données signifie ...
Lundi 21 janvier 2008 21
Scénario (suite)
Besoins :Assistants performantsConnectivité sans filÉchange de connaissancesProtocoles de négociationUn grand nombre de données et de connaissancesProtection des donnéesDes modèles de confiance, de négociation, de filtrage, ...
Lundi 21 janvier 2008 22
Plan du cours
Généralités sur le Web Sémantique et applicationsLangages pour le Web Sémantique
XMLRDF et RDFSOWL (DAML+OIL)(SPARQL, RIF, microformats)
(Web Services et Semantic Web Services)
Lundi 21 janvier 2008 23
XML rappels
Un SGML simplifiéHTML était prévu pour décrire la structure d'un document, mais il est utilisé comme un langage de présentationXML : structures arborescentesXML : extensibleXML : métalangage
Lundi 21 janvier 2008 24
XML : rappels (suite)
Éléments : <balise>contenu</balise>Attributs : <balise nom=valeur> ... </balise>Références : < ...Commentaires : <! blabla >Process Instructions : <?name pidata?>CDATA : <![CDATA[ quelque chose ]]>Prologue : <?XML version=.... ?> ...
Lundi 21 janvier 2008 25
XML : rappels (suite)
Un document XML est valide s'il est bienformé et, lorsqu'il utilise une DTD, s'il respecte cette DTD (ou un schéma XML)Schéma XML : définit la structure des documents, le vocabulaire des balises, des types de données, des contraintes, ......
Lundi 21 janvier 2008 26
XML : espaces de noms
Un même document doit pouvoir utiliser plusieurs vocabulaires de balisages :
Conception modulaireRéutilisationMêmes noms (éléments, attributs) avec sens différents dans vocabulaires indépendantsLever les ambiguïtésExemple :
titre = M, Mme, Mlletitre = « Les fleurs du mal »
Lundi 21 janvier 2008 27
XML : espaces de noms syntaxe
<definitions name=... xmlns:soap=''http://schemas.xmlsoap.org/wsdl/soap/''...>
<soap:body use=''quelque chose''>
</definitions>
Lundi 21 janvier 2008 28
RDF : présentation
Resource Description FrameworkPermet la représentation de métadonnées (données sur les données)Ce modèle peut être vu comme un graphe étiqueté et orienté, ou comme un modèle orienté objetsUne syntaxe en XML ; mais pas la seule
Lundi 21 janvier 2008 29
RDF : objectifsThe broad goal of RDF is to define a mechanism for describing resources that makes no assumptions about a particular application domain, nor defines (a priori) the semantics of any application domain. The definition of the mechanism should be domain neutral, yet the mechanism should be suitable for describing information about any domain.
The foundation of RDF is a model for representing named properties and property values. The RDF model draws on wellestablished principles from various data representation communities. RDF properties may be thought of as attributes of resources and in this sense correspond to traditional attributevalue pairs. RDF properties also represent relationships between resources and an RDF model can therefore resemble an entityrelationship diagram. (More precisely, RDF Schemas which are themselves instances of RDF data models are ER diagrams.) In objectoriented design terminology, resources correspond to objects and properties correspond to instance variables.
Lundi 21 janvier 2008 30
RDF : 4 niveaux
Des triplets d'URIs3 types de bases : ressources, propriétés et déclarationsDes types plus complexes : listes, collections, alternatives, ...Des schémas : classes, types de propriétés, ...
Lundi 21 janvier 2008 31
RDF : déclarations
Une déclaration est un triplet (a,b,c) qui signifie que le sujet a a comme valeur, pour la propriété b, l'objet c
(http://www.w3.org/Home/Lassila , hasCreator , Ora Lassila)
Lundi 21 janvier 2008 32
RDF : déclaration sur des déclarations
(st1 , rdf:subject , http://www.w3.org/H... )(st1 , rdf:predicate , hasCreator)(st1 , rdf:object , Ora Lassila)
(Philippe , dit , st1)
Lundi 21 janvier 2008 33
RDF : les 3 types de base
Resources :All things being described by RDF expressions are called
resources. A resource may be an entire Web page; such as the HTML document "http://www.w3.org/Overview.html" for example. A resource may be a part of a Web page; e.g. a specific HTML or XML element within the document source. A resource may also be a whole collection of pages; e.g. an entire Web site. A resource may also be an object that is not directly accessible via the Web; e.g. a printed book. Resources are always named by URIs plus optional anchor ids. Anything can have a URI; the extensibility of URIs allows the introduction of identifiers for any entity imaginable.
Lundi 21 janvier 2008 34
Properties : a property is a specific aspect, characteristic, attribute, or relation used to describe a resource. Each property has a specific meaning, defines its permitted values, the types of resources it can describe, and its relationship with other properties. This document does not address how the characteristics of properties are expressed (for such information, refer to the RDF Schema specification).
Statements : a specific resource together with a named property plus the value of that property for that resource is an RDF statement. These three individual parts of a statement are called, respectively, the subject, the predicate, and the object. The object of a statement (i.e., the property value) can be another resource or it can be a literal; i.e., a resource (specified by a URI) or a simple string or other primitive datatype defined by XML. In RDF terms, a literal may have content that is XML markup but is not further evaluated by the RDF processor. There are some syntactic restrictions on how markup in literals may be expressed
RDF : les 3 types de base
Lundi 21 janvier 2008 35
RDF : exempleOra Lassila is the creator of the ressource http://www.w3.org/Home/Lassila
Subject (Resource) http://www.w3.org/Home/Lassila
Predicate (Property) Creator
Object (literal) "Ora Lassila"
http://www.w3.org/Home/Lassila has creator Ora Lassila
Lundi 21 janvier 2008 36
RDF : exemple (suite)The individual whose name is Ora Lassila, email <[email protected]>, is the creator of http://www.w3.org/Home/Lassila.
http://www.w3.org/Home/Lassila has creator something and something has name Ora Lassila and email [email protected]
Lundi 21 janvier 2008 37
RDF : exemple suite
The individual referred to by employee id 85740 is named Ora Lassila and has the email address [email protected]. The resource http://www.w3.org/Home/Lassila was created by this individual.
Lundi 21 janvier 2008 38
RDF : syntaxe XML de base [1] RDF ::= ['<rdf:RDF>'] description* ['</rdf:RDF>'] [2] description ::= '<rdf:Description' idAboutAttr? '>'
propertyElt* '</rdf:Description>' [3] idAboutAttr ::= idAttr | aboutAttr [4] aboutAttr ::= 'rdf:about="' URI-reference '"' [5] idAttr ::= 'rdf:ID="' IDsymbol '"' [6] propertyElt ::= '<' propName '>' value '</' propName '>' | '<' propName resourceAttr '/>' [7] propName ::= Qname [8] value ::= description | string [9] resourceAttr ::= 'resource="' URI-reference '"' [10] Qname ::= [ NSprefix ':' ] name [11] URI-reference ::= string, interpreted per [URI] [12] IDsymbol ::= (any legal XML name symbol) [13] name ::= (any legal XML name symbol) [14] NSprefix ::= (any legal XML namespace prefix) [15] string ::= (any XML text, with "<", ">", and "&"
escaped)
Lundi 21 janvier 2008 39
RDF/XML : validation
Il existe des validateurs, notamment en ligne, dont celuici qui en plus offre une traduction sous forme de graphe (il se conforme à la recommandation W3C de 2004) :
http://www.w3.org/RDF/Validator/
Lundi 21 janvier 2008 40
RDF/XML : exempleOra Lassila is the creator of the resource http://www.w3.org/Home/Lassila
Subject (Resource) http://www.w3.org/Home/Lassila
Predicate (Property) Creator
Object (literal) "Ora Lassila"
<?xml version="1.0"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22rdfsyntaxns#" xmlns:s="http://description.org/schema/"> <rdf:Description rfd:about="http://www.w3.org/Home/Lassila"> <s:Creator>Ora Lassila</s:Creator> </rdf:Description></rdf:RDF>
Lundi 21 janvier 2008 41
RDF/XML : exemple<rdf:RDF xmlns:rdf="http://wwww.w3.org/1999/02/22rdfsyntaxns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ex="http://mon_url.org/version/1.1/"> <rdf:Description rdf:ID="michel"/> <rdf:Description rdf:ID="vertigo"> <ex:homepage> <rdf:Description rdf:about= '' http://cedric.cnam.fr/vertigo''> <dc:author> <rdf:Description rdf:about="#michel"/> </dc:author> </rdf:Description> </ex:homepage> <ex:directeur> <rdf:Description rdf:about="#michel" /> </ex:directeur> </rdf:Description></rdf:RDF>
Lundi 21 janvier 2008 42
RDF/XML : abréviation d'URIs<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xml:base="http://www.example.com/books">
<rdf:Description rdf:about="book12345">
<dc:title>Le titre</dc:title>
</rdf:Description>
</rdf:RDF>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xml:base="http://www.example.com/books">
<rdf:Description rdf:ID="book12345">
<dc:title>Le titre</dc:title>
</rdf:Description>
</rdf:RDF>
http://www.example.com/books/book12345
http://www.example.com/books#book12345
Lundi 21 janvier 2008 43
RDF/XML : literals
La valeur d'une propriété peut être du texte ou un fragment XML :
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xml:base="http://www.example.com/books">
<rdf:Description rdf:ID="book12345">
<dc:title rdf:parseType="Literal">
<span xml:lang="en">
The <em><br /></em> Element Considered Harmful.
</span>
</dc:title>
</rdf:Description>
Lundi 21 janvier 2008 44
RDF/XML : exercice
Écrivez dans cette syntaxe de base les deux exemples précédents :
Page 37Page 38
Lundi 21 janvier 2008 45
RDF/XML : syntaxesDes syntaxes XML abrégées existent
[2a] description ::= '<rdf:Description' idAboutAttr? propAttr* '/>' | '<rdf:Description' idAboutAttr? propAttr* '>' propertyElt* '</rdf:Description>' | typedNode[6a] propertyElt ::= '<' propName '>' value '</' propName '>' | '<' propName resourceAttr? propAttr* '/>'[16] propAttr ::= propName '="' string '"' (with embedded quotes escaped)[17] typedNode ::= '<' typeName idAboutAttr? propAttr* '/>' | '<' typeName idAboutAttr? propAttr* '>' property* '</' typeName '>'
Lundi 21 janvier 2008 46
RDF : containersBag : an unordered list of resources or literals. Bags are used to declare
that a property has multiple values and that there is no significance to the order in which the values are given. Bag might be used to give a list of part numbers where the order of processing the parts does not matter. Duplicate values are permitted.
Sequence : an ordered list of resources or literals. Sequence is used to declare that a property has multiple values and that the order of the values is significant. Sequence might be used, for example, to preserve an alphabetical ordering of values. Duplicate values are permitted.
Alternative : a list of resources or literals that represent alternatives for the (single) value of a property. Alternative might be used to provide alternative language translations for the title of a work, or to provide a list of Internet mirror sites at which a resource might be found. An application using a property whose value is an Alternative collection is aware that it can choose any one of the items in the list as appropriate.
Lundi 21 janvier 2008 47
RDF/XML containers : syntaxe
[18] container ::= sequence | bag | alternative [19] sequence ::= '<rdf:Seq' idAttr? '>' member* '</rdf:Seq>' [20] bag ::= '<rdf:Bag' idAttr? '>' member* '</rdf:Bag>' [21] alternative ::= '<rdf:Alt' idAttr? '>' member+ '</rdf:Alt>' [22] member ::= referencedItem | inlineItem [23] referencedItem ::= '<rdf:li' resourceAttr '/>' [24] inlineItem ::= '<rdf:li>' value '</rdf:li>'
Containers may be used everywhere a Description is permitted:
[1a] RDF ::= '<rdf:RDF>' obj* '</rdf:RDF>' [8a] value ::= obj | string [25] obj ::= description | container
Lundi 21 janvier 2008 48
RDF/XML containers : exemple
The students in course 6.001 are Amy, Tim, John, Mary, and Sue
<rdf:RDF> <rdf:Description rdf:about="http://mycollege.edu/courses/6.001"> <s:students> <rdf:Bag> <rdf:li rdf:resource="http://mycollege.edu/students/Amy"/> <rdf:li rdf:resource="http://mycollege.edu/students/Tim"/> <rdf:li rdf:resource="http://mycollege.edu/students/John"/> <rdf:li rdf:resource="http://mycollege.edu/students/Mary"/> <rdf:li rdf:resource="http://mycollege.edu/students/Sue"/> </rdf:Bag> </s:students> </rdf:Description></rdf:RDF>
Lundi 21 janvier 2008 49
RDF containers : exempleThe source code for X11 may be found at ftp.x.org, ftp.cs.purdue.edu, or
ftp.eu.net
<rdf:RDF> <rdf:Description rdf:about="http://x.org/packages/X11"> <s:DistributionSite> <rdf:Alt> <rdf:li rdf:resource="ftp://ftp.x.org"/> <rdf:li rdf:resource="ftp://ftp.cs.purdue.edu"/> <rdf:li rdf:resource="ftp://ftp.eu.net"/> </rdf:Alt> </s:DistributionSite> </rdf:Description></rdf:RDF>
Lundi 21 janvier 2008 50
RDF/XML : referents
Ora est créatrice du « Bag », et pas des pages (??). La référence de la description est le container.
<rdf:Bag rdf:ID="pages"> <rdf:li rdf:resource="http://foo.org/foo.html" /> <rdf:li rdf:resource="http://bar.org/bar.html" /></rdf:Bag>
<rdf:Description rdf:about="#pages"> <s:Creator>Ora Lassila</s:Creator></rdf:Description>
Lundi 21 janvier 2008 51
RDF/XML : distributive referent(retiré de la recomm de 2004)
Pour exprimer que Ora est créatrice de toutes les pages il faut étendre la syntaxe :
[3a] idAboutAttr ::= idAttr | aboutAttr | aboutEachAttr[26] aboutEachAttr ::= 'aboutEach="' URI-reference '"'
<rdf:Description aboutEach="#pages"> <s:Creator>Ora Lassila</s:Creator></rdf:Description>
<rdf:Description about="http://foo.org/foo.html"> <s:Creator>Ora Lassila</s:Creator></rdf:Description><rdf:Description about="http://bar.org/bar.html"> <s:Creator>Ora Lassila</s:Creator></rdf:Description>
Presque équivalent à :
Lundi 21 janvier 2008 52
RDF : container et motif URI(retiré de la recomm de 2004)
Comment exprimer : "all pages at my Web site", or "all pages in this branch of my Web site" ?
[26a] aboutEachAttr ::= 'aboutEach="' URI-reference '"' | 'aboutEachPrefix="' string '"'
<rdf:Description aboutEachPrefix="http://foo.org/doc"> <s:Copyright>© 1998, The Foo Organization</s:Copyright></rdf:Description>
<rdf:Description about="http://foo.org/doc/page1"> <s:Copyright>© 1998, The Foo Organization</s:Copyright></rdf:Description><rdf:Description about="http://foo.org/doc/page2"> <s:Copyright>© 1998, The Foo Organization</s:Copyright></rdf:Description>
Presque équivalent à :
Lundi 21 janvier 2008 53
RDF : container vs repeated prop.
Sue has written "Anthology of Time", "Zoological Reasoning", "Gravitational Reflections".
Lundi 21 janvier 2008 54
RDF : container vs repeated prop.
The committee of Fred, Wilma, and Dino approved the resolution.
La résolution est approuvée parchaque membre ou par l'ensemble ?
Lundi 21 janvier 2008 55
RDF : collection
Les containers ne sont pas clos.Une collection = structure de liste
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:s="http://example.org/students/vocab#">
<rdf:Description rdf:about="http://example.org/courses/6.001">
<s:students rdf:parseType="Collection">
<rdf:Description rdf:about="http://exam.org/students/Amy"/>
<rdf:Description rdf:about="http://exam.org/students/Mohamed"/>
<rdf:Description rdf:about="http://exam.org/students/Johann"/>
</s:students>
</rdf:Description>
</rdf:RDF>
Lundi 21 janvier 2008 56
RDF : collection
Lundi 21 janvier 2008 57
RDF : collection<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:s="http://example.org/students/vocab#">
<rdf:Description rdf:about="http://example.org/courses/6.001">
<s:students rdf:nodeID="sch1"/>
</rdf:Description>
<rdf:Description rdf:nodeID="sch1">
<rdf:first rdf:resource="http://example.org/students/Amy"/>
<rdf:rest rdf:nodeID="sch2"/>
</rdf:Description>
<rdf:Description rdf:nodeID="sch2">
<rdf:first rdf:resource="http://example.org/students/Mohamed"/>
<rdf:rest rdf:nodeID="sch3"/>
</rdf:Description>
<rdf:Description rdf:nodeID="sch3">
<rdf:first rdf:resource="http://example.org/students/Johann"/>
<rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
</rdf:Description>
</rdf:RDF>
Lundi 21 janvier 2008 58
RDF : statements about statements
Ralph Swick says that Ora Lassila is the creator of the resource http://www.w3.org/Home/Lassila.
Lundi 21 janvier 2008 59
RDF : statements about statements
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:a="http://description.org/schema/"> <rdf:Description> <rdf:subject rdf:resource="http://www.w3.org/Home/Lassila" /> <rdf:predicate rdf:resource="http://description.org/schema/Creator" /> <rdf:object>Ora Lassila</rdf:object> <rdf:type rdf:resource= "http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement" /> <a:attributedTo>Ralph Swick</a:attributedTo> </rdf:Description></rdf:RDF>
Lundi 21 janvier 2008 60
RDF : statements about statements (retiré de la recomm de 2004)
<rdf:RDF> <rdf:Description about="http://www.w3.org/Home/Lassila" bagID="D_001"> <s:Creator>Ora Lassila</s:Creator> <s:Title>Ora's Home Page</s:Title> </rdf:Description></rdf:RDF>
[2b] description ::= '<rdf:Description' idAboutAttr? bagIDAttr? propAttr* '/>' | '<rdf:Description' idAboutAttr? bagIDAttr? propAttr* '>' propertyElt* '</rdf:Description>' [27] bagIDAttr ::= 'bagID="' IDsymbol '"'
Lundi 21 janvier 2008 61
Lundi 21 janvier 2008 62
<rdf:Description aboutEach="#D_001"> <a:attributedTo>Ralph Swick</a:attributedTo></rdf:Description>
Lundi 21 janvier 2008 63
RDF : exemple avec Dublin Core
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/metadata/dublin_core#"> <rdf:Description rdf:about="http://www.dlib.org"> <dc:Title>D-Lib Program - Research in Digital Libraries</dc:Title> <dc:Description>The D-Lib program supports the community of people with research interests in digital libraries and electronic publishing.</dc:Description> <dc:Publisher>Corporation For National Research Initiatives</dc:Publisher> <dc:Date>1995-01-07</dc:Date> <dc:Subject> <rdf:Bag> <rdf:li>Research; statistical methods</rdf:li> <rdf:li>Education, research, related topics</rdf:li> <rdf:li>Library use Studies</rdf:li> </rdf:Bag> </dc:Subject> <dc:Type>World Wide Web Home Page</dc:Type> <dc:Format>text/html</dc:Format> <dc:Language>en</dc:Language> </rdf:Description></rdf:RDF>
Lundi 21 janvier 2008 64
RDFS : pourquoi ?
Besoin de créer des vocabulaires dans certains domainesDonc besoin d'un langage pour le faireRDFS = RDF vocabulary description language (adopté le 10 février 2004)RDFS permet de créer des vocabulaires et de les organiser dans des hiérarchies typées (classes, sousclasses, type, propriétés, souspropriétés, domaines, intervalles, ...)
Lundi 21 janvier 2008 65
RDFS (cand .recom. 27 mars 2000)
Lundi 21 janvier 2008 66
RDFS (cand. recom. 27 mars 2000)
Lundi 21 janvier 2008 67
RDFS : exemple
Lundi 21 janvier 2008 68
RDFS : exemple<rdf:RDF xml:lang="en" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:base="http://www.w3.org/2000/03/example/vehicles#"><rdf:Description rdf:ID="MotorVehicle"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/></rdf:Description><rdf:Description rdf:ID="PassengerVehicle"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#MotorVehicle"/></rdf:Description><rdf:Description rdf:ID="Truck"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#MotorVehicle"/></rdf:Description><rdf:Description rdf:ID="Van"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#MotorVehicle"/></rdf:Description><rdf:Description rdf:ID="MiniVan"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#Van"/> <rdfs:subClassOf rdf:resource="#PassengerVehicle"/></rdf:Description></rdf:RDF>
Lundi 21 janvier 2008 69
RFDS : autre exempleLa propriété a_pour_mari est une souspropriété de a_pour_conjoint, et que tous les sujets de a_pour_mari sont membres de #Femme et #Mariés ; et que les objets de cette propriété sont membres de #Homme et #Mariés :<rdf:RDF> <rdf:Property rdf:ID="a_pour_conjoint"/> <rdf:Property rdf:ID="a_pour_mari"> <rdfs:subPropertyOf rdf:resource="#a_pour_conjoint"/> <rdfs:domain rdf:resource="#Femme"/> <rdfs:domain rdf:resource="#Mariés"/> <rdfs:range rdf:resource="#Homme"/> <rdfs:range rdf:resource="#Mariés"/> </rdf:Property></rdf:RDF>
Lundi 21 janvier 2008 70
Plan du cours
Généralités sur le Web Sémantique et applicationsLangages pour le Web Sémantique
XMLRDF et RDFSOWL (DAML+OIL)(SPARQL, RIF, microformats)
(Web Services et Semantic Web Services)
Lundi 21 janvier 2008 71
Pourquoi aller plus haut ?
Avec RDF(S) : on ne peut pas exprimer la disjonction, l'équivalence, la cardinalité, des conditions nécessaires et suffisantes, ...On ne peut pas raisonner (ou si peu!)OWL : Web Ontology Language (W3C)Mais avant :
DAML (DARPA Agent Markup Language)OIL (Ontology Inference Layer, ISTFP5)
Lundi 21 janvier 2008 72
ExempleFor example, a suitable pizza ontology might
include the information that Mozzarella and Gorgonzola are kinds of cheese, that cheese is not a kind of meat or fish, and that a vegetarian pizza is one whose toppings do not include any meat or fish. This information allows the term « pizza topped with (only) Mozzarella and Gorgonzola » to be unambiguously interpreted (by, e.g., a pizza ordering agent) as a specialisation of the term « vegetarian pizza ».
Lundi 21 janvier 2008 73
Lundi 21 janvier 2008 74
OWL (DAML+OIL)OWL is intended to be used when the information contained
in documents needs to be processed by applications, as opposed to situations where the content only needs to be presented to humans. OWL can be used to explicitly represent the meaning of terms in vocabularies and the relationships between those terms. This representation of terms and their interrelationships is called an ontology. OWL has more facilities for expressing meaning and semantics than XML, RDF, and RDF-S, and thus OWL goes beyond these languages in its ability to represent machine interpretable content on the Web. OWL is a revision of the DAML+OIL web ontology language incorporating lessons learned from the design and application of DAML+OIL.
Lundi 21 janvier 2008 75
OWL The OWL Web Ontology Language is designed for
use by applications that need to process the content of information instead of just presenting information to humans. OWL facilitates greater machine interpretability of Web content than that supported by XML, RDF, and RDF Schema (RDF-S) by providing additional vocabulary along with a formal semantics. OWL has three increasingly-expressive sublanguages: OWL Lite, OWL DL, and OWL Full.
Lundi 21 janvier 2008 76
OWLXML provides a surface syntax for structured documents, but imposes no semantic constraints on the meaning of these documents.XML Schema is a language for restricting the structure of XML documents.RDF is a datamodel for objects ("resources") and relations between them, provides a simple semantics for this datamodel, and these datamodels can be represented in an XML syntax.RDF Schema is a vocabulary for describing properties and classes of RDF resources, with a semantics for generalization-hierarchies of such properties and classes.OWL adds more vocabulary for describing properties and classes: among others, relations between classes (e.g. disjointness), cardinality (e.g. "exactly one"), equality, richer typing of properties, characteristics of properties (e.g. symmetry), and enumerated classes.
Lundi 21 janvier 2008 77
Souslangages d'OWL
OWL Lite supports those users primarily needing a classification hierarchy and simple constraints. For example, while it supports cardinality constraints, it only permits cardinality values of 0 or 1. It should be simpler to provide tool support for OWL Lite than its more expressive relatives, and OWL Lite provides a quick migration path for thesauri and other taxonomies. Owl Lite also has a lower formal complexity than OWL DL, see the section on OWL Lite in the OWL Reference for further details.
OWL DL supports those users who want the maximum expressiveness while retaining computational completeness (all conclusions are guaranteed to be computed) and decidability (all computations will finish in finite time). OWL DL includes all OWL language constructs, but they can be used only under certain restrictions (for example, while a class may be a subclass of many classes, a class cannot be an instance of another class). OWL DL is so named due to its correspondence with description logics, a field of research that has studied the logics that form the formal foundation of OWL.
Lundi 21 janvier 2008 78
Souslangages d'OWLOWL Full is meant for users who want maximum expressiveness and the syntactic freedom of RDF with no computational guarantees. For example, in OWL Full a class can be treated simultaneously as a collection of individuals and as an individual in its own right. OWL Full allows an ontology to augment the meaning of the pre-defined (RDF or OWL) vocabulary. It is unlikely that any reasoning software will be able to support complete reasoning for every feature of OWL Full.
Every legal OWL Lite ontology is a legal OWL DL ontology.
Every legal OWL DL ontology is a legal OWL Full ontology.
Every valid OWL Lite conclusion is a valid OWL DL conclusion.
Every valid OWL DL conclusion is a valid OWL Full conclusion.
Lundi 21 janvier 2008 79
OWL et RDFOWL Full can be viewed as an extension of RDF, while OWL Lite
and OWL DL can be viewed as extensions of a restricted view of RDF. Every OWL (Lite, DL, Full) document is an RDF document, and every RDF document is an OWL Full document, but only some RDF documents will be a legal OWL Lite or OWL DL document. Because of this, some care has to be taken when a user wants to migrate an RDF document to OWL. When the expressiveness of OWL DL or OWL Lite is deemed appropriate, some precautions have to be taken to ensure that the original RDF document complies with the additional constraints emposed by OWL DL and OWL Lite. Among others, every URI that is used as a class name must be explicitly asserted to be of type owl:Class (and simililarly for properties), every individual must be asserted to belong to at least one class (even if only owl:Thing), the URI's used for classes, properties and individuals must be mutually disjoint. The details of these and other constraints on OWL DL and OWL Lite are explained in appendix E of the OWL Reference.
Lundi 21 janvier 2008 80
Avec RDFS ...Using RDFS we can
declare classes like Country, Person, Student and Canadian;
state that Student is a subclass of Person;
state that Canada and England are both instances of the class Country;
declare Nationality as a property relating the classes Person (its domain) and Country (its range);
state that age is a datatype property, with Person as its domain and integer as its range;
state that Peter is an instance of the class Canadian, and that his age has value 48.
Lundi 21 janvier 2008 81
Mais avec OWL :With OWL we can additionally:
state that Country and Person are disjoint classes;
state that Canada and England are distinct individuals;
declare HasCitizen as the inverse property of Nationality;
state that the class Stateless is defined precisely as those members of the class Person that have no values for the property Nationality;
state that the class MultipleNationals is defined precisely as those membes of the class Person that have at least 2 values for the property Nationality;
state that the class Canadian is defined precisely as those members of the class Person that have Canada as a value of the property Nationality;
state that age is a functional property.
Lundi 21 janvier 2008 82
OWL Lite : survol (1)
Class : groupe d'individus, mêmes propriétés <owl:Class rdf:ID="Regions"/>
rdfs:subClassOfIntersectionOf (avec des limites)rdfs:Property ; ObjectProperty ; DatatypeProperty ; rdfs:subPropertyOfrdfs:domain ; rdfs:rangeIndividual : instances de classes <Regions rdf:ID="Rhone_Alpes"/>
Lundi 21 janvier 2008 83
OWL Lite : survol (1bis)
Individual : instances de classes
<owl:Thing rdf:ID="Rhone_Alpes" />
<owl:Thing rdf:about="#Rhone_Alpes">
<rdf:type rdf:resource="#Region"/>
</owl:Thing>
Classes, sousclasses et individus ... ?
Lundi 21 janvier 2008 84
OWL Lite : survol (2)
equivalentClass (mêmes instances) :<owl:Class rdf:ID="Titi">
<owl:equivalentClass rdf:resource="Toto"/>
</owl:Class>
equivalentProperty ; sameAs ; differentFrom ; AllDifferentinverseOf ; TransitiveProperty ; SymmetricProperty ; FunctionnalProperty ; ...allValueFrom ; someValueFrom ; minCardinality ...
Lundi 21 janvier 2008 85
OWL Lite : survol (3)
allValueFrom :
<owl:Class rdf:ID="Wine"> <rdfs:subClassOf rdf:resource="&food;PotableLiquid" /> ... <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasMaker" /> <owl:allValuesFrom rdf:resource="#Winery" /> </owl:Restriction> </rdfs:subClassOf> ...</owl:Class>
Lundi 21 janvier 2008 86
OWL DL & Full : survol
oneOf : définir une classe en extension<owl:Class rdf:ID="Titi">
<owl:oneOf rdf:parseType="Collection"><Titi rdf:resource="#Prems"/>
<Titi rfd:resource="#Deuze"/>
</owl:oneOf>
</owl:Class>
disjointWith ; unionOf ; complementOf ; intersectionOf ; hasValue ...
Lundi 21 janvier 2008 87
OWL Full : survolowl:class équivalent à rdfs:classOWL Full also allows classes to be treated as individualsobject properties and datatype properties are not disjointOWL Full will typically be useful for people who want to combine the expressivity of OWL with the flexibility and metamodelling features of RDF. However, use of the OWL Full features means that one loses some guarantees that OWL DL and OWL Lite can provide for reasoning systems.
Lundi 21 janvier 2008 88
OWLDL : survol (1)
OWL DL requires a pairwise separation between classes, datatypes, datatype properties, object properties, annotation properties, ontology properties, individuals, data values and the builtin vocabulary. This means that, for example, a class cannot be at the same time an individual.
In OWL DL the set of object properties and datatype properties are disjoint.
OWL DL requires that no cardinality constraints (local nor global) can be placed on transitive properties or their inverses or any of their superproperties.
Annotations are allowed only under certain conditions.
Most RDF(S) vocabulary cannot be used within OWL DL.
Lundi 21 janvier 2008 89
OWLDL : survol (2)
All axioms must be wellformed, with no missing or extra components, and must form a treelike structure.
Axioms (facts) about individual equality and difference must be about named individuals.
These constraints of OWL DL may seem like an arbitrary set, but in fact they are not. The constraints are based on work in the area of reasoners for Description Logic, which require these restrictions to provide the ontology builder or user with reasoning support. In particular, the OWL DL restrictions allow the maximal subset of OWL Full against which current research can assure that a decidable reasoning procedure can exist for an OWL reasoner.
Lundi 21 janvier 2008 90
OWL : exemple (1)
The following example defines a class of individuals which have at least one parent who is a physician:
<owl:Restriction> <owl:onProperty rdf:resource="#hasParent" /> <owl:someValuesFrom rdf:resource="#Physician" /></owl:Restriction>
Lundi 21 janvier 2008 91
OWL : exemple (2)<owl:Class> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#Tosca" /> <owl:Thing rdf:about="#Salome" /> </owl:oneOf> </owl:Class> <owl:Class> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#Turandot" /> <owl:Thing rdf:about="#Tosca" /> </owl:oneOf> </owl:Class> </owl:intersectionOf></owl:Class>
Lundi 21 janvier 2008 92
OWL : exemple (3)<owl:Class rdf:ID="DaPonteOperaOfMozart"> <owl:equivalentClass> <owl:Class> <owl:oneOf rdf:parseType="Collection"> <Opera rdf:about="#Nozze_di_Figaro"/> <Opera rdf:about="#Don_Giovanni"/> <Opera rdf:about="#Cosi_fan_tutte"/> </owl:oneOf> </owl:Class> </owl:equivalentClass></owl:Class>
Lundi 21 janvier 2008 93
OWL : exemple (4)
<owl:Class rdf:ID="LivingBeing"> <owl:unionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Plant"/> <owl:Class rdf:about="#Animal"/> </owl:unionOf></owl:Class>
Lundi 21 janvier 2008 94
OWL Full : exemple (5)<owl:Class rdf:ID="FootballTeam">
<owl:sameAs rdf:resource="http://sports.org/US#SoccerTeam"/>
</owl:Class>
Note the difference with the statement:
<footballTeam owl:equivalentClass us:soccerTeam />
which states that the two classes have the same class extension, but are not (necessarily) the same concepts.
Lundi 21 janvier 2008 95
OWL : exemple (6)
<owl:AllDifferent>
<owl:distinctMembers rdf:parseType="Collection">
<Opera rdf:about="#Don_Giovanni"/>
<Opera rdf:about="#Nozze_di_Figaro"/>
<Opera rdf:about="#Cosi_fan_tutte"/>
<Opera rdf:about="#Tosca"/>
<Opera rdf:about="#Turandot"/>
<Opera rdf:about="#Salome"/>
</owl:distinctMembers>
</owl:AllDifferent>
Lundi 21 janvier 2008 96
Plan du cours
Généralités sur le Web Sémantique et applicationsLangages pour le Web Sémantique
XMLRDF et RDFSOWL (DAML+OIL)(SPARQL, RIF, microformats)
(Web Services et Semantic Web Services)
Lundi 21 janvier 2008 97
SPARQL
Recommandations W3C du 15 janvier 2008 : langage de requêtes, protocole, format de sortieInterroger des bases de triplets RDFPas d'inférences (au serveur de le faire)Des softs existent (notamment dans Jena)
Lundi 21 janvier 2008 98
Exemple SPARQL
PREFIX foaf: <http://xmlns.com/foaf/0.1/>SELECT ?urlFROM <bloggers.rdf>WHERE { ?contributor foaf:name "Jon Foobar" . ?contributor foaf:weblog ?url .}
Lundi 21 janvier 2008 99
RIFEnsemble de recommandations W3C en préparation pour permettre l'échange de règles logiques sur le WebUse Cases and Requirements (working drafts)RIFBLD : un dialecte de base pour exprimer des règles (working draft)Compatibilités avec RFD et OWL (working drafts)
Lundi 21 janvier 2008 100
Microformats
Comment commencer sans efforts l'ajout de sémantique sans tout remettre en cause ?En utilisant des attributs existants en HTML et XHTML : class, rel/revEn ne redéfinissant pas un format qui existe déjà (cf. vCard par exemple)
Lundi 21 janvier 2008 101
Microformats, exemple<div class="vcard">
<span class="fn">Alex Faaborg</span>
<div class="org">Mozilla</div>
<div class="adr">
<div class="street-address">1981 Landings Drive
Building K</div>
<span class="locality">Mountain View</span>,
<span class="region">CA</span>,
<span class="postal-code">94043</span>
<span class="country-name">United States</span>
</div>
<div class="tel">617-899-5064</div>
</div>
Lundi 21 janvier 2008 102
Microformats existants
cf. http://microformats.org/hCard (people and organizations)hCalendar (calendars and events)VoteLinks, hReview (opinions, ...)XFN (social networks)rellicence (licences)...
Lundi 21 janvier 2008 103
Plan du cours
Généralités sur le Web Sémantique et applicationsLangages pour le Web Sémantique
XMLRDF et RDFSOWL (DAML+OIL)(SPARQL, RIF, microformats)
(Web Services et Semantic Web Services)
Lundi 21 janvier 2008 104
Web services
Faire coopérer des applis sur le WebTravaux sur :
Protocoles de communicationsDescription des services et de leurs interactionsSécurité et vie privée
XMLP, SOAP, WSDL, .NET, J2EE, UDDI, OWLS, ... WSML, WSMO, ...
Lundi 21 janvier 2008 105
Lundi 21 janvier 2008 106
Web Services
Lundi 21 janvier 2008 107
UDDI
Universal Description Discovery & IntegrationAnnuaires de services (publics ou privés)Contenu d'un enregistrement dans un annuaire UDDI :
businessEntity : decription de celui qui publiebusinessService : description d'une famille de servicesbindingTemplate : infos techniques sur un servicetmodel : format des requêtes et des réponses, gestion de la sécurité, protocoles, ...
Lundi 21 janvier 2008 108
WSDLWeb Services Language6 éléments majeurs :
Types : definitions des types de données (xsd) Message : définition des données transmisesOperation : description d'une action (in, out, fault)portType : ensemble d'opérations et messagesBinding : protocole et format de données (SOAP)Port : binding + adresse réseauService : ensemble de Ports
Lundi 21 janvier 2008 109
OWLService (OWLS)
OWLbased Web Service OntologyDescription d'un service avec :
ServiceProfile :Identification du fournisseur, entrées, résultats, effets, préconditions, QoS, restrictions, ...
ServiceModel :Processus, entrées/sorties,
ServiceGrounding :Protocoles, URI, messages, ...
Lundi 21 janvier 2008 110
Pour aller encore plus loin
Enrichir les web Services :
XQuery (à partir de Xpath)RuleML : pour coder des base de connaissances sous forme de règles de productionSWRL = OWL + RuleMLWSML et WSMO