It's the connection part that has me stumped. In SQL it might be done
with a subquery. But in SPARQL? Don't know.
I ended up writing a script and querying the various combination of
country and language using the query Mohamed supplied, but I'm sure
there is a better way.
When I run that query, I only get 29 results, so something is not right
there. Thanks, though, it is helping improve my understanding of SPARQL.
On 12/11/2011 02:45 AM, Saeedeh Shekarpour wrote:
Hi
you should somehow connect the variable ?place to the variable ?country
there are some properties in DBpedia you can use like:
select count( distinct ?place)
where {
?place a <http://dbpedia.org/ontology/Place>.
?place rdfs:label ?placeName.
?country ?p ?o.
filter(?p = <http://purl.org/dc/terms/subject> && ?o =
<http://dbpedia.org/resource/Category:European_countries>)
?place <http://dbpedia.org/ontology/locationCountry> ?country.
filter(langMatches( lang(?placeName), "fr" )).
}
You can find the list of possible properties by this query:
select distinct ?x
where {
?place a <http://dbpedia.org/ontology/Place>.
?country ?p ?o.
filter(?p = <http://purl.org/dc/terms/subject> && ?o =
<http://dbpedia.org/resource/Category:European_countries>)
?place ?x ?country.
}
Select one you aim at your query.
Best Regards
On Sun, Dec 11, 2011 at 6:13 AM, Liam Kirsher <[email protected]
<mailto:[email protected]>> wrote:
I can get the list of the countries, but how to combine with the
rest of the query?
Okay, I tried this to get the count of all the articles about
places in Europe that are in French. However, it times out. Is
this the correct query?
select ?country count(?place)
where {
?place a <http://dbpedia.org/ontology/Place>.
?place rdfs:label ?placeName. filter(langMatches(
lang(?placeName), "fr" )).
?country ?p ?o. filter(?p = <http://purl.org/dc/terms/subject>
&& ?o = <http://dbpedia.org/resource/Category:European_countries>)
}
On 12/10/2011 03:44 PM, Mohamed Morsey wrote:
Hi Liam,
On 12/09/2011 09:21 PM, Liam Kirsher wrote:
Mohamed,
Thanks so much! That was very helpful, and I now have most of
what I needed.
Perfect, then good luck with your next step ;)
The remaining thing is somewhat similar -- just to get entries
in a particular language anywhere in Europe.
Simply substituting Europe as the region does not work. I
imagine there might be some way to get the list of European
countries and filter on membership in the list.
You can use the following query to get a list of all European
countries:
SELECT ?country WHERE { ?country ?p ?o. filter(?p =
<http://purl.org/dc/terms/subject> && ?o =
<http://dbpedia.org/resource/Category:European_countries>) }
Thanks again!
Liam
--
Kind Regards
Mohamed Morsey
Department of Computer Science
University of Leipzig
--
Liam Kirsher
PGP:http://liam.numenet.com/pgp/
------------------------------------------------------------------------------
Learn Windows Azure Live! Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and
what it
provides. You can attend the event by watching it streamed LIVE
online.
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion
--
Saeedeh Shekarpour
Phd student
Department of Computer Science, University of Leipzig
Research Group: http://aksw.org <http://aksw.org/>
هر آنکسی که دراین حلقه نیست زنده به عشق
بر او نمرده به فتوی من نماز کنید
--
Liam Kirsher
PGP: http://liam.numenet.com/pgp/
------------------------------------------------------------------------------
Learn Windows Azure Live! Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and what it
provides. You can attend the event by watching it streamed LIVE online.
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion