W3C logo
slanted W3C logo

Cover page images (keys)

Web サービスに求められる新たな技術

スライド:http://www.w3.org/2005/Talks/1122-orf-ws/

佐々木 フェリクス, <fsasaki@w3.org>

本発表のテーマ

「Web サービス」とは何か

インターネット上で、ソフトウェアの機能を利用する仕組み:

Web サービスの概要

Web Service Overview

Web サービスの標準

Web Service Overview

Discovery について

Web Service Overview

Discovery の手段:

WSDL: Web Service Definition Language

Web Service Overview

SOAPのメッセージのパターンを定義する:

Request

Web Service Overview

Request の段階:

Response

Web Service Overview

Response の段階:

Web サービスの国際化

「国際化」とは何か

ローカリゼーション「Localization」

ロケールと言語の違い

違いの一例:

<p xml:lang="en">The quick brown fox jumps over the lazy dog.</p>
<p xml:lang="en-GB">What colour is it?</p>
<p xml:lang="en-US">What color is it?</p>

RFC 3066

en-US
en-GB

WSDL におけるロケール

現在ではロケールを送信する手段がない

SOAP におけるロケール

Accept-Language: zh-cn, fr-ch;q=0.8, fr;q=0.7

Faults、エラー、自然言語のテキスト

ロケールの依存性のないデーター

ロケールとの関係はデーターの種類による

    データー          例
    ---------------- ---------------------------
    date            : 2003-05-31
    time            : 13:20:00
    dateTime        : 2003-05-31T13:20:00+09:00
    double          : 1267.43233E12
    integer         : 2678967543233
    データー          例
    ---------------- ---------------------------
    duration        : P1Y2M3D
    gYearMonth      : 2003-05
    gYear           : 2003
    gMonthDay       : 05-25
    gDay            : 25
    gMonth          : 05

Web サービスの国際化を実現する課題

WSDLの国際化

WSDL の国際化の一例

<definitions targetNamespace="http://example.com/example"
     xmlns:ns1="http://example.com/example">
  <interface name="ns1:Thing">
    <!-- All implementations of this interface must be locale-aware -->
    <feature uri="http://www.w3.org/2005/09/ws-i18n"
             required="true"/>
    <operation name="someOperation">
      <!-- This operation uses the $user policy -->
      <property uri="http://www.w3.org/2005/09/ws-i18n"
               required="true">
         <constraint xmlns:locale="http://www.w3.org/2005/09/ws-i18n">
            locale:$user
         </constraint>
      </property>
      ...
    </operation>
      ...
    <operation name="anotherOperation">
      <!-- This operation uses a specific locale -->
      <property uri="http://www.example.com/International/ws/i18n"
               required="true">
         <value>fr-FR</value> <!-- French for France Locale -->
      </property>
      ...
    </operation>
  </interface>
</definitions>

SOAP の国際化

SOAP :international の要素「element」

<i18n:international>
  <i18n:locale>en-US</i18n:locale>
  <i18n:preferences>
    <ldml:collation>
      <ldml:alias source="de_DE" type="phonebook"/>
    </ldml:collation>
  </i18n:preferences>
</i18n:international>

SOAP :timezone の要素

<tz>GMT-0300</tz>
<tz>America/Los_Angeles</tz>

SOAP :preferences の要素

<i18n:preferences>
   <ldml:measurementSystem type="metric" />
</i18n:preferences>
<i18n:preferences>
   <ldml:alias source="de_DE" />
</i18n:preferences>

セマンティック Web サービス

現在のWeb サービスの問題点「意味定義」ができない:

セマンティック Web サービスの目的

Web サービスの「意味」を定義できる標準

現在議論されるセマンティック Web サービスの提案

Web Services Modeling Ontology (WSMO)

WSMOが提供する意味の要素:

WSMO: オントロジー「Ontology」のヘッダ「Header」

namespace {_"http://example.org/tripReservationOntology#",
  dc     _"http://purl.org/dc/elements/1.1#", 
  loc    _"http://example.org/locationOntology#",
  po     _"http://example.org/purchaseOntology#",
  foaf   _"http://xmlns.com/foaf/0.1/",
  wsml   _"http://www.wsmo.org/wsml/wsml-syntax#",
  prs    _"http://example.org/owlPersonMediator#"}
ontology  _"http://example.org/tripReservationOntology"
  nonFunctionalProperties
    dc#title hasValue "Trip Reservation Ontology"
    dc#identifier hasValue _"http://example.org/tripReservationOntology"
    dc#creator hasValue _"http://example.org/foaf#deri"
    dc#description hasValue 
       "an ontology for describing trip reservations related knowledge"
    dc#publisher hasValue _"http://example.org/foaf#deri"   
    dc#contributor hasValue  _"http://example.org/foaf#cristina"
    dc#date hasValue _date(2004,12,16)
    dc#format hasValue "text/x-wsml"
    dc#language hasValue "en-us"
    dc#rights hasValue _"http://deri.at/privacy.html"
    wsml#version hasValue "$Revision 1.17 $"
  endNonFunctionalProperties
  importsOntology  { _"http://example.org/locationOntology",
                   _"http://example.org/purchaseOntology"}
  usesMediator _"http://example.org/owlPersonMediator"

WSMO: Concept Definitions(概念の定義)

concept trip
    origin impliesType loc#location
    destination impliesType loc#location
    departure ofType _date
    arrival ofType _date
  concept tripFromAustria subConceptOf trip
    nonFunctionalProperties
       dc#relation hasValue tripFromAustriaDef
    endNonFunctionalProperties
  axiom tripFromAustriaDef
    definedBy
         forall {?x ,?origin}
                (?x memberOf tripFromAustria 
                  implies
                  ?x[
                      origin hasValue ?origin] and 
                  ?origin[
                      loc#locatedIn hasValue loc#austria]
                ).
  concept ticket 
    provider ofType _string
    trip ofType trip
    recordLocatorNumber ofType _integer  
  concept reservationRequest
    nonFunctionalProperties
      dc#description hasValue "This concept represents a 
      reservation request for some trip for a particular person"
    endNonFunctionalProperties
    reservationItem impliesType wsml#true
    reservationHolder impliesType prs#person
  concept reservation
    nonFunctionalProperties
       dc#description hasValue "concept of a confirmation for some item"
    endNonFunctionalProperties
    reservationItem impliesType wsml#true
    reservationHolder impliesType prs#person

WSMO: Relations(概念関係)

namespace { _"http://example.org/purchaseOntology#",
   dc              _"http://purl.org/dc/elements/1.1",
   wsml            _"http://www.wsmo.org/wsml/wsml-syntax#",
   prs             _"http://example.org/owlPersonMediator.wsml#"}
ontology  _"http://example.org/purchaseOntology"
concept creditCard
    owner impliesType prs#person
    number ofType _integer
    type ofType _string
    expiryDate ofType _date
    balance ofType _integer
relation validCreditCard(ofType creditCard)
  nonFunctionalProperties
      dc#description hasValue "Relation that holds for a valid credit card"
      dc#relation hasValue ValidCreditCardDef
  endNonFunctionalProperties
axiom ValidCreditCardDef
definedBy
   forall {?x, ?y}  ( 
         validCreditCard(?x)  impliedBy  
         ?x[expiryDate hasValue ?y] memberOf creditCard 
         and 
         neg (wsml#dateLessThan(?y, wsml#currentDate()))).

WSMO: Instances(個体、インスタンス)

instance tripInnVen memberOf trip
   origin hasValue loc#innsbruck
   destination hasValue loc#venice
   departure hasValue  _date(2005,11,22)
   arrival hasValue  _date(2005,11,22)
instance ticketInnVen memberOf ticket
   provider hasValue "Book Ticket Service"
   trip hasValue tripInnVen
   recordLocatorNumber hasValue 93
relationInstance ticketPrice(ticketInnVen, po#euro, 120)

Semantic Web Services Framework (SWSF)

WSMO と SWSFの比較:

SWSL の一例

travel(?Destination, ?Account)	{
	IfThenElse
	if greater(budget_balance(?Account),1000) then
	   occurrence ?occ1 book_deluxe(?Destination)
	if greater(1001,budget_balance(?Account)) then
	   occurrence ?occ2 book_economy(?Destination)
}

SWSL: サービスの記述

prefix xsd = "http://www.w3.org/2001/XMLSchema".
 Service[
  name        *=> xsd#string,
  author       *=> xsd#string,
  contactInformation *=> xsd#string,
  contributor    *=> xsd#string,
  description    *=> xsd#string,
  url        *=> xsd#string,
  identifier     *=> xsd#string,
  version      *=> xsd#string,
  releaseDate    *=> xsd#date,
  language      *=> xsd#string,
  subject      *=> xsd#string,
  trust       *=> xsd#string,
  reliability    *=> xsd#string,
  cost        *=> xsd#string
].

SWSL Use Case(ユースケース): Book Sales Service

Book Sales Service

SWSL Example: Geographical Ontology

USA::America.
    Germany::Europe.
    Austria::Europe.
    France::Europe.
    Tyrol::Austria.
    NewYorkState::USA.
    StonyBrook:NewYorkState.
    NewYork:NewYorkState.
    Innsbruck:Tyrol.
    Lienz:Tyrol.
    Vienna:Austria.
    Bonn:Germany.
    Frankfurt:Germany.
    Paris:France.
    Nancy:France.
    Europe:Region.
    America:Region.
    ?Reg:Region :- ?Reg1:Region and ?Reg::?Reg1.
    ?Loc:Location :- ?Reg:Region and ?Loc:?Reg.

SWSL: オントロジーによる問い合わせ

searchTrip(?From,?To):TravelSearchQuery :- 
                  ?From:(Region or Location) and ?To:(Region or Location).
    searchCitipass(?Loc):TravelSearchQuery :- ?Loc:(Region or Location).

SWSL: Domain Specific Ontologies

// Service input
  search(?requestId,?fromLocation,?toLocation):ProcessInput :-
		   ?requestId:Request and
                   ?fromLocation:Location and ?toLocation:Location.
  search(?requestId,?city):ProcessInput  :-
		   ?requestId:Request and ?city:Location.
  // Service output
  ItineraryInfo::ServiceOutput.
  PassInfo::ServiceOutput.
  ItineraryInfo[from*=>Location, to*=>Location].
  PassInfo[city*=>Location].
  itinerary(?reqNumber):ItineraryInfo :- ?reqNumber:Request.
  pass(?reqNumber):PassInfo :- ?reqNumber:Request.

WSMO と SWSFの比較