Re: a twist on the guitar-shopping/hReview use case: hotel reviews

Along those same lines, i managed to grab some hCalendar events and
send them to SPARQL.

OK, it took a few more steps than expected, so it isn't as "clean" but
you get the idea.

First i found two pages with hCalendar data:
http://upcoming.org/event/52877/
http://upcoming.org/event/88868/

It is invalid HTML, so i passed them through Tidy to get a new URL
http://cgi.w3.org/cgi-bin/tidy?docAddr=http%3A%2F%2Fupcoming.org%2Fevent%2F52877%2F

Then i found the w3c XSLT web service
http://www.w3.org/2005/08/online_xslt/
which allows you to specify an XSLT and an HTML file

I used Dan Connolly's XSLT for hCalendar to RDF
http://www.w3.org/2002/12/cal/glean-hcal.xsl

to get this massive URL to output an RDF file of the event:
http://www.w3.org/2005/08/online_xslt/xslt?xslfile=http%3A%2F%2Fwww.w3.org%2F2002%2F12%2Fcal%2Fglean-hcal.xsl&xmlfile=http%3A%2F%2Fcgi.w3.org%2Fcgi-bin%2Ftidy%3FdocAddr%3Dhttp%253A%252F%252Fupcoming.org%252Fevent%252F52877%252F&content-type=&submit=transform

I then went to:
http://sparql.org/sparql.html
and wrote a very short SPARQL query (paste the following into the textarea)

PREFIX r: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX c: <http://www.w3.org/2002/12/cal/icaltzd#>
PREFIX h: <http://www.w3.org/1999/xhtml>

SELECT
?description
FROM <http://www.w3.org/2005/08/online_xslt/xslt?xslfile=http%3A%2F%2Fwww.w3.org%2F2002%2F12%2Fcal%2Fglean-hcal.xsl&xmlfile=http%3A%2F%2Fcgi.w3.org%2Fcgi-bin%2Ftidy%3FdocAddr%3Dhttp%253A%252F%252Fupcoming.org%252Fevent%252F52877%252F&content-type=&submit=transform>
FROM <http://www.w3.org/2005/08/online_xslt/xslt?xslfile=http%3A%2F%2Fwww.w3.org%2F2002%2F12%2Fcal%2Fglean-hcal.xsl&xmlfile=http%3A%2F%2Fcgi.w3.org%2Fcgi-bin%2Ftidy%3FdocAddr%3Dhttp%253A%252F%252Fupcoming.org%252Fevent%252F88868%252F&content-type=&submit=transform>
WHERE {
?x c:description ?description
}

and you will get the description of the events. Now, with SPARQL you
can chain together as many FROM <uri> as needed.

Obviously, you can also do more complicated WHERE statements, so you
can show all the places open before 9AM or places located in a certain
postal-code, etc.

The exact same would apply to hReviews, except we need a corresponding
RDF schema to model the Reviews on (or is there one that i just
missed?).

Let the fun begin!
-brian

-- 
brian suda
http://suda.co.uk


On 8/12/06, Dan Connolly <connolly@w3.org> wrote:
>
> I keep an archive/log of conferences and trips
>   http://www.w3.org/People/Connolly/events/
>
> I little while ago I took the contact records
> of hotels on several of those trips and exported
> them from my PDA into hCards on that page. Some
> of them have little review notes. With a few tweaks,
> I could turn them into proper hReviews.
>
> Suppose you're travelling to Edinburgh or Boston
> or something sometime soon... would you like
> to be able to do a query for
>
>         What does Dan Connolly think of hotels
>         in the Boston area?
>
> I also keep a certain amount of social network data
> there using XFN. So you could find people I know
> from there too. So I should be able to ask
>
>         What do my colleagues think of hotels
>         in the Vancouver area?
>
> I think it would be fun to flesh out the details
> of this use case... make it more of a "here's how
> we did it" than an "imagine if..." sort of thing.
>
> Is anybody else interested to publish a few hotel hReviews?
> Or to work out some of the hosting details and technical
> details?
>
> We could set up a
>
>         What do GRDDL WG members think of
>         hotels near ?WHERE
>
> service. Maybe we could extend it to restaurants.
>
> I wonder if the XMLArmyKnife is the only SPARQL
> service out there that does GRDDL so far.
>   http://esw.w3.org/topic/SparqlEndpoints
>
>
> --
> Dan Connolly, W3C http://www.w3.org/People/Connolly/
> D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E
>
>
>


-- 
brian suda
http://suda.co.uk

Received on Monday, 14 August 2006 03:07:20 UTC