Review of Primer, part 2 (of N)

The SPARQL was a little problematic, the best version I could come up
with (with much assistance from AndyS) is below. Couple more minor
editorial points early on. I got rather blocked on this, hopefully the
rest of the doc won't take as long...

*** Scheduling a Meeting
s/showin/shown in

*** Referencing via Profile

http://purl.org/NET/erdf/extract-rdf
=>
http://purl.org/NET/erdf/extract-rdf.xsl
(appears in text & code)

-

"Then Jane's queries can be run on the merged calendars"

Just before this line, something like:
"Because of the RDF model, this kind of data can be merged by simply
adding it to an RDF store, or a SPARQL query may be run across the
data sources after transformation to RDF."

-

PREFIX ical: <http://www.w3.org/2002/12/cal/icaltzd#>

SELECT ?start1 ?stop1 ?loc1 ?summ1

FROM <http://www.w3.org/2001/sw/grddl-wg/doc29/david-erdf.rdf>
FROM <http://www.w3.org/2001/sw/grddl-wg/doc29/robin-hcal-grddl.rdf>
FROM <http://www.w3.org/2001/sw/grddl-wg/doc29/janeschedule.rdf>

WHERE
  {
        ?event1 a ical:Vevent;
              ical:summary ?summ1;
              ical:dtstart ?start1 ;
              ical:dtend ?stop1 ;
              ical:location ?loc1.
        ?event2 a ical:Vevent;
              ical:summary ?summ2 ;
              ical:dtstart ?start2;
              ical:dtend ?stop2;
              ical:location ?loc2.
        ?event3 a ical:Vevent;
              ical:summary ?summ3 ;
              ical:dtstart ?start3;
              ical:dtend ?stop3;
              ical:location ?loc3.

      FILTER ( str(?start1) = str(?start2) ).
      FILTER ( str(?stop1) = str(?stop2) ).
      FILTER ( str(?loc1) = str(?loc2) ).
      FILTER ( str(?start1) = str(?start3) ).
      FILTER ( str(?stop1) = str(?stop3) ).
      FILTER ( str(?loc1) = str(?loc3) ).
      FILTER ( str(?start3) = str(?start2) ).
      FILTER ( str(?stop3) = str(?stop2) ).
      FILTER ( str(?loc3) = str(?loc2) ).

      FILTER ( ?event1 != ?event2 &&  ?event2 != ?event3  &&  ?event1
!= ?event3  ).
      FILTER ( str(?summ1) < str(?summ2) && str(?summ2) < str(?summ3) ) .
}

explanatory text needed, maybe:
[[
The SELECT line determines which variable will appear in the results,
here one of the start dates, one of the stop dates, a location and a
summary. The FROM lines identify the data sources to use in the query,
in this case the RDF/XML derived from Jane, David and Robin's original
documents. The WHERE section provides a pattern which can match three
events. The first block of FILTERs match up identical start and stop
dates as well as locations between the three events. These values,
which may be differently typed, are simplified to simple literals with
the str() operator. The final two FILTER lines are idiomatic
expressions which prevent multiple resultsreturning due to the
interchangeability of the variables.
]]

results (using ARQ) are actually:

start1  stop1   loc1  summ1
| "2007-01-08"^^xs:date | "2007-01-11"^^xs:date | "Edinburgh,
UK"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> | "Web
Conference"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> |

probably best to present as:

start1  stop1   loc1  summ1
"2007-01-08" "2007-01-11"  "Edinburgh, UK"  "Web Conference"


-- 

http://dannyayers.com

Received on Monday, 25 June 2007 17:34:58 UTC