1 2 3 4 5 6 7 8 9 10 11 | @prefix foaf: <http://xmlns.com/foaf/0.1/> . _:a foaf:name "Jon Foobar" ; foaf:mbox <mailto:jon@foobar.xx> ; foaf:depiction <http://foobar.xx/2005/04/jon.jpg> . _:b foaf:name "A. N. O'Ther" ; foaf:mbox <mailto:a.n.other@example.net> ; foaf:depiction <http://example.net/photos/an-2005.jpg> . _:c foaf:name "Liz Somebody" ; foaf:mbox_sha1sum "3f01fa9929df769aff173f57dec2fe0c2290aeea" _:d foaf:name "M Benn" ; foaf:depiction <http://mbe.nn/pics/me.jpeg> . |
1 2 3 4 5 6 7 8 | PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name ?depiction WHERE { ?person foaf:name ?name . OPTIONAL { ?person foaf:depiction ?depiction . } . } |
1 2 3 4 5 6 7 8 | ------------------------------------------------------------ | name | depiction | ============================================================ | "A. N. O'Ther" | <http://example.net/photos/an-2005.jpg> | | "Jon Foobar" | <http://foobar.xx/2005/04/jon.jpg> | | "Liz Somebody" | | | "M Benn" | <http://mbe.nn/pics/me.jpeg> | ------------------------------------------------------------ |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?name ?mbox WHERE { ?person foaf:name ?name . { { ?person foaf:mbox ?mbox } UNION { ?person foaf:mbox_sha1sum ?mbox } } } --------------------------------------------------------------------- | name | mbox | ===================================================================== | "Jon Foobar" | <mailto:jon@foobar.xx> | | "A. N. O'Ther" | <mailto:a.n.other@example.net> | | "Liz Somebody" | "3f01fa9929df769aff173f57dec2fe0c2290aeea" | --------------------------------------------------------------------- |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |