[foaf-dev] Re: updated FOAF spec

Damian Steer pldms at mac.com
Fri May 25 12:49:30 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dan Brickley wrote:

> (a similar query can be run for rdfs:Class, I tried combining the two
> with UNION but either I don't understand, or the engine doesn't support
> enough SPARQL, to make that work).

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#>
SELECT DISTINCT ?status ?x ?label
WHERE {
 {
  ?x a rdf:Property .
  ?x rdfs:label ?label .
  ?x vs:term_status ?status .
 } UNION {
  ?x a rdfs:Class .
  ?x rdfs:label ?label .
  ?x vs:term_status ?status .
 }
}
ORDER BY ?status

Or just click on:

<http://xmlarmyknife.org/api/rdf/sparql/query?default-graph-uri=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2Findex.rdf&query=PREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0D%0APREFIX+vs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2003%2F06%2Fsw-vocab-status%2Fns%23%3E%0D%0ASELECT+DISTINCT+%3Fstatus+%3Fx+%3Flabel%0D%0AWHERE+%7B%0D%0A%7B%0D%0A++%3Fx+a+rdf%3AProperty+.%0D%0A++%3Fx+rdfs%3Alabel+%3Flabel+.%0D%0A++%3Fx+vs%3Aterm_status+%3Fstatus+.%0D%0A%7D+UNION+%7B%0D%0A++%3Fx+a+rdfs%3AClass+.%0D%0A++%3Fx+rdfs%3Alabel+%3Flabel+.%0D%0A++%3Fx+vs%3Aterm_status+%3Fstatus+.%0D%0A%7D%0D%0A%7D%0D%0AORDER+BY+%3Fstatus&format=html>

Biiiig URI :-)

Damian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGVs1KAyLCB+mTtykRAp18AJ0SBPsgN0dpTCTix2l8w55DC+vAkwCfeePA
V09hXPcl472x1ynQo98iJpY=
=pHxg
-----END PGP SIGNATURE-----


More information about the foaf-dev mailing list