Eric Prud'hommeaux, [email protected]
WS2 · developer
Annotated Service Invocation
Execute (services described by) WSDL interfaces to answer user queries.
SELECT ?asin ?title WHERE { _:b tns:id "0FWYBWB91M5S26YBE382" ; tns:keywords "Weaving" ; tns:index "Books" ; tns:asin ?asin ; tns:title ?title ; tns:page ?page }
<ItemAttributes> <Title>Learning to Weave, Revised Edition</Title> <Author>Deborah Chandler</Author> <Author>Debbie Redding</Author> </ItemAttributes>
<xs:element name="Item">
<xs:complexType spat:SPAT='?book tns:doctitle xpath("aws:Title")...'>
<xs:sequence>
<xs:element name="Title" type="xs:string" minOccurs="0"/>
<xs:element name="Author" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
SELECT ?tile WHERE { ?response tnss:doctitle ?title }
aws:ItemSearchResponse/aws:Items/aws:Item/aws:Title
<definitions><types><element name="ItemSearchResponse"></element></types>... <message name="ItemSearchResponseMsg"/></definitions>
<xs:element name="Item" spat:SPAT='?book tns:doctitle xpath("aws:Title")'/>
PREFIX tnss: <http://webservices.amazon.com/AWSECommerceService/2004-11-10> SELECT ?title ?page WHERE { _:b tnss:id "0FWYBWB91M5S26YBE382" ; tnss:keywords "Weaving" ; tnss:index "Books" ; tnss:asin ?asin ; tnss:doctitle ?title ; tns:page ?page }
title | page |
---|---|
"Learning to Weave, Revised Edition" | "http://...ASIN=1883010039..." |
"Weaving Music into Young Minds with Education (Weaving Music Into Young Minds With Education)" | "http://...ASIN=0766800199..." |
"Spin to Knit: The Knitter's Guide to Making Yarn" | "http://...ASIN=1596680075" |
a sawsdl:loweringSchemaMapping:
<xs:element name="Item"> <!-- xs:complexType spat:SPAT='?book tns:doctitle xpath("aws:Title") --> <xs:complexType sawsdl:loweringSchemaMapping='&AWS;title'> <xs:sequence> <xs:element name="Author" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="Title" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element>
points to a document containing the SPDL annotations:
:id spat:SPAT '?req :id xpath(".")' . :keywords spat:SPAT '?req :keywords xpath("tns:Keywords") ; :index xpath("tns:SearchIndex")' . :asin spat:SPAT '?book :asin xpath("tns:ASIN")' . :title spat:SPAT '?book tns:docTitle xpath("aws:Title")' .
Very simple inference appears to model reasonable use cases.
<operation name="ItemSearch"> <input message="tns:ItemSearchRequestMsg"/> <output message="tns:ItemSearchResponseMsg"/> </operation>for the annotations:
<xs:element name="ItemSearch"
spat:SPAT='?req tns:asin xpath("tns:ASIN")'>
...
<xs:element name="ASIN" type="xs:string" minOccurs="0"/>
...
</xs:element>
┌ op {http://webservices.amazon.com/AWSECommerceService/2004-11-10}ItemLookup: │ fwrule ask(?req this:id XPath(., 91642dc) && │ ?req this:asin XPath(., 919d638)) │ assert(?req this:page _:<>:8.XPath(this:Items/this:Item/this:DetailPageURL, 91d37c8) && │ ?req this:reqId _:<>:9.XPath(., 9211c38) && │ ?req this:asin _:<>:10.XPath(tns:ASIN, 920b2b0) && │ ?req this:title _:<>:11.XPath(tns:Title, 9298a50)) │ -->{<qname:{http://webservices.amazon.com/AWSECommerceService/2004-11-10}ItemLookup>}
The ground facts from the users query:
PREFIX tns: <http://dev.w3.org/cvsweb/perl/modules/W3C/SPDL/descriptions/AWSECommerceService-SAWSDL-item-terms.ttl#> SELECT ?title ?page WHERE { _:b tns:id "0FWYBWB91M5S26YBE382" ; tns:keywords "Weaving" ; tns:index "Books" ... }
combined with a rule head:
┌ op {AWS:ItemSearch: │ fwrule ask(?req this:id XPath(., 8ae97f0) && │ ?req this:keywords XPath(tns:Keywords, 91b1d40) && │ ?req this:index XPath(tns:SearchIndex, 91b1d40)) │ assert(?req this:reqId _:19.XPath(., 92b17b0) && │ ?req this:asin _:20.XPath(tns:ASIN, 92d6890) && │ ?req this:title _:21.XPath(tns:Title, 93150e0)) │ -->{AWS:ItemSearch}
produce new inferences:
_:21 this:reqId _:19.XPath(., 92b17b0) . _:21 this:asin _:20.XPath(tns:ASIN, 92d6890) . _:21 this:title _:21.XPath(tns:Title, 93150e0) .
The produce of one inference:
_:21 this:reqId _:19.XPath(., 92b17b0) . _:21 this:asin _:20.XPath(tns:ASIN, 92d6890) . _:21 this:title _:21.XPath(tns:Title, 93150e0) .
combined with another rule head:
┌ op {AWS:ItemLookup: │ fwrule ask(?req this:id XPath(., 91b1548) && │ ?req this:asin XPath(., 920be4c)) │ assert(?req this:page _:8.XPath(tns:Items/tns:Item/tns:DetailPageURL, 9127a6c) && │ ?req this:reqId _:9.XPath(., 92b17b0) && │ ?req this:asin _:10.XPath(tns:ASIN, 92d6890) && │ ?req this:title _:11.XPath(tns:Title, 93150e0)) │ -->{AWS:ItemLookup}
produces new inferences:
_:22 this:page _:8.XPath(this:Items/this:Item/this:DetailPageURL, 91d37c8) . _:22 this:reqId _:9.XPath(., 9211c38) . _:22 this:asin _:10.XPath(tns:ASIN, 920b2b0) . _:22 this:title _:11.XPath(tns:Title, 9298a50) .
The closure of the rules is now useful for answering user queries:
PREFIX tnss: <http://webservices.amazon.com/AWSECommerceService/2004-11-10> SELECT ?title ?page WHERE { _:b tnss:id "0FWYBWB91M5S26YBE382" ; tnss:keywords "Weaving" ; tnss:index "Books" ; tnss:asin ?asin ; tnss:doctitle ?title ; tns:page ?page }
title | page | _:b | asin |
---|---|---|---|
XPath(tns:Title) | XPath(...PageURL) | _:22 | _:20.XPath(tns:ASIN) |
XPath(tns:Title) | XPath(...PageURL) | _:22 | _:10.XPath(tns:ASIN) |
The proofs of these rules illustrate how to invoke the services:
There's always more to play with...
Impressions of the demonstrator.
Applicability to industry today and tomorrow.
Applicability to users today and tomorrow.