2012-12-28 17:45:48 +01:00
<!--
PARAMETS:
RES_ID the ID of the Service
-->
2020-09-25 12:40:45 +02:00
-->
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
let $service := collection('/db/Profiles/Service')//Document/Data/ic:Profile/Resource[ID/text() eq '<RES_ID/>']
2012-12-28 17:45:48 +01:00
let $ServiceClass := $service/Profile/Class
let $ServiceName := $service/Profile/Name
let $ServiceVersion := $service/Profile/Version
2020-09-25 12:40:45 +02:00
let $riloop := collection('/db/Profiles/RunningInstance')//Document/Data/ic:Profile/Resource[Profile/ServiceClass/string() eq $ServiceClass and Profile/ServiceName/string() eq $ServiceName]
2012-12-28 17:45:48 +01:00
let $relatedris :=
for $ri in $riloop
let $ghn-id := $ri/Profile/GHN/@UniqueID/string()
2020-09-25 12:40:45 +02:00
let $ghn := doc(concat('/db/Profiles/GHN',$ghn-id))//Document/Data/ic:Profile/Resource
2012-12-28 17:45:48 +01:00
<!-- and $ri//Profile/Version/string() eq $ServiceVersion -->
return
2013-09-12 18:47:59 +02:00
<RESOURCE/>