• Nenhum resultado encontrado

2.2 Service-Oriented Computing

2.2.2 Semantic Web Service

determine whether the content in the message represent a request for a receipt or a room quotation. In addition, the so far processes such as service discovery and service composition are done manually which might be error prone and time consuming. The semantic approach for web services is given in the next section, overcome some of these above mentioned problems.

2.0 [CMRW07]. Two WSDL documents can have similar descriptions while meaning totally different things, or they can have very different descriptions yet similar meaning. Therefore, SAWDL provides mechanisms by which concepts from the semantic models that are defined either in between or outside the WSDL document can be referenced from within WSDL components as annotations.

These semantics when expressed in formal languages can help disambiguate the description of web services during the automated discovery and composition of the web services [FL07].

Consider the Listing 2.2 fragment code modified from the previous Weather- ForecastRequest WSDL example (introduced in Listing 2.1). This service offers the requesters to get the weather forecast for a given date and city (see Figure 2.3, Page 24). To realize a semantic annotation for WSDL, the service provides an annotation sawdl:modelReference of a semantic model named SampleOntology points to the matching attributes defined in WSDL. For example, element named date refers to the vocabulary date (line 13), element named cityName refers to the vocabulary city (line 15) and element named WeatherForecastInfo refers to the vocabulary weather (line 21). Thus if the service request WSDL is annotated using the same semantic model, a semantic engine could use this information to match the two web services. Without the semantic annotations, the matching engine may not have sufficient information to identify them as related terms unless explicitly specified.

1 < w s d l : d e s c r i p t i o n

2 t a r g e t N a m e s p a c e =" h t t p :// e x a m p l e . com / w s d l / w e a t h e r f o r e c a s t R e q u e s t S e v i c e /"

3 x m l n s =" h t t p :// e x a m p l e . com / w s d l / w e a t h e r f o r e c a s t R e q u e s t S e v i c e /"

4 x m l n s : w s d l =" h t t p :// www . w3 . org / ns / w s d l "

5 x m l n s : xsd =" h t t p :// www . w3 . org / 2 0 0 1 / X M L S c h e m a "

6 x m l n s : s a w s d l =" h t t p :// www . w3 . org / ns / s a w s d l " >

7

8 < w s d l : types >

9 < xsd : s c h e m a t a r g e t N a m e s p a c e =" h t t p :// e x a m p l e . com / w s d l / w e a t h e r f o r e c a s t R e q u e s t S e v i c e " >

10 < xsd : e l e m e n t n a m e =" W e a t h e r R e q u e s t " >

11 < xsd : c o m p l e x T y p e >

12 < xsd : e l e m e n t n a m e =" d a t e " t y p e =" xsd : d a t e "

13 s a w s d l : m o d e l R e f e r e n c e =" h t t p :// e x a m p l e . com / o n t o l o g i e s / S a m p l e O n t o l o g y # d a t e "/ >

14 < xsd : e l e m e n t n a m e =" c i t y N a m e " t y p e =" xsd : s t r i n g "

15 s a w s d l : m o d e l R e f e r e n c e =" h t t p :// e x a m p l e . com / o n t o l o g i e s / S a m p l e O n t o l o g y # c i t y "/ >

16 </ xsd : c o m p l e x T y p e >

17 </ xsd : element >

18 < xsd : e l e m e n t n a m e =" W e a t h e r F o r e c a s t " >

19 < xsd : c o m p l e x T y p e >

20 < xsd : e l e m e n t n a m e =" W e a t h e r F o r e c a s t I n f o " t y p e =" xsd : s t r i n g "

21 s a w s d l : m o d e l R e f e r e n c e =" h t t p :// e x a m p l e . com / o n t o l o g i e s / S a m p l e O n t o l o g y # w e a t h e r "/ >

22 </ xsd : c o m p l e x T y p e >

23 </ xsd : element >

24 </ xsd : schema >

25 </ w s d l : types >

26

27 < w s d l : i n t e r f a c e n a m e =" W e a t h e r F o r e c a s t R e q u e s t S e r v i c e " >

28 < w s d l : o p e r a t i o n n a m e =" W e a t h e r F o r e c a s t R e q u e s t O p e r a t i o n "

29 p a t t e r n =" h t t p :// www . w3 . org / ns / w s d l / in - out " >

30 < w s d l : i n p u t e l e m e n t =" W e a t h e r F o r e c a s t e R e q u e s t S e r v i c e R e q u e s t "/ >

31 < w s d l : o u t p u t e l e m e n t =" W e a t h e r F o r e c a s t R e q u e s t S e r v i c e R e s p o n s e "/ >

32 </ w s d l : o p e r a t i o n >

33 </ w s d l : i n t e r f a c e >

34 35

36 </ w s d l : d e s c r i p t i o n >

Listing 2.2: WeatherForecastRequest SAWSDL Service

OWL-S is an OWL based ontology for describing Semantic Web Services. It will enable users and software agents to automatically discover, invoke, compose and monitor web resources offering services under specified constraints [MBH+04]. To facilitate the OWL-S capacities above mentioned, OWL-S organizes the service structure into three parts which are service profile, process model and service grounding. To give more details of OWL-S structure, the same WeatherForcas- tRequest service, but formatted in OWL-S form is illustrated in Listing 2.3. The service profile part (line 26-39) is used to describe what the service does, which includes the information such as the service name and description, quality of service, publisher and contact information. Theprocesspart (line 40-56) describes the process type and its elements (a set of inputs, outputs, preconditions, effects of the service execution) inside the process. In the example code, the WeatherForcastRequest service defines its process type as AtomicProcess that is binded to a single operation GetWeatherForecastPrice. Furthermore, OWL-S services offer two more process types to support complex business processes. The former (called CompositeProcess) is a process that requires multiple actions from other process, in which directed by one of control constructs such as sequence, iterate, choice and if-then-else. The latter (calledSimpleProcess) is a process that provides an abstraction mechanism that offers multiple views of the same process [MBH+04]. Finally, the service grounding (line 65-113) specifies the interaction information with the service such as communication protocols, message formats and port number.

1 <? xml v e r s i o n = " 1 . 0 " e n c o d i n g =" WINDOWS - 1 2 5 2 " ? >

2 < rdf : RDF x m l n s : owl = " h t t p :// www . w3 . org / 2 0 0 2 / 0 7 / owl #"

3 x m l n s : r d f s = " h t t p :// www . w3 . org / 2 0 0 0 / 0 1 / rdf - s c h e m a #"

4 x m l n s : rdf = " h t t p :// www . w3 . org / 1 9 9 9 / 0 2 / 2 2 - rdf - syntax - ns #"

5 x m l n s : s e r v i c e = " h t t p :// www . d a m l . org / s e r v i c e s / owl - s / 1 . 1 / S e r v i c e . owl #"

6 x m l n s : p r o c e s s = " h t t p :// www . d a m l . org / s e r v i c e s / owl - s / 1 . 1 / P r o c e s s . owl #"

7 x m l n s : p r o f i l e = " h t t p :// www . d a m l . org / s e r v i c e s / owl - s / 1 . 1 / P r o f i l e . owl #"

8 x m l n s : g r o u n d i n g = " h t t p :// www . d a m l . org / s e r v i c e s / owl - s / 1 . 1 / G r o u n d i n g . owl #"

9

10 xml : b a s e = " h t t p : / / 1 2 7 . 0 . 0 . 1 / s e r v i c e s / 1 . 1 / w e a t h e r _ f o r e c a s t _ s e r v i c e . o w l s " >

11

12 < owl : O n t o l o g y rdf : a b o u t ="" >

13 < owl : i m p o r t s rdf : r e s o u r c e =" h t t p : / / 1 2 7 . 0 . 0 . 1 / o n t o l o g y / S e r v i c e . owl " / >

14 < owl : i m p o r t s rdf : r e s o u r c e =" h t t p : / / 1 2 7 . 0 . 0 . 1 / o n t o l o g y / P r o c e s s . owl " / >

15 < owl : i m p o r t s rdf : r e s o u r c e =" h t t p : / / 1 2 7 . 0 . 0 . 1 / o n t o l o g y / P r o f i l e . owl " / >

16 < owl : i m p o r t s rdf : r e s o u r c e =" h t t p : / / 1 2 7 . 0 . 0 . 1 / o n t o l o g y / G r o u n d i n g . owl " / >

17 < owl : i m p o r t s rdf : r e s o u r c e =" h t t p : / / 1 2 7 . 0 . 0 . 1 / o n t o l o g y / w e a t h e r . owl " / >

18 </ owl : O n t o l o g y >

19

20 < s e r v i c e : S e r v i c e rdf : ID =" W E A T H E R _ F O R E C A S T _ S E R V I C E " >

21 < s e r v i c e : p r e s e n t s rdf : r e s o u r c e ="# W E A T H E R _ F O R E C A S T _ P R O F I L E "/ >

22 < s e r v i c e : d e s c r i b e d B y rdf : r e s o u r c e ="# W E A T H E R _ F O R E C A S T _ P R O C E S S "/ >

23 < s e r v i c e : s u p p o r t s rdf : r e s o u r c e ="# W E A T H E R _ F O R E C A S T _ G R O U N D I N G "/ >

24 </ s e r v i c e : Service >

25

26 < p r o f i l e : P r o f i l e rdf : ID =" W E A T H E R _ F O R E C A S T _ P R O F I L E " >

27 < s e r v i c e : i s P r e s e n t e d B y rdf : r e s o u r c e ="# W E A T H E R _ F O R E C A S T _ S E R V I C E "/ >

28 < p r o f i l e : s e r v i c e N a m e xml : l a n g =" en " >

29 W E A T H E R _ F O R E C A S T S e r v i c e

30 </ p r o f i l e : s e r v i c e N a m e >

31 < p r o f i l e : t e x t D e s c r i p t i o n xml : l a n g =" en " >

32 T h i s s e r v i c e r e t u r n s the i n f o r m a t i o n of w e a t h e r f o r e c a s t g i v e n by d a t e and c i t y n a m e . 33 </ p r o f i l e : t e x t D e s c r i p t i o n >

34 < p r o f i l e : h a s I n p u t rdf : r e s o u r c e ="# _ D A T E "/ >

35 < p r o f i l e : h a s I n p u t rdf : r e s o u r c e ="# _ C I T Y "/ >

36 < p r o f i l e : h a s O u t p u t rdf : r e s o u r c e ="# _ W E A T H E R I N F O "/ >

37

38 < p r o f i l e : h a s _ p r o c e s s rdf : r e s o u r c e =" W E A T H E R _ F O R E C A S T _ P R O C E S S " / >

39 </ p r o f i l e : Profile >

40

41 < p r o c e s s : A t o m i c P r o c e s s rdf : ID =" W E A T H E R _ F O R E C A S T _ P R O C E S S " >

42 < s e r v i c e : d e s c r i b e s rdf : r e s o u r c e ="# W E A T H E R _ F O R E C A S T _ S E R V I C E "/ >

43 < p r o f i l e : h a s I n p u t rdf : r e s o u r c e ="# _ D A T E "/ >

44 < p r o f i l e : h a s I n p u t rdf : r e s o u r c e ="# _ C I T Y "/ >

45 < p r o f i l e : h a s O u t p u t rdf : r e s o u r c e ="# _ W E A T H E R I N F O "/ >

46 </ p r o c e s s : A t o m i c P r o c e s s >

47

48 < p r o c e s s : I n p u t rdf : ID =" _ D A T E " >

49 < p r o c e s s : p a r a m e t e r T y p e rdf : d a t a t y p e =" h t t p :// www . w3 . org / 2 0 0 1 / X M L S c h e m a # a n y U R I " >

50 h t t p : / / 1 2 7 . 0 . 0 . 1 / o n t o l o g y / w e a t h e r . owl # date </ p r o c e s s : p a r a m e t e r T y p e >

51 < r d f s : label > </ r d f s : label >

52 </ p r o c e s s : Input >

53 < p r o c e s s : I n p u t rdf : ID =" _ C I T Y " >

54 < p r o c e s s : p a r a m e t e r T y p e rdf : d a t a t y p e =" h t t p :// www . w3 . org / 2 0 0 1 / X M L S c h e m a # a n y U R I " >

55 h t t p : / / 1 2 7 . 0 . 0 . 1 / o n t o l o g y / w e a t h e r . owl # city </ p r o c e s s : p a r a m e t e r T y p e >

56 < r d f s : label > </ r d f s : label >

57 </ p r o c e s s : Input >

58

59 < p r o c e s s : O u t p u t rdf : ID =" _ W E A T H E R I N F O " >

60 < p r o c e s s : p a r a m e t e r T y p e rdf : d a t a t y p e =" h t t p :// www . w3 . org / 2 0 0 1 / X M L S c h e m a # a n y U R I " >

61 h t t p : / / 1 2 7 . 0 . 0 . 1 / o n t o l o g y / w e a t h e r . owl # weather </ p r o c e s s : p a r a m e t e r T y p e >

62 < r d f s : label > </ r d f s : label >

63 </ p r o c e s s : Output >

64

65 < g r o u n d i n g : W s d l G r o u n d i n g rdf : ID =" W E A T H E R _ F O R E C A S T _ G R O U N D I N G " >

66 < s e r v i c e : s u p p o r t e d B y rdf : r e s o u r c e ="# W E A T H E R _ F O R E C A S T _ S E R V I C E "/ >

67 < g r o u n d i n g : h a s A t o m i c P r o c e s s G r o u n d i n g >

68 < g r o u n d i n g : W s d l A t o m i c P r o c e s s G r o u n d i n g rdf : ID =" W E A T H E R _ F O R E C A S T _ A t o m i c P r o c e s s G r o u n d i n g "/ >

69 </ g r o u n d i n g : h a s A t o m i c P r o c e s s G r o u n d i n g >

70 </ g r o u n d i n g : W s d l G r o u n d i n g >

71

72 < g r o u n d i n g : W s d l A t o m i c P r o c e s s G r o u n d i n g rdf : a b o u t ="# W E A T H E R _ F O R E C A S T _ A t o m i c P r o c e s s G r o u n d i n g " >

73 < g r o u n d i n g : w s d l D o c u m e n t rdf : d a t a t y p e =" h t t p :// www . w3 . org / 2 0 0 1 / X M L S c h e m a # a n y U R I " >

74 h t t p : / / 1 2 7 . 0 . 0 . 1 / w s d l / W e a t h e r F o r e c a s t . wsdl </ g r o u n d i n g : w s d l D o c u m e n t >

75 < g r o u n d i n g : o w l s P r o c e s s rdf : r e s o u r c e ="# W E A T H E R _ F O R E C A S T _ P R O C E S S "/ >

76 < g r o u n d i n g : w s d l O p e r a t i o n >

77 < g r o u n d i n g : W s d l O p e r a t i o n R e f >

78 < g r o u n d i n g : o p e r a t i o n rdf : d a t a t y p e =" h t t p :// www . w3 . org / 2 0 0 1 / X M L S c h e m a # a n y U R I " >

79 h t t p : / / 1 2 7 . 0 . 0 . 1 / w s d l / W e a t h e r F o r e c a s t / G e t W e a t h e r F o r e c a s t P r i c e </ g r o u n d i n g : o p e r a t i o n >

80 < g r o u n d i n g : p o r t T y p e rdf : d a t a t y p e =" h t t p :// www . w3 . org / 2 0 0 1 / X M L S c h e m a # a n y U R I " >

81 h t t p : / / 1 2 7 . 0 . 0 . 1 / w s d l / W e a t h e r F o r e c a s t / W e a t h e r F o r e c a s t P o r t T y p e </ g r o u n d i n g : p o r t T y p e >

82 </ g r o u n d i n g : W s d l O p e r a t i o n R e f >

83 </ g r o u n d i n g : w s d l O p e r a t i o n >

84 < g r o u n d i n g : w s d l I n p u t M e s s a g e rdf : d a t a t y p e =" h t t p :// www . w3 . org / 2 0 0 1 / X M L S c h e m a # a n y U R I " >

85 h t t p : / / 1 2 7 . 0 . 0 . 1 / w s d l / W e a t h e r F o r e c a s t / G e t W e a t h e r F o r e c a s t I n p u t 86 </ g r o u n d i n g : w s d l I n p u t M e s s a g e >

87 < g r o u n d i n g : w s d l O u t p u t M e s s a g e rdf : d a t a t y p e =" h t t p :// www . w3 . org / 2 0 0 1 / X M L S c h e m a # a n y U R I " >

88 h t t p : / / 1 2 7 . 0 . 0 . 1 / w s d l / W e a t h e r F o r e c a s t / G e t W e a t h e r F o r e c a s t O u t p u t 89 </ g r o u n d i n g : w s d l O u t p u t M e s s a g e >

90 < g r o u n d i n g : w s d l I n p u t >

91 < g r o u n d i n g : W s d l I n p u t M e s s a g e M a p >

92 < g r o u n d i n g : o w l s P a r a m e t e r rdf : r e s o u r c e ="# _ D A T E "/ >

93 < g r o u n d i n g : w s d l M e s s a g e P a r t rdf : d a t a t y p e =" h t t p :// www . w3 . org / 2 0 0 1 / X M L S c h e m a # a n y U R I " >

94 h t t p : / / 1 2 7 . 0 . 0 . 1 / w s d l / W e a t h e r F o r e c a s t / _DATE </ g r o u n d i n g : w s d l M e s s a g e P a r t >

95 < g r o u n d i n g : x s l t T r a n s f o r m a t i o n S t r i n g > N o n e ( XSL ) </ g r o u n d i n g : x s l t T r a n s f o r m a t i o n S t r i n g >

96 </ g r o u n d i n g : W s d l I n p u t M e s s a g e M a p >

97 </ g r o u n d i n g : w s d l I n p u t >

98 < g r o u n d i n g : w s d l I n p u t >

99 < g r o u n d i n g : W s d l I n p u t M e s s a g e M a p >

100 < g r o u n d i n g : o w l s P a r a m e t e r rdf : r e s o u r c e ="# _ C I T Y "/ >

101 < g r o u n d i n g : w s d l M e s s a g e P a r t rdf : d a t a t y p e =" h t t p :// www . w3 . org / 2 0 0 1 / X M L S c h e m a # a n y U R I " >

102 h t t p : / / 1 2 7 . 0 . 0 . 1 / w s d l / W e a t h e r F o r e c a s t / _CITY </ g r o u n d i n g : w s d l M e s s a g e P a r t >

103 < g r o u n d i n g : x s l t T r a n s f o r m a t i o n S t r i n g > N o n e ( XSL ) </ g r o u n d i n g : x s l t T r a n s f o r m a t i o n S t r i n g >

104 </ g r o u n d i n g : W s d l I n p u t M e s s a g e M a p >

105 </ g r o u n d i n g : w s d l I n p u t >

106 < g r o u n d i n g : w s d l O u t p u t >

107 < g r o u n d i n g : W s d l O u t p u t M e s s a g e M a p >

108 < g r o u n d i n g : o w l s P a r a m e t e r rdf : r e s o u r c e ="# _ W E A T H E R "/ >

109 < g r o u n d i n g : w s d l M e s s a g e P a r t rdf : d a t a t y p e =" h t t p :// www . w3 . org / 2 0 0 1 / X M L S c h e m a # a n y U R I " >

110 h t t p : / / 1 2 7 . 0 . 0 . 1 / w s d l / W e a t h e r F o r e c a s t / _ W E A T H E R </ g r o u n d i n g : w s d l M e s s a g e P a r t >

111 < g r o u n d i n g : x s l t T r a n s f o r m a t i o n S t r i n g > N o n e ( XSL ) </ g r o u n d i n g : x s l t T r a n s f o r m a t i o n S t r i n g > </ g r o u n d i n g : W s d l O u t p u t M e s s a g e M a p >

112 </ g r o u n d i n g : w s d l O u t p u t >

113 </ g r o u n d i n g : W s d l A t o m i c P r o c e s s G r o u n d i n g >

114

115 </ rdf : RDF >

Listing 2.3: WeatherForecastRequest OWL-S Service

Discussion

Since a WSDL document lacks declaring semantic data model that helps other machines to understand the meaning of document contents, we drop WSDL and consider choices (OWL-S and SAWSDL) on the semantic web service approach.

Overall both OWL-S and SAWSDL can annotate elements of a WSDL interface with entities from a semantic data model, which facilitate automated service dis- covery and service composition. However, we choose OWL-S as service description for our Web service composition framework. As semantic web services that the Discovery system (DS) uses for its searching model is OWL-S services. Addition, OWL-S standards define ontologies for describing the capabilities and choreogra- phies of stateful web services (choreographies being the sequences of messages exchanged between a client and a service during an interaction [DS12]).

Documentos relacionados