[owl-s] Working example with array as parameter
Jakub Moskal
jakub.moskal at gmail.com
Wed Sep 20 13:37:04 EDT 2006
Hi,
I finally managed to solve my problem where I wanted to ground OWL-S
service to a WSDL service which used string arrays in one of it's
operations as the input parameters. Below I post the crucial parts of
the code, maybe someone will find this helpful in future. Notice in
the xsltTransformationString the "<anything>" node - I believe it's a
bug in the API. This node can be named anyhow, but is necessary to
create the proper SOAP message. This one line is bascially what took
me so long to solve my problem. Also, make sure that the "j.0"
namespace points to the OWL document which defines the OWL class that
is your input parameter.
Jakub.
WSDL
-----------
[Schema, array defined]
<element name="getCurrent">
<complexType>
<sequence>
<element maxOccurs="unbounded" name="categories" type="xsd:string"/>
</sequence>
</complexType>
</element>
[Message]
<wsdl:message name="getCurrentRequest">
<wsdl:part element="impl:getCurrent" name="parameters"/>
</wsdl:message>
[Operation]
<wsdl:operation name="getCurrent">
<wsdl:input message="impl:getCurrentRequest" name="getCurrentRequest"/>
<wsdl:output message="impl:getCurrentResponse" name="getCurrentResponse"/>
</wsdl:operation>
OWL (class which is the Input in OWL-S)
-------------------------------------------------------------
<owl:Class rdf:ID="Order"/>
<owl:DatatypeProperty rdf:ID="Category">
<rdfs:domain rdf:resource="#Order"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</owl:DatatypeProperty>
OWL-S xsltTransformationString
-----------------------------------------------
<grounding:xsltTransformationString>
<![CDATA[
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:j.0="http://localhost:8888/Provider/owl/Provider.owl#">
<xsl:template match="//j.0:Order">
<anything>
<xsl:for-each select="j.0:Category">
<categories><xsl:value-of select="."/></categories>
</xsl:for-each>
</anything>
</xsl:template>
</xsl:stylesheet>
]]>
</grounding:xsltTransformationString>
More information about the OWL-S
mailing list