Cover page images (keys)

SPARQL in WSDL

Eric Prud'hommeaux, eric@w3.org
Sanitation Engineer

http://tinyurl.com/29e7az

A Question:

What are the titles and pages of some books on Weaving?

PREFIX aws: <http://dev.w3.org/cvsweb/perl/modules/W3C/SPDL/descriptions/AWSECommerceService-SAWSDL-item-terms.ttl#>
SELECT ?title ?page WHERE {
_:b aws:devID "0FWYBWB91M5S26YBE382" ;
    aws:keywords "Weaving" ;
    aws:index "Books" ;

    aws:asin ?asin ;
    aws:title ?title ;
    aws:page ?page . }

Finding the Answer

The machine will discover and execute this for us...

Finding the Answer

... and generate requests:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
  xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/1999/XMLSchema"
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
        <ItemSearch xmlns="">
            <SubscriptionId xsi:type="xsd:string">0FWYBWB91M5S26YBE382</SubscriptionId>
            <Request>
                <Keywords xsi:type="xsd:string">Weaving</Keywords>
                <SearchIndex xsi:type="xsd:string">Books</SearchIndex>
            </Request>
        </ItemSearch>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Finding the Answer

... and parse responses:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
  <SOAP-ENV:Body>
    <ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2005-10-05">
      <Items>
        <Item>
          <ASIN>1883010039</ASIN>
          <DetailPageURL>http://www.amazon.com/exec/obidos/redirect?tag=ws%26link_code=sp1%26camp=2025%26creative=165953%26path=http://www.amazon.com/gp/redirect.html%253fASIN=1883010039%2526tag=ws%2526lcode=sp1%2526cID=2025%2526ccmID=165953%2526location=/o/ASIN/1883010039%25253FSubscriptionId=0FWYBWB91M5S26YBE382</DetailPageURL>
          <ItemAttributes>
            <Author>Deborah Chandler</Author>
            <Author>Debbie Redding</Author>
            <ProductGroup>Book</ProductGroup>
            <Title>Learning to Weave, Revised Edition</Title>
          </ItemAttributes>
        </Item>
        ...

SPARQL Annotations: SPAT

Identifying information

Operation Rules

Very simple inference appears to model reasonable use cases.

silly sign: "KEEP HANDS AWAY FROM MACHINERY" silly sign: "STOP MACHINE" silly sign: "EAR PROTECTION REQUIRED"

Operation Rules

Querying Rule Closure

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 ;
    aws:page ?page }
titlepage_:basin
XPath(aws:Title)
XPath(...PageURL)
_:22
_:20.XPath(aws:ASIN)
XPath(aws:Title)
XPath(...PageURL)
_:22
_:10.XPath(aws:ASIN)

Studying Proof Chain

The proofs of these rules illustrate how to invoke the services:

_:22 this:page XPath(...PageURL) .
-->{
[
fwrule ask(?req this:id XPath(.) && ?req this:asin XPath(.)) assert(?req this:page XPath(...PageURL) && ?req this:reqId _:9.XPath(.) && ?req this:asin _:10.XPath(aws:ASIN) && ?req this:title _:11.XPath(aws:Title)) -->{AWSECommerceService:ItemLookup}
_:22 this:asin _:20.XPath(aws:ASIN) .
-->{
[
fwrule ask(?req this:id XPath(.) && ?req this:keywords XPath(aws:Keywords) && ?req this:index XPath(aws:SearchIndex)) assert(?req this:reqId _:19.XPath(.) && ?req this:asin _:20.XPath(aws:ASIN) && ?req this:title XPath(aws:Title)) -->{AWSECommerceService:ItemSearch}
_:22 this:index "Books" .
-->{<>}
_:22 this:id "0FWYBWB91M5S26YBE382" .
-->{<>}
_:22 this:keywords "Weaving" .
-->{<>}
]
}
_:22 this:id "0FWYBWB91M5S26YBE382" .
-->{<>}
]
}

Future Work

There's always more to play with...