W eb Sémantique - EMSE
Transcript of W eb Sémantique - EMSE
Mercredi 10 novembre 2004 1
Master Web Intelligence 2004/2005
Web SémantiquePhilippe Beaune
ENSM-SEmailto : [email protected]
Mercredi 10 novembre 2004 2
Plan général révisé(21h en 6 séances)
● Mercredi 13 oct AM : repr. des connaissances● Lundi 18 oct PM : DL & ontologies● Mardi 2 nov PM : TP ontologies (Protégé)● Mercredi 10 nov AM : le web sémantique● Mercredi 17 nov AM : TP Web Sémantique ?● Mercredi 1er déc AM : TP Web Sémantique ?● Mercredi 8 déc (10h – 12h) : examen
Mercredi 10 novembre 2004 3
Rappel
Mercredi 10 novembre 2004 4
Nouvelle vision (2002)
Motivation
Mercredi 10 novembre 2004 5
Plan du cours
● Généralités sur le Web Sémantique et applications
● Langages pour le Web Sémantique● XML● RDF et RDFS● OWL = DAML+OIL ?
● Web Services
Mercredi 10 novembre 2004 6
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 I3● Un article basique de Tim Berners-Lee (2001)● La vision d'Aaron Swartz (2002)● Perspectives : rapport EU-NSF (J. Euzénat, 2002)● Des tutoriaux, etc.
Attention aux droits d'auteur
Mercredi 10 novembre 2004 7
Le Web actuel
● Navigation à très bas niveau :● Clics sur des liens● Recherche de pages par mots clés● « c'est comme de la programmation en assembleur
avec des go-to »● Problèmes :
● Des millions de documents sont sur le Web !● Pertinence, précision, ... des recherches
Mercredi 10 novembre 2004 8
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 ?
Mercredi 10 novembre 2004 9
Solution niv. 1 : Wrapper
Mercredi 10 novembre 2004 10
Wrapper (suite)
● Automatisation de l'extraction de l'information et médiation
● Le médiator s'occupe de l'utilisateur et les wrappers des sources de données
● Les wrappers ont été adaptés aux données semi-structuré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)
Mercredi 10 novembre 2004 11
Solution niv. 2 : ajout de sémantique● XML : les balises indiquent 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
Mercredi 10 novembre 2004 12
Ajout de sémantique (suite)
● XML lie la structure et la sémantique dans les documents
● RDF permet d'ajouter de la sémantique sans aucun présupposé sur la structure du document :● Application XML● Ajout de méta-information aux documents Web
● RDFS : schéma de structuration des données
Mercredi 10 novembre 2004 13
Solution niv. 3 : les ontologies● Ontologies =
● Spécifications formelles et consensuelles de conceptualisations
● Compréhension commune et partagée d'un domaine
● Mais quid de la standardisation du vocabulaire ?
● Et quid de la standardisation de la structuration ?
Mercredi 10 novembre 2004 14
Applications
Mercredi 10 novembre 2004 15
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 fournis
● Les ontologies permettent des définitions structurelles et sémantiques des documents
● Recherche d'informations, échanges de documents, maintenance, ...
Mercredi 10 novembre 2004 16
B2C / recherche d'infos
● Parcours manuel des magasins en ligne● Wrappers : spécifiques à chaque magasins● Infos partielles (ex : frais de port)● Avec une structuration des informations :
agents intelligents pour aider au choix● Il faut que ces agents comprennent
l'information disponible
Mercredi 10 novembre 2004 17
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>
Mercredi 10 novembre 2004 18
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.
Mercredi 10 novembre 2004 19
Scénario● Clara, 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. Puis-je 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 rendez-vous à 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 ...
Mercredi 10 novembre 2004 20
Scénario (suite)● Besoins :
● Assistants performants● Connectivité sans fil● Échange de connaissances● Protocoles de négociation● Un grand nombre de données et de connaissances● Protection des données● Des modèles de confiance, de négociation, de
filtrage, ...
Mercredi 10 novembre 2004 21
Plan du cours
● Généralités sur le Web Sémantique et applications
● Langages pour le Web Sémantique● XML● RDF et RDFS● OWL = DAML+OIL ?
● Web Services
Mercredi 10 novembre 2004 22
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ésentation
● XML : structures arborescentes avec une syntaxe linéaire
● XML : extensible● XML : méta-langage
Mercredi 10 novembre 2004 23
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=.... ?> ...
Mercredi 10 novembre 2004 24
XML : rappels (suite)
● Un document XML est valide s'il est bien-formé 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, ...
● Espaces de noms● ...
Mercredi 10 novembre 2004 25
XML : espaces de noms● Un même document doit pouvoir utiliser
plusieurs vocabulaires de balisages :● Conception modulaire● Réutilisation● Mêmes noms (éléments, attributs) avec sens
différents dans vocabulaires indépendants● Lèver les ambiguïtés● Exemple :
● titre = M, Mme, Mlle● titre = « Les fleurs du mal »
Mercredi 10 novembre 2004 26
XML : espaces de noms - syntaxe
● <definitions name=...● xmlns:soap=''http://schemas.xmlsoap.org/wsdl/soap/''● ...>●
● <soap:body use=''quelque chose''>●
● </definitions>
Mercredi 10 novembre 2004 27
RDF : présentation
● Resource Description Framework● Permet la représentation de méta-donné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é objets
● Une syntaxe en XML ; mais pas la seule
Mercredi 10 novembre 2004 28
RDF : objectifs● The 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 well-established principles from various data representation communities. RDF properties may be thought of as attributes of resources and in this sense correspond to traditional attribute-value pairs. RDF properties also represent relationships between resources and an RDF model can therefore resemble an entity-relationship diagram. (More precisely, RDF Schemas - which are themselves instances of RDF data models - are ER diagrams.) In object-oriented design terminology, resources correspond to objects and properties correspond to instance variables.
Mercredi 10 novembre 2004 29
RDF : les 3 concepts 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.
Mercredi 10 novembre 2004 30
● 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 concepts de base
Mercredi 10 novembre 2004 31
RDF : exemple● Ora 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"
http://www.w3.org/Home/Lassila has creator Ora Lassila
Mercredi 10 novembre 2004 32
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]
Mercredi 10 novembre 2004 33
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.
Mercredi 10 novembre 2004 34
RDF : syntaxe de base
[1] RDF ::= ['<rdf:RDF>'] description* ['</rdf:RDF>'] [2] description ::= '<rdf:Description' idAboutAttr? '>'
propertyElt* '</rdf:Description>' [3] idAboutAttr ::= idAttr | aboutAttr [4] aboutAttr ::= 'about="' URI-reference '"' [5] idAttr ::= '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)
Mercredi 10 novembre 2004 35
RDF : exemple● Ora 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/22-rdf-syntax-ns#" xmlns:s="http://description.org/schema/"> <rdf:Description about="http://www.w3.org/Home/Lassila"> <s:Creator>Ora Lassila</s:Creator> </rdf:Description></rdf:RDF>
Mercredi 10 novembre 2004 36
RFD : exercice
● Écrivez dans cette syntaxe de base les deux exemples précédents :● Page 32● Page 33
Mercredi 10 novembre 2004 37
RDF : syntaxes
Des 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 '>'
Mercredi 10 novembre 2004 38
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.
Mercredi 10 novembre 2004 39
RDF 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
Mercredi 10 novembre 2004 40
RDF containers : exemple
The students in course 6.001 are Amy, Tim, John, Mary, and Sue
<rdf:RDF> <rdf:Description about="http://mycollege.edu/courses/6.001"> <s:students> <rdf:Bag> <rdf:li resource="http://mycollege.edu/students/Amy"/> <rdf:li resource="http://mycollege.edu/students/Tim"/> <rdf:li resource="http://mycollege.edu/students/John"/> <rdf:li resource="http://mycollege.edu/students/Mary"/> <rdf:li resource="http://mycollege.edu/students/Sue"/> </rdf:Bag> </s:students> </rdf:Description></rdf:RDF>
Mercredi 10 novembre 2004 41
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 about="http://x.org/packages/X11"> <s:DistributionSite> <rdf:Alt> <rdf:li resource="ftp://ftp.x.org"/> <rdf:li resource="ftp://ftp.cs.purdue.edu"/> <rdf:li resource="ftp://ftp.eu.net"/> </rdf:Alt> </s:DistributionSite> </rdf:Description></rdf:RDF>
Mercredi 10 novembre 2004 42
RDF : referents
● Ora est créatrice du « Bag », et pas des pages. La référence de la description est le container.
<rdf:Bag ID="pages"> <rdf:li resource="http://foo.org/foo.html" /> <rdf:li resource="http://bar.org/bar.html" /></rdf:Bag><rdf:Description about="#pages"> <s:Creator>Ora Lassila</s:Creator></rdf:Description>
Mercredi 10 novembre 2004 43
RDF : distributive referent● 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>
Équivalent à :
Mercredi 10 novembre 2004 44
RDF : container et motif URI● 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>
Équivalent à :
Mercredi 10 novembre 2004 45
RDF : container vs repeated prop.● Sue has written "Anthology of Time", "Zoological
Reasoning", "Gravitational Reflections".
Mercredi 10 novembre 2004 46
RDF : container vs repeated prop.● The committee of Fred, Wilma, and Dino approved the
resolution.
Mercredi 10 novembre 2004 47
RDF : statements about statements
Ralph Swick says that Ora Lassila is the creator of the resource http://www.w3.org/Home/Lassila.
Mercredi 10 novembre 2004 48
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 resource="http://www.w3.org/Home/Lassila" /> <rdf:predicate resource="http://description.org/schema/Creator" /> <rdf:object>Ora Lassila</rdf:object> <rdf:type resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement" /> <a:attributedTo>Ralph Swick</a:attributedTo> </rdf:Description></rdf:RDF>
Mercredi 10 novembre 2004 49
RDF : statements about statements
<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 '"'
Mercredi 10 novembre 2004 50
Mercredi 10 novembre 2004 51
<rdf:Description aboutEach="#D_001"> <a:attributedTo>Ralph Swick</a:attributedTo></rdf:Description>
Mercredi 10 novembre 2004 52
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 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>
Mercredi 10 novembre 2004 53
RDFS : pourquoi ?
● Besoin de créer des vocabulaires dans certains domaines
● Donc besoin d'un langage pour le faire● RDFS = RDF vocabulary description language● RDFS permet de créer des vocabulaires et de les
organiser dans des hiérarchies typées (classes, sous-classes, type, propriétés, sous-propriétés, domaines, intervalles, ...)
Mercredi 10 novembre 2004 54
RDFS
Mercredi 10 novembre 2004 55
RDFS
Mercredi 10 novembre 2004 56
RDFS : rdf:type
La propriété rdf:type entre rdfs:Resource et rdfs:Class s'écrit en RDF/XML :
<rdf:Description rdf:about="http://toto/Resource"><rdf:type rdf:resource="http://toto/Class">
</rdf:Description>
ou en abrégé :
<rdfs:Class rdf:about="http://toto/Resource"/>
Mercredi 10 novembre 2004 57
RDFS : exemple
Mercredi 10 novembre 2004 58
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#"><!-- Note: this RDF schema would typically be used in RDF instance data by referencing it with an XML namespace declaration, for example xmlns:xyz="http://www.w3.org/2000/03/example/vehicles#". This allows us to use abbreviations such as xyz:MotorVehicle to refer unambiguously to the RDF class 'MotorVehicle'. --><rdf:Description ID="MotorVehicle"> <rdf:type 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 ID="PassengerVehicle"> <rdf:type resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#MotorVehicle"/></rdf:Description><rdf:Description ID="Truck"> <rdf:type resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#MotorVehicle"/></rdf:Description><rdf:Description ID="Van"> <rdf:type resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#MotorVehicle"/></rdf:Description><rdf:Description ID="MiniVan"> <rdf:type resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#Van"/> <rdfs:subClassOf rdf:resource="#PassengerVehicle"/></rdf:Description></rdf:RDF>
Mercredi 10 novembre 2004 59
RFDS : autre exempleLa propriété a_pour_mari est une sous-proprié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 rfd:resource="#Mariés"/> </rdf:Property></rdf:RDF>
Mercredi 10 novembre 2004 60
Plan du cours
● Généralités sur le Web Sémantique et applications
● Langages pour le Web Sémantique● XML● RDF et RDFS● OWL = DAML+OIL ?
● Web Services
Mercredi 10 novembre 2004 61
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, IST-FP5)
Mercredi 10 novembre 2004 62
Exemple
For 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 ».
Mercredi 10 novembre 2004 63
Mercredi 10 novembre 2004 64
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.
Mercredi 10 novembre 2004 65
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.
Mercredi 10 novembre 2004 66
OWL
● XML 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.
Mercredi 10 novembre 2004 67
Sous-langages 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.
Mercredi 10 novembre 2004 68
Sous-langages d'OWL● OWL 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.
Mercredi 10 novembre 2004 69
OWL et RDF
OWL 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.
Mercredi 10 novembre 2004 70
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.
Mercredi 10 novembre 2004 71
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.
Mercredi 10 novembre 2004 72
OWL Lite : survol (1)
● Class : groupe d'individus, même propriétés● <owl:Class rdf:ID="Regions"/>
● rdfs:subClassOf● rdfs:Property ; rdfs:subPropertyOf● rdfs:domain ; rdfs:range● Individual : instances de classes
● <Regions rdf:ID="Rhone_Alpes"/>
Mercredi 10 novembre 2004 73
OWL Lite : survol (2)
● equivalentClass :● <owl:Class rdf:ID="Titi">
● <owl:equivalentClass rdf:resource="Toto"/>● </owl:Class>
● equivalentProperty ; sameAs ; differentFrom ; AllDifferent
● inverseOf ; TransitiveProperty ; SymmetricProperty ; FunctionnalProperty ; ...
● allValueFrom ; someValueFrom ; minCardinality ...
Mercredi 10 novembre 2004 74
OWL DL & Full : survol (1)
● 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 ...
Mercredi 10 novembre 2004 75
Plan du cours
● Généralités sur le Web Sémantique et applications
● Langages pour le Web Sémantique● XML● RDF et RDFS● OWL = DAML+OIL ?
● Web Services
Mercredi 10 novembre 2004 76
Web services
● Faire coopérer des applis sur le Web● Travaux sur :
● Protocoles de communications● Description des services et de leurs interactions● Sécurité et vie privée
● XMLP, SOAP, WSDL, .NET, J2EE, UDDI, OWL-S, ...
Mercredi 10 novembre 2004 77
Mercredi 10 novembre 2004 78
Web Services
Mercredi 10 novembre 2004 79
UDDI
● Universal Description Discovery & Integration● Annuaires de services (publics ou privés)● Contenu d'un enregistrement dans un annuaire
UDDI :● businessEntity : decription de celui qui publie● businessService : description d'une famille de services● bindingTemplate : infos techniques sur un service● tmodel : format des requêtes et des réponses, gestion
de la sécurité, protocoles, ...
Mercredi 10 novembre 2004 80
WSDL
● Web Services Language● 6 éléments majeurs :
● Types : definitions des types de données (xsd) ● Message : définition des données transmises● Operation : description d'une action (in, out, fault)● portType : ensemble d'opérations et messages● Binding : protocole et format de données (SOAP)● Port : binding + adresse réseau● Service : ensemble de Ports
Mercredi 10 novembre 2004 81
OWL-Service (OWL-S)
● OWL-based Web Service Ontology● Description 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, ...
Mercredi 10 novembre 2004 82
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 production
● SWRL = OWL + RuleML