0% found this document useful (0 votes)
93 views

Biểu Diễn Owl-S Qua Dịch Vụ Chuyển Đổi Tiền Tệ (Currencyconverter)

This document describes an OWL-S ontology for a currency conversion service. It includes: 1. Definitions for the service, its profile, process, and grounding in OWL. This includes inputs, outputs, and the WSDL binding. 2. The WSDL file for the currency conversion web service, defining messages, ports, and operations. It references an XML schema for requests and responses. 3. XSLT transformations to map between the OWL-S definitions and WSDL messages and parts.

Uploaded by

Lê Hoàng
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views

Biểu Diễn Owl-S Qua Dịch Vụ Chuyển Đổi Tiền Tệ (Currencyconverter)

This document describes an OWL-S ontology for a currency conversion service. It includes: 1. Definitions for the service, its profile, process, and grounding in OWL. This includes inputs, outputs, and the WSDL binding. 2. The WSDL file for the currency conversion web service, defining messages, ports, and operations. It references an XML schema for requests and responses. 3. XSLT transformations to map between the OWL-S definitions and WSDL messages and parts.

Uploaded by

Lê Hoàng
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

Biu din OWL-S qua dch v chuyn i tin t ( CurrencyConverter).

1. CurrencyConverter.owl
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE uridef [
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns">
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema">
<!ENTITY owl "http://www.w3.org/2002/07/owl">
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema">
<!ENTITY service "http://www.daml.org/services/owl-s/1.1/Service.owl">
<!ENTITY profile "http://www.daml.org/services/owl-s/1.1/Profile.owl">
<!ENTITY process "http://www.daml.org/services/owl-s/1.1/Process.owl">
<!ENTITY grounding "http://www.daml.org/services/owl-s/1.1/Grounding.owl">
<!ENTITY concepts "http://www.mindswap.org/2004/owl-s/concepts.owl">
<!ENTITY currency "http://www.daml.ecs.soton.ac.uk/ont/currency.owl">
<!ENTITY mind "http://www.mindswap.org/2004/owl-s/1.1/MindswapProfileHierarchy.owl">
]>
<rdf:RDF
xmlns:rdf="&rdf;#"
xmlns:rdfs="&rdfs;#"
xmlns:owl="&owl;#"
xmlns:xsd="&xsd;#"
xmlns:service="&service;#"
xmlns:profile="&profile;#"
xmlns:process="&process;#"
xmlns:grounding="&grounding;#"
xmlns:mind="&mind;#"
xml:base="http://www.mindswap.org/2004/owl-s/1.1/CurrencyConverter.owl"
>
<owl:Ontology rdf:about="">
<owl:imports rdf:resource="&service;"/>
<owl:imports rdf:resource="&profile;"/>
<owl:imports rdf:resource="&process;"/>
<owl:imports rdf:resource="&grounding;"/>
<owl:imports rdf:resource="&concepts;"/>
<owl:imports rdf:resource="&currency;"/>
<owl:imports rdf:resource="&mind;"/>
</owl:Ontology>
<!-- Service description -->
<service:Service rdf:ID="CurrencyConverterService">
<service:presents rdf:resource="#CurrencyConverterProfile"/>
<service:describedBy rdf:resource="#CurrencyConverterProcess"/>
<service:supports rdf:resource="#CurrencyConverterGrounding"/>
</service:Service>
<!-- Profile description -->
<mind:CurrencyService rdf:ID="CurrencyConverterProfile">
<service:isPresentedBy rdf:resource="#CurrencyConverterService"/>
<profile:serviceName xml:lang="en">Price Converter</profile:serviceName>
<profile:textDescription xml:lang="en">Converts the given price to another
currency.</profile:textDescription>
<profile:hasInput rdf:resource="#InputPrice"/>
<profile:hasInput rdf:resource="#OutputCurrency"/>
<profile:hasOutput rdf:resource="#OutputPrice"/>
</mind:CurrencyService>
<!-- Process description -->
<process:AtomicProcess rdf:ID="CurrencyConverterProcess">
<service:describes rdf:resource="#CurrencyConverterService"/>
<process:hasInput rdf:resource="#InputPrice"/>
<process:hasInput rdf:resource="#OutputCurrency"/>
<process:hasOutput rdf:resource="#OutputPrice"/>
</process:AtomicProcess>

<process:Input rdf:ID="InputPrice">
<process:parameterType rdf:datatype="&xsd;#anyURI">http://www.mindswap.org/2004/owls/concepts.owl#Price</process:parameterType>
<rdfs:label>Input Price</rdfs:label>
</process:Input>
<process:Input rdf:ID="OutputCurrency">
<process:parameterType
rdf:datatype="&xsd;#anyURI">http://www.daml.ecs.soton.ac.uk/ont/currency.owl#Currency</proc
ess:parameterType>
<rdfs:label>Output Currency</rdfs:label>
</process:Input>
<process:Output rdf:ID="OutputPrice">
<process:parameterType rdf:datatype="&xsd;#anyURI">http://www.mindswap.org/2004/owls/concepts.owl#Price</process:parameterType>
<rdfs:label>Output Price</rdfs:label>
</process:Output>
<!-- Grounding description -->
<grounding:WsdlGrounding rdf:ID="CurrencyConverterGrounding">
<service:supportedBy rdf:resource="#CurrencyConverterService"/>
<grounding:hasAtomicProcessGrounding
rdf:resource="#CurrencyConverterProcessGrounding"/>
</grounding:WsdlGrounding>
<grounding:WsdlAtomicProcessGrounding rdf:ID="CurrencyConverterProcessGrounding">
<grounding:owlsProcess rdf:resource="#CurrencyConverterProcess"/>
<grounding:wsdlDocument
rdf:datatype="&xsd;#anyURI">http://www.mindswap.org/2002/services/CurrencyConverter.wsdl</g
rounding:wsdlDocument>
<grounding:wsdlOperation>
<grounding:WsdlOperationRef>
<grounding:portType
rdf:datatype="&xsd;#anyURI">http://www.mindswap.org/2002/services/CurrencyConverter.wsdl#Cu
rrencyConvertor</grounding:portType>
<grounding:operation
rdf:datatype="&xsd;#anyURI">http://www.mindswap.org/2002/services/CurrencyConverter.wsdl#co
nvertPrice</grounding:operation>
</grounding:WsdlOperationRef>
</grounding:wsdlOperation>
<grounding:wsdlInputMessage
rdf:datatype="&xsd;#anyURI">http://www.mindswap.org/2002/services/CurrencyConverter.wsdl#co
nvertPriceRequest</grounding:wsdlInputMessage>
<grounding:wsdlInput>
<grounding:WsdlInputMessageMap>
<grounding:owlsParameter rdf:resource="#InputPrice"/>
<grounding:wsdlMessagePart
rdf:datatype="&xsd;#anyURI">http://www.mindswap.org/2002/services/CurrencyConverter.wsdl#in
0</grounding:wsdlMessagePart>
<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:concepts="http://www.mindswap.org/2004/owl-s/concepts.owl#"
xmlns="urn:org:mindswap:services">
<xsl:template match="//concepts:Price">
<xsl:variable name="X1" select="concepts:currency/@rdf:resource"/>
<Price>
<amount>
<xsl:value-of select="concepts:amount"/>
</amount>
<currency>
<xsl:value-of select="substring-after($X1,'#')"/>
</currency>
</Price>
</xsl:template>
</xsl:stylesheet>
]]>
</grounding:xsltTransformationString>
</grounding:WsdlInputMessageMap>
</grounding:wsdlInput>

<grounding:wsdlInput>
<grounding:WsdlInputMessageMap>
<grounding:owlsParameter rdf:resource="#OutputCurrency"/>
<grounding:wsdlMessagePart
rdf:datatype="&xsd;#anyURI">http://www.mindswap.org/2002/services/CurrencyConverter.wsdl#in
1</grounding:wsdlMessagePart>
<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:lang="http://www.daml.ecs.soton.ac.uk/ont/currency.owl#"
xmlns="urn:org:mindswap:services">
<xsl:template match="/ ">
<xsl:value-of select="//lang:code"/>
</xsl:template>
</xsl:stylesheet>
]]>
</grounding:xsltTransformationString>
</grounding:WsdlInputMessageMap>
</grounding:wsdlInput>
<grounding:wsdlOutputMessage
rdf:datatype="&xsd;#anyURI">http://www.mindswap.org/2002/services/CurrencyConverter.wsdl#co
nvertPriceResponse</grounding:wsdlOutputMessage>
<grounding:wsdlOutput>
<grounding:WsdlOutputMessageMap>
<grounding:owlsParameter rdf:resource="#OutputPrice"/>
<grounding:wsdlMessagePart
rdf:datatype="&xsd;#anyURI">http://www.mindswap.org/2002/services/CurrencyConverter.wsdl#re
turn</grounding:wsdlMessagePart>
<grounding:xsltTransformationString>
<![CDATA[
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/return">
<xsl:variable name="X1" select="currency"/>
<xsl:variable name="X2" select="amount"/>
<xsl:variable name="X3"
select="concat('http://www.daml.ecs.soton.ac.uk/ont/currency.owl#',$X1)"/>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:concepts="http://www.mindswap.org/2004/owl-s/concepts.owl#">
<concepts:Price>
<concepts:currency>
<xsl:attribute name="rdf:resource"><xsl:value-of
select="$X3"/></xsl:attribute>
</concepts:currency>
<concepts:amount>
<xsl:value-of select="$X2"/>
</concepts:amount>
</concepts:Price>
</rdf:RDF>
</xsl:template>
</xsl:stylesheet>
]]>
</grounding:xsltTransformationString>
</grounding:WsdlOutputMessageMap>
</grounding:wsdlOutput>
</grounding:WsdlAtomicProcessGrounding>
</rdf:RDF>

2. CurrencyConverter.wsdl.
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:org:mindswap:services:CurrencyConverter"
xmlns:impl="urn:org:mindswap:services:CurrencyConverter-impl"
xmlns:intf="urn:org:mindswap:services:CurrencyConverter"

xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns1="urn:org:mindswap:services"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:org:mindswap:services">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="Price">
<sequence>
<element name="currency" nillable="true" type="soapenc:string"/>
<element name="amount" type="xsd:double"/>
</sequence>
</complexType>
<element name="Price" nillable="true" type="tns1:Price"/>
</schema>
</wsdl:types>
<wsdl:message name="convertPriceResponse">
<wsdl:part name="return" type="tns1:Price"/>
</wsdl:message>
<wsdl:message name="convertPriceRequest">
<wsdl:part name="in0" type="tns1:Price"/>
<wsdl:part name="in1" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="convertRequest">
<wsdl:part name="in0" type="xsd:double"/>
<wsdl:part name="in1" type="soapenc:string"/>
<wsdl:part name="in2" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="convertResponse">
<wsdl:part name="return" type="xsd:double"/>
</wsdl:message>
<wsdl:portType name="CurrencyConverter">
<wsdl:operation name="convert" parameterOrder="in0 in1 in2">
<wsdl:input name="convertRequest" message="intf:convertRequest"/>
<wsdl:output name="convertResponse" message="intf:convertResponse"/>
</wsdl:operation>
<wsdl:operation name="convertPrice" parameterOrder="in0 in1">
<wsdl:input name="convertPriceRequest" message="intf:convertPriceRequest"/>
<wsdl:output name="convertPriceResponse" message="intf:convertPriceResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="rpcrouterSoapBinding" type="intf:CurrencyConverter">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="convert">

<wsdlsoap:operation soapAction=""/>
<wsdl:input name="convertRequest">
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:org:mindswap:services:CurrencyConverter"/>
</wsdl:input>
<wsdl:output name="convertResponse">
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:org:mindswap:services:CurrencyConverter"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="convertPrice">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="convertPriceRequest">
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:org:mindswap:services:CurrencyConverter"/>
</wsdl:input>
<wsdl:output name="convertPriceResponse">
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:org:mindswap:services:CurrencyConverter"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CurrencyConverterService">
<wsdl:port name="rpcrouter" binding="intf:rpcrouterSoapBinding">
<wsdlsoap:address
location="http://www.mindswap.org:8080/soap/servlet/rpcrouter"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

You might also like