Help

Difference between revisions of "SPARQL"

Line 13: Line 13:
 
SELECT ?item ?itemLabel
 
SELECT ?item ?itemLabel
 
WHERE {
 
WHERE {
   ?item prop:P2* entity:Q7
+
   ?item prop:P2/prop:P9 * entity:Q7
 
   SERVICE wikibase:label {
 
   SERVICE wikibase:label {
 
     bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
 
     bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
Line 20: Line 20:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
|
 
|
<query _pagination="5" item="Property" itemLabel="Values">
+
<query _pagination="6" item="Property" itemLabel="Values">
 
SELECT ?item ?itemLabel
 
SELECT ?item ?itemLabel
 
WHERE {
 
WHERE {
Line 30: Line 30:
 
</query>
 
</query>
 
|}
 
|}
 +
 
== ✅ Query → list all speakers ==
 
== ✅ Query → list all speakers ==
 
{|  
 
{|  

Revision as of 23:45, 3 December 2021

Base

✅ Property Gender(Q7) → list all possible values

SELECT ?item ?itemLabel
WHERE {
  ?item prop:P2/prop:P9 * entity:Q7
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
  } 
}
... Loading ...

✅ Query → list all speakers

select ?locutor ?locutorLabel
where {
  ?locutor prop:P2 entity:Q3 .
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
  } 
}
... Loading ...