Help

Difference between revisions of "SPARQL"

(Created page with "== Base == * Special:ListProperties ** List of properties with possible values. Ex: Gender (sex or gender (P8)) : male (male (Q16)), female (female (Q17)), intersex (intersex (Q18)). * ...")
 
Line 5: Line 5:
 
* [[DataViz:Speakers]]
 
* [[DataViz:Speakers]]
 
* [[DataViz:Records]]
 
* [[DataViz:Records]]
 +
 +
== ✅ Property Gender(Q7) → list all possible values ==
 +
<syntaxhighlight lang="sparql">
 +
SELECT ?item ?itemLabel
 +
WHERE {
 +
  ?item prop:P2* entity:Q7
 +
  SERVICE wikibase:label {
 +
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
 +
  }
 +
}
 +
</syntaxhighlight>
 +
 +
<br>
 +
<query _pagination="5" item="Property" itemLabel="Values">
 +
SELECT ?item ?itemLabel
 +
WHERE {
 +
  ?item prop:P2* entity:Q7
 +
  SERVICE wikibase:label {
 +
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
 +
  }
 +
}
 +
</query>
  
 
== ✅ Query → list all speakers ==
 
== ✅ Query → list all speakers ==
Line 27: Line 49:
 
}
 
}
 
</query>
 
</query>
 +
<!--
 
== Speaker name → Speaker Qid ==
 
== Speaker name → Speaker Qid ==
 
== Speaker Qid → Speaker data ==
 
== Speaker Qid → Speaker data ==
Line 41: Line 64:
 
== Tools ==
 
== Tools ==
 
* [[Special:ApisSandbox]] – API queries generator for Lingualibre wikipage and wikibase contents.
 
* [[Special:ApisSandbox]] – API queries generator for Lingualibre wikipage and wikibase contents.
 +
-->

Revision as of 23:34, 3 December 2021

Base

✅ Property Gender(Q7) → list all possible values

SELECT ?item ?itemLabel
WHERE {
  ?item prop:P2* 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 ...