590 likes | 764 Views
Semantics-based Web Service Discovery & Composition. Srividya Kona Advisor: Dr. Gopal Gupta Department of Computer Science The University of Texas at Dallas. Book my flight, car and hotel. Semantic Web. Vision of the Future Web. Requirements for the Semantic Web.
E N D
Semantics-based Web Service Discovery & Composition Srividya Kona Advisor: Dr. Gopal Gupta Department of Computer Science The University of Texas at Dallas
Book my flight, car and hotel Semantic Web Vision of the Future Web
Requirements for the Semantic Web • Machine-processable metadata for all Web pages (RDF, RDFS) • Ontologies (OWL) • Logical Inference Engines (Description Logic) • Semantic Web services (OWL-S, WSML) • Intelligent Agents (AI)
Outline • Web services & their current description language • Need for Semantic description of Web services • Universal Service-Semantics Description Language • Discovery and Composition Problems • Implementation of Discovery/Composition Engine • Bioinformatics Application
Example: CustomerName creates FlightNumber Reservation Flight Reservation Service StartDate ReservationCode StartCity DestinationCity Web service • Executable programs accessible over the web that effects some action or change in the world (i.e. causes some side-effect)
Web Documents Search Engines like Google Current Web Web services (Executable Programs Accessible over web) Web services (Executable Programs Accessible over web) We need Google for Services Web services (Executable Programs Accessible over web) Web services
Discovery Matching service found S1 Composed into requested service Composition S2 S3 Web service tasks Directory of registered services Web service Request We need description of Web services
Description of Web Services • Current description language: WSDL (Web Services Description Language) • Purely Syntactic in Nature • Provides no meanings • Provides no information about the service at a conceptual level
Limitations of these languages • Use domain-specific ontology • Semantic aliasing problem: distinct syntactic representations with distinct formal semantics yet equal conceptual semantics • Domain specific ontologies require a formal standardization process (slow) and is not always possible Other Languages • OWL-S, WSML, WSDL-S
Example WSDL Description <definitions> <PortType name="FlightReservation_Service"> <operation name="ReserveFlight"> <input message="ReserveFlight_Request"/> <output message="ReserveFlight_Response"/> </operation> </PortType> <message name="ReserveFlight_Request"> <part name="FlightNumber" type="xsd:string"/> <part name="CustomerName" type="xsd:string"/> <part name="StartDate" type="xsd:string"/> <part name="StartCity" type="xsd:string"/> <part name="DestinationCity" type="xsd:string"/> </message> <message name="ReserveFlight_Response"> <part name="ReservationCode" type="xsd:string"/> </message> </definitions>
Service Matching Problem WSDL for Query WSDL for Service <definitions> <PortType name="Service1"> … </PortType> <message name=“Service1_Request"> <part name=“Name" type="xsd:string"/> <part name=“StartDate" type="xsd:date"/> <part name=“EndDate" type="xsd:date"/> </message> </definitions> <definitions> <PortType name="Service2"> … </PortType> <message name=“Service2_Request"> <part name=“Name" type="xsd:string"/> <part name=“BeginDate" type="xsd:date"/> <part name=“EndDate" type="xsd:date"/> </message> </definitions> Services do not match Semantic description of Web Services
Problem We need a language to specify formal semantics of Web services Requirements: • Common representation of real-world concepts • Framework to model complex concepts Universal Service-Semantics Description Language (USDL)
Overview of USDL • Provides semantic descriptions of Web services • Provides a framework to model complex real-world concepts (using Propositional Logic) • Uses OWL Wordnet Ontology to provide a common representation of real-world concepts Representation of semantics of terms and their relationships Language used to build ontologies
OWL Wordnet Ontology • OWL ontology of real world concepts • Provides following relationships between words • synonym & antonym • hyponym & hypernym • meronym & holonym • …and many more
Overview of USDL • Semantic description of all input and output parameters (modeled as Concepts) • Semantic descriptions of the side-effects produced by the service • Semantic descriptions of the pre-conditions and post-conditions (i.e., any constraints/conditions that might be applicable on the input or output parameters) • Use existing WSDL constructs for easy adaptability
USDL in a Nutshell • Concept Class: - Generic class to model real-world concepts Concept Basic Concept Disjunctive Concept Qualified Concept Inverted Concept Conjunctive Concept Subclasses of Concept Class Example <QualifiedConcept rdf:about="#CustomerName"> <isA rdf:resource=“#Name"/> <ofKind rdf:resource=“#Customer"/> </QualifiedConcept> Example <BasicConcept rdf:about="#Customer"> <isA rdf:resource="&wn;customer"/> </BasicConcept>
Basic Concept • Actual contact point between USDL and WordNet. • Acts as a proxy for WordNet lexical entities. isA property WordNet Lexeme Basic Concept • Has exactly one defining value for isA property • Example: Basic Concept Reservation isA lexeme or word reservation in WordNet.
Qualified Concept • A concept classified by another lexical concept. Concept isA property Qualified Concept Concept ofKind property • Has exactly one defining value for isA property • Has at most one defining value for ofKind property • Example: Qualified Concept FlightNumber isAnumber ofKindflight.
USDL in a Nutshell Continued… Affects creates finds updates deletes Sub-property’s of Affects • Affects Property: - Side-effects can be described using one of the above sub-properties - Any other generic side-effects also can be described using the Concept class
USDL in a Nutshell Continued… • Conditions Class: - Generic class to describe service constraints Condition Atomic Condition Disjunctive Condition Conjunctive Condition Subclasses of Condition Class
Atomic Condition • Condition/Predicate: trait or aspect of the resource described. Concept greaterThan hasConcept property Atomic Condition C1 Concept OrderNumber onPart property hasValue property Concept 1000 • Has exactly one value for onPart property and at most one value for hasValue property. • Example constraint C1: OrderNumbergreaterThan1000
Conjunctive and Disjunctive Conditions • Conjunctive condition denotes the conjunction of USDL conditions. • Disjunctive condition denotes the disjunction of USDL conditions. • Any n-ary condition can be written as a combination of conjunctions and disjunctions of binary conditions.
Class PortType • PortType is USDL surrogate for WSDL portType. • PortType is a collection of procedures or operations that are parametric on messages. • Has zero or more Operations as values of hasOperation property. • Example: PortType of a FlightReservationService. <PortType rdf:about="#FlightReservation_Service"> <hasOperation rdf:resource="#ReserveFlight" /> </PortType>
Class Operation • Operation class defines the side-effect of the service via affects property. • Also defines the input and output messages via hasInput and hasOutput properties. • Example: Operation of FlightReservationService. <Operation rdf:about="#ReserveFlight"> <hasInput rdf:resource="#ReserveFlight_Request"/> <hasOutput rdf:resource="#ReserveFlight_Response"/> <creates rdf:resource="#ReservationReceipt" /> </Operation>
Class Message • Message class is USDL surrogate for WSDL message. • Message is a composite entity with zero or more parts. • Example: Consider a FlightReservationService. • Message class looks as follows: <Message rdf:about="#ReserveFlight_Request"> <hasPart rdf:resource="#CustomerName" /> <hasPart rdf:resource="#FlightNumber" /> … </Message> <Message rdf:about="#ReserveFlight_Response"> <hasPart rdf:resource="#ReservationCode"/> </Message>
Concepts Affect Condition Flight reservation service • Takes inputs CustomerName StartDate DestinationCity • Creates a FlightReservation • Outputs ReservationCode • Input DestinationCity has the constraint AirportExists
WSDL Description USDL Description <definitions> <PortType name="FlightReservation_Service"> <operation name="ReserveFlight"> <input message="ReserveFlight_Request"/> <output message="ReserveFlight_Response"/> </operation> </PortType> <message name="ReserveFlight_Request"> <part name="FlightNumber" type="xsd:string"/> <part name="CustomerName" type="xsd:string"/> <part name="StartDate" type="xsd:string"/> <part name="StartCity" type="xsd:string"/> <part name="DestinationCity" type="xsd:string"/> … </message> <message name="ReserveFlight_Response"> <part name="ReservationCode" type="xsd:string"/> </message> ... </definitions> <definitions> <PortType rdf:about="#FlightReservation_Service"> <hasOperation rdf:resource="#ReserveFlight" /> </PortType> <Operation rdf:about="#ReserveFlight "> <hasInput rdf:resource="#ReserveFlight_Request"/> <hasOutput rdf:resource="#ReserveFlight _Response"/> <creates rdf:resource="#FlightReservation" /> </Operation> <Message rdf:about="#ReserveFlight _Request"> <hasPart rdf:resource="#FlightNumber" /> <hasPart rdf:resource="#CustomerName" /> <hasPart rdf:resource="#StartDate" /> <hasPart rdf:resource="#StartCity" /> <hasPart rdf:resource="#DestinationCity" /> </Message> <Message rdf:about="#ReserveFlight _Response"> <hasPart rdf:resource="#ReservationCode"/> </Message> <QualifiedConcept rdf:about="#FlightNumber"> <isA rdf:resource="#Number"/> <ofKind rdf:resource="#Flight" /> </QualifiedConcept > … continued on next slide
WSDL Description USDL Description Cont… <definitions> <PortType name="FlightReservation_Service"> <operation name="ReserveFlight"> <input message="ReserveFlight_Request"/> <output message="ReserveFlight_Response"/> </operation> </PortType> <message name="ReserveFlight_Request"> <part name="FlightNumber" type="xsd:string"/> <part name="CustomerName" type="xsd:string"/> <part name="StartDate" type="xsd:string"/> <part name="StartCity" type="xsd:string"/> <part name="DestinationCity" type="xsd:string"/> … </message> <message name="ReserveFlight_Response"> <part name="ReservationCode" type="xsd:string"/> </message> ... </definitions> <BasicConcept rdf:about="#Flight"> <isA rdf:resource="&wn;flight"/> </BasicConcept> <BasicConcept rdf:about="#Number"> <isA rdf:resource="&wn;number"/> </BasicConcept> <QualifiedConcept rdf:about="#CustomerName"> <isA rdf:resource="#Name"/> <ofKind rdf:resource="#Customer" /> </QualifiedConcept> <QualifiedConcept rdf:about="#DestinationCity"> <isA rdf:resource="#City"/> <ofKind rdf:resource="#Destination" /> <hasCondition rdf:resource="#AirportExists" /> </QualifiedConcept> <Condition rdf:about="#AirportExists"> <hasConcept rdf:resource="#exists"/> <onPart rdf:resource="#DestinationCity"/> </Condition> <BasicConcept rdf:about="#exists"> <isA rdf:resource="&wn;exists"/> </BasicConcept>
<BasicConcept rdf:about="#Start"> <isA rdf:resource="&wn;start"/> </BasicConcept> <BasicConcept rdf:about="#Begin"> <isA rdf:resource="&wn;begin"/> </BasicConcept> <BasicConcept rdf:about="#Date"> <isA rdf:resource="&wn;date"/> </BasicConcept> <BasicConcept rdf:about="#Date"> <isA rdf:resource="&wn;date"/> </BasicConcept> WordNet <wn:glossaryEntry> Time stated in terms of day, month, & year </wn:glossaryEntry> <wn:glossaryEntry> To take the first step in performing an action </wn:glossaryEntry> Service Matching Problem Revisited USDL for Query USDL for Service … <QualifiedConcept rdf:about="#StartDate"> <isA rdf:resource="#Date"/> <ofKind rdf:resource="#Start" /> </QualifiedConcept> … … <QualifiedConcept rdf:about="#BeginDate"> <isA rdf:resource="#Date"/> <ofKind rdf:resource="#Begin" /> </QualifiedConcept> …
Service Matching Problem Revisited USDL for Query USDL for Service … <QualifiedConcept rdf:about="#StartDate"> <isA rdf:resource="#Date"/> <ofKind rdf:resource="#Start" /> </QualifiedConcept> <BasicConcept rdf:about="#Start"> <isA rdf:resource="&wn;start"/> </BasicConcept> <BasicConcept rdf:about="#Date"> <isA rdf:resource="&wn;date"/> </BasicConcept> … … <QualifiedConcept rdf:about="#BeginDate"> <isA rdf:resource="#Date"/> <ofKind rdf:resource="#Begin" /> </QualifiedConcept> <BasicConcept rdf:about="#Begin"> <isA rdf:resource="&wn;begin"/> </BasicConcept> <BasicConcept rdf:about="#Date"> <isA rdf:resource="&wn;date"/> </BasicConcept> … Services match
Discovery of Web services Composition of Web services Google for Services Applications of USDL Semantic Descriptions of Web services (USDL)
Discovery and Composition • Discovery Problem: Given a repository of Web services, and a query with requirements of the requested service, finding a service from the repository that matches these requirements. • Composition Problem: Given a repository of Web services, and a query with requirements of the requested service, finding a set of services that can be put together in correct order of execution to obtain the desired service. One Problem
Domain-specific/ OWL Wordnet Ontology Repository USDL Files Tuple Generator Semantic Relations Generator Discovery/Composition Query Processor Output Generator Output File High Level Design of Composition Engine Discovery/ Composition Query file
Service Directory with USDL descriptions S1 Query described using USDL Converts to terms of logic Converts to terms of logic S2 . . . Discovery Engine (implemented using Prolog) Sn List of Substitutable Services Extended unification mechanism is used to compare the terms. Service Discovery USDL Description of a service Converted to terms of logic (Pre-conditions, Inputs, Outputs, Affect(affectedObject), Post-conditions)
Service Discovery (Contd.) • CI′=> CI, I′ subsumes I • CO => CO′, O subsumes O′
Service Discovery – Formal Definition • Definition (Service): A service is a 6-tuple of its pre-conditions, inputs, side-effect, affected object, outputs and post-conditions S = (CI, I, A, AO, O, CO) • Definition (Query): Query service is defined as Q = (CI′, I′, A′, AO′, O′, CO′) • Definition (Discovery): Given a repository R and a query Q, the Discovery problem can be defined as automatically finding a set S of services from R such that S = {s | s = (CI, I, A, AO, O, CO), s ЄR, CI′CI, I subsumed by I′, A = A', AO = AO', COCO', O subsumes O'}.
Service Composition If the discovery engine fails to find the requested service … Query described using USDL (S) S1 Discovery Module (Discovery Engine + Service Directory + Term Convertor) Infer sub-queries . . . Sn . . . . S1 Sn Composed Service Composition Engine (implemented using Prolog) Pre-Cond(S) Post-Cond(S1) Post-Cond(Sn) Sn S1 S2 Pre-Cond(S1) Pre-Cond(S2) Post-Cond(S)
Sequential Composition - Example • Simple Travel Reservation Service • Composed of: • ReserveFlight • ReserveHotel • ReserveCar
Service Composition - Sequential • CI′=> CI1, I′ subsumes I1 • COn => CO′, On subsumes O′
Non-Sequential Composition - Example • Find a service to buy a book Post-conditions of service GetAvailability should logically imply the pre-conditions of service PurchaseBook
Representation of Composite Service • Composite service as an Directed Acyclic graph Directed arc between nodes Siand Sj indicates that outputs of Siconstitute (some of) the inputs of Sj
Service Composition – Formal Definition • Definition (Composition): Composition can be defined as automatically finding a directed acyclic graph G = (V, E) of services from repository R, given query Q = (CI', I', A', AO', O', CO'), where V is the set of vertices and E is the set of edges of the graph. The following conditions should hold on the nodes of the graph: • for all i,SiЄV where Si has exactly one incoming edge that represents the query inputs and pre-conditions, I′subsumes Ui Ii, CI'ΛiCIi. • for all i, SiЄV where Si has exactly one outgoing edge that represents the query outputs and post-conditions, O' subsumed by Ui Oi, CO'ΛiCOi. • for all i, SiЄV where Si has at least one incoming edge, let Si1, Si2, ..., Sim be the nodes such that there is a directed edge from each of these nodes to Si. Then Iisubsumed by UkOik U I', CIi (COi1ΛCOi2 ... Λ COim Λ CI').
Non-Sequential Conditional Composition Example ConfirmHotel ConfirmFlight ReserveFlight YES ReserveCar Visa Approved ? Query Inputs ProcessVisa Query-Outputs ReserveHotel NO CancelFlight CancelHotel SERVICE TO MAKE INTERNATIONAL TRAVEL ARRANGEMENTS
Composition Engine - Requirements • Correctness • Small Query Execution Time • Ability to perform Incremental Updates • Ability to apply cost functions
Multi-Step Narrowing Solution • Filtering technique: In the first pass, narrows down the set of composable services for each stage of composition In the second pass, removes the redundant services which do not directly or indirectly contribute to the query outputs
Discovery/Composition Algorithm Algorithm: Composition Input: QI - QueryInputs, QO - QueryOutputs, QCI - Pre-Cond, QCO - Post-Cond Output: Result - ListOfServices 1. L NarrowServiceList(QI, QCI); 2. O GetAllOutputParameters(L); 3. CO GetAllPostConditions(L); 4. While Not (O subsumes QO) 5. I = QI υ O; CI QCI Λ CO; 6. L' NarrowServiceList(I, CI); 7. End While; 8. ServicesSet RemoveRedundantServices(QO, QCO); 9. Result GenerateSolutions (ServicesSet ) 10. Return Result;
Implementation • Prototype Implementation has following components: • Query Reader • Tuple Generator • Semantic Relations Generator • Composition Engine • Output Generator • Semantic descriptions of services are written using the language USDL • The semantic relations are provided by OWL Wordnet Ontology • Composition Engine is implemented in Prolog with Constraint Logic Programming over finite domain
Constraint Logic Programming • Used Constraint Logic Programming over finite domains CLP(FD) • Built in Predicates to support Searching and Indexing (e.g. setOf, bagOf, etc.) • Standard set operations are provided • Built in search techniques (Branch & Bound) to minimize/ maximize over certain property (e.g. to find results with min. sequence length in composition)
Constraint Logic Programming • Allows Incremental Updates thus making our system scalable • Discover & Compose based on costs – can search for optimal solutions and rank them • Can be extended for more complicated semantic relations • Pre-processing of the repository helped significantly in gaining execution efficiency