- From: Michael Brunnbauer <brunni@netestate.de>
- Date: Tue, 4 Jun 2013 17:08:44 +0200
- To: Remo Liechti <remo.liechti@gmail.com>
- Cc: public-sparql-dev@w3.org
Hello Remo, On Mon, Jun 03, 2013 at 10:51:15PM +0200, Remo Liechti wrote: > <fh:Runways rdf:parseType="Collection"> > <fh:runway> > <fh:callSign1>14</fh:callSign1> > <fh:callSign2>32</fh:callSign2> > </fh:runway> > <fh:runway> > <fh:callSign1>10</fh:callSign1> > <fh:callSign2>28</fh:callSign2> > </fh:runway> > <fh:runway> > <fh:callSign1>16</fh:callSign1> > <fh:callSign2>34</fh:callSign2> > </fh:runway> > </fh:Runways> See http://www.w3.org/TR/2004/REC-rdf-mt-20040210/#collections http://www.w3.org/TR/REC-rdf-syntax/#section-Syntax-parsetype-Collection This should generate the following triples: ... fh:Runways _:a _:a rdf:first _:b _:a rdf:rest _:c _:b rdf:type fh:runway _:b fh:callSign1 "14" _:b fh:callSign2 "32" _:c rdf:first _:d _:c rdf:rest _:e _:d rdf:type fh:runway _:d fh:callSign1 "10" _:d fh:callSign2 "28" _:e rdf:first _:f _:e rdf:rest rdf:nil _:f rdf:type fh:runway _:f fh:callSign1 "16" _:f fh:callSign2 "34" You can query all runways (or more general - all items of an RDF collection) with SPARQL 1.1 property paths: PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX fh: <http://swt.ffhs.ch> SELECT ?name (COUNT(?r) as ?runways) WHERE { ?a rdf:type fh:airport. ?a fh:name ?name. ?a fh:Runways ?collection. ?collection rdf:rest*/rdf:first ?r. ?r rdf:type fh:runway. } group by ?name Regards, Michael Brunnbauer -- ++ Michael Brunnbauer ++ netEstate GmbH ++ Geisenhausener Straße 11a ++ 81379 München ++ Tel +49 89 32 19 77 80 ++ Fax +49 89 32 19 77 89 ++ E-Mail brunni@netestate.de ++ http://www.netestate.de/ ++ ++ Sitz: München, HRB Nr.142452 (Handelsregister B München) ++ USt-IdNr. DE221033342 ++ Geschäftsführer: Michael Brunnbauer, Franz Brunnbauer ++ Prokurist: Dipl. Kfm. (Univ.) Markus Hendel
Received on Tuesday, 4 June 2013 15:09:07 UTC