- From: Jitao Yang <jitao.yang@gmail.com>
- Date: Sat, 30 May 2009 21:18:08 +0200
- To: public-sparql-dev@w3.org
- Message-ID: <eb1226bd0905301218y194d2403n268fbf21e71419ad@mail.gmail.com>
Dear all,
if there is a RDF like:
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description rdf:about="http://example.org/BookJava">
<dc:fullname>Book Java</dc:fullname>
<dc:author>
<rdf:Description rdf:about="http://example.org/BookJava/authorA
">
<dc:fullname>Bob Smith</dc:fullname>
<dc:country>Italy</dc:country>
</rdf:Description>
</dc:author>
<dc:author>
<rdf:Description rdf:about="http://example.org/BookJava/authorB
">
<dc:fullname>Tom Bush</dc:fullname>
<dc:country>Italy</dc:country>
</rdf:Description>
</dc:author>
</rdf:Description>
<rdf:Description rdf:about="http://example.org/BookCpp">
<dc:fullname>Book Cpp</dc:fullname>
<dc:author>
<rdf:Description rdf:about="http://example.org/BookCpp/author1">
<dc:fullname>Alice Bird</dc:fullname>
<dc:country>Italy</dc:country>
</rdf:Description>
</dc:author>
<dc:author>
<rdf:Description rdf:about="http://example.org/BookCpp/author2">
<dc:fullname>Mike Luck</dc:fullname>
<dc:country>France</dc:country>
</rdf:Description>
</dc:author>
</rdf:Description>
</rdf:RDF>
and I query the RDF by:
PREFIX dc:<http://purl.org/dc/elements/1.1/>
SELECT DISTINCT ?bookName
WHERE {
?bookName dc:author ?author .
{?author dc:country ?country . FILTER(?country = "Italy")}
};
the query results are:
---------------------------------
| bookName |
=================================
| <http://example.org/BookCpp> |
| <http://example.org/BookJava> |
---------------------------------
can anybody tell me how to query out the "book whose authors' country are
all Italy "?
which means the query results should be:
---------------------------------
| bookName |
=================================
| <http://example.org/BookJava> |
---------------------------------
Thank you very much for your help!
Best wishes,
Jitao
Received on Saturday, 30 May 2009 19:19:05 UTC