User

Difference between revisions of "Yug/Gallery"

< User:Yug

(Created page with "=== ✅ Speakers → missing gender value === :''This query returns speakers who have missing gender value. See also Help:SPARQL#Is_Sex_or_Gender_.28Q7.29_.E2.86.92_List_exi...")
 
 
(13 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
   ?speaker prop:P2 entity:Q3 .
 
   ?speaker prop:P2 entity:Q3 .
 
   FILTER NOT EXISTS { ?speaker prop:P8 ?gender }
 
   FILTER NOT EXISTS { ?speaker prop:P8 ?gender }
   ?audio prop:P5 ?speaker .  # Filter: P5 'speaker' is Q445757 'SangeetaRH‎'
+
   ?audio prop:P5 ?speaker .  # Filter: P5 'speaker'
   ?audio prop:P4 ?language .  # Filter: P4 'language' is Q34 'Marathi'
+
   ?audio prop:P4 ?language .  # Filter: P4 'language'
 
   # Add labels
 
   # Add labels
 
   SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"}  
 
   SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"}  
Line 23: Line 23:
 
   ?speaker prop:P2 entity:Q3 .
 
   ?speaker prop:P2 entity:Q3 .
 
   FILTER NOT EXISTS { ?speaker prop:P8 ?gender }
 
   FILTER NOT EXISTS { ?speaker prop:P8 ?gender }
   ?audio prop:P5 ?speaker .  # Filter: P5 'speaker' is Q445757 'SangeetaRH‎'
+
   ?audio prop:P5 ?speaker .  # Filter: P5 'speaker'
 
   ?audio prop:P4 ?language .  # Filter: P4 'language' is Q34 'Marathi'
 
   ?audio prop:P4 ?language .  # Filter: P4 'language' is Q34 'Marathi'
 
   # Add labels
 
   # Add labels
Line 33: Line 33:
 
|}
 
|}
  
=== Language LL Qid (Q209) → List speakers ===
+
=== Is Sex or Gender ([[Q7]]) → List existing sexes or genders ===
 
''This query is going to be DEPRECATED as the queried data will no longer be available.''
 
''This query is going to be DEPRECATED as the queried data will no longer be available.''
 
{| style="width:100%"  
 
{| style="width:100%"  
Line 39: Line 39:
 
|style="padding: 0 3em;width:60%"|
 
|style="padding: 0 3em;width:60%"|
 
<syntaxhighlight lang="sparql">
 
<syntaxhighlight lang="sparql">
SELECT ?language ?speaker ?speakerLabel
+
SELECT ?item ?itemLabel
 +
WHERE {
 +
  ?item prop:P2 entity:Q7    # Filter: P2 'instance of' is Q7 'sex or gender'.
 +
  # Add labels to each variable used.
 +
  SERVICE wikibase:label {
 +
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
 +
  }
 +
}
 +
</syntaxhighlight>
 +
|
 +
<query _pagination="10" item="Property" itemLabel="Values">
 +
SELECT ?item ?itemLabel
 +
WHERE {
 +
  ?item prop:P2 entity:Q7    # Filter: P2 'instance of' is Q7 'sex or gender'.
 +
  # Add labels to each variable used.
 +
  SERVICE wikibase:label {
 +
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
 +
  }
 +
}
 +
</query>
 +
|}
 +
 
 +
=== Language LL Qid → List speakers ===
 +
''This query is going to be DEPRECATED as the queried data will no longer be available.''
 +
{| style="width:100%"
 +
|- style="vertical-align:top;"
 +
|style="padding: 0 3em;width:60%"|
 +
<syntaxhighlight lang="sparql">
 +
SELECT ?language ?speaker ?speakerLabel ?genderLabel (COUNT(?audio) AS ?audio)
 
WHERE {
 
WHERE {
 
   VALUES ?language { entity:Q150 }
 
   VALUES ?language { entity:Q150 }
 
   ?speaker prop:P2 entity:Q3 .  # P2 'instance of' is Q3 'speaker'
 
   ?speaker prop:P2 entity:Q3 .  # P2 'instance of' is Q3 'speaker'
   ?speaker prop:P4 ?language .  # P4 'language' is Q34 'Marathi'
+
   ?speaker prop:P4 ?language .  # P4 'language'
   # Labels
+
  ?speaker prop:P8 ?gender .  # P8 'language'
 +
  # Audios
 +
  ?audio prop:P5 ?speaker .  # Filter: P5 'speaker'
 +
  ?audio prop:P4 ?language .  # Filter: P4 'language'
 +
  # Add labels
 +
  SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"}
 +
}
 +
GROUP BY ?language ?speaker ?speakerLabel ?genderLabel
 +
ORDER BY DESC (?audio)
 +
</syntaxhighlight>
 +
|
 +
<query _pagination="10" item="Property" itemLabel="Values">
 +
SELECT ?language ?speaker ?speakerLabel ?genderLabel (COUNT(?audio) AS ?audio)
 +
WHERE {
 +
  VALUES ?language { entity:Q38 }
 +
  ?speaker prop:P2 entity:Q3 .  # P2 'instance of' is Q3 'speaker'
 +
  ?speaker prop:P4 ?language .  # P4 'language'
 +
  ?speaker prop:P8 ?gender .  # P8 'language'
 +
  # Audios
 +
  ?audio prop:P5 ?speaker .  # Filter: P5 'speaker'
 +
  ?audio prop:P4 ?language .  # Filter: P4 'language'
 +
  # Add labels
 +
  SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"}
 +
}
 +
GROUP BY ?language ?speaker ?speakerLabel ?genderLabel
 +
ORDER BY DESC (?audio)
 +
</query>
 +
|}
 +
 
 +
=== Speaker Qid + Language LL Qid → List records ===
 +
''This query is going to be DEPRECATED as the queried data will no longer be available.''
 +
{| style="width:100%"
 +
|- style="vertical-align:top;"
 +
|style="padding: 0 3em;width:60%"|
 +
<syntaxhighlight lang="sparql">
 +
SELECT ?speakerLabel ?languageLabel ?audioLabel ?filename
 +
WHERE {
 +
  VALUES ?speakers { entity:Q214043 entity:Q43323 }
 +
  ?audio prop:P5 ?speakers .  # Filter: P5 Speaker
 +
  ?audio prop:P5 ?speaker .  # Filter: P5 Speaker
 +
  ?audio prop:P4 ?language .  # Filter: P4 language
 +
  ?audio prop:P3 ?filename .
 +
  # ?speaker prop:P8 ?gender
 +
   # Add labels
 
   SERVICE wikibase:label {
 
   SERVICE wikibase:label {
 
     bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
 
     bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
Line 51: Line 122:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
|
 
|
<query _pagination="6" item="Property" itemLabel="Values">
+
<query _pagination="10" item="Property" itemLabel="Values">
SELECT ?language ?speaker ?speakerLabel
+
SELECT ?speakerLabel ?languageLabel ?audioLabel ?filename
 
WHERE {
 
WHERE {
   VALUES ?language { entity:Q150 }
+
   VALUES ?speakers { entity:Q214043 entity:Q43323 entity:Q405732 entity:Q5018 }
   ?speaker prop:P2 entity:Q3 . # P2 'instance of' is Q3 'speaker'
+
   ?audio prop:P5 ?speakers .  # Filter: P5 Speaker
   ?speaker prop:P4 ?language . # P4 'language' is Q34 'Marathi'
+
  ?audio prop:P5 ?speaker .   # Filter: P5 Speaker
   # Labels
+
   ?audio prop:P4 ?language .   # Filter: P4 language
 +
  ?audio prop:P3 ?filename .
 +
  # ?speaker prop:P8 ?gender
 +
   # Add labels
 
   SERVICE wikibase:label {
 
   SERVICE wikibase:label {
 
     bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
 
     bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
 
   }  
 
   }  
}</query>
+
}
 +
</query>
 +
|}
 +
 
 +
=== ✅ Languages with media type video → written word (P7), url (P3) speakers (P5) ===
 +
{| style="width:100%"
 +
|- style="vertical-align:top;"
 +
|style="padding: 0 3em;width:60%"|
 +
<syntaxhighlight lang="sparql">
 +
SELECT ?word ?filename ?speaker WHERE {
 +
  ?record prop:P4 entity:Q99628 .
 +
  ?record prop:P2 entity:Q2 .
 +
  ?record prop:P7 ?word .
 +
  ?record prop:P3 ?filename .
 +
  ?record prop:P5 ?speakerItem .
 +
  ?speakerItem rdfs:label
 +
  ?speaker filter ( lang( ?speaker ) = "en" ) .
 +
}
 +
</syntaxhighlight>
 +
||
 +
<query _pagination="5">
 +
SELECT ?word ?filename ?speaker WHERE {
 +
  ?record prop:P4 entity:Q99628 .
 +
  ?record prop:P2 entity:Q2 .
 +
  ?record prop:P7 ?word .
 +
  ?record prop:P3 ?filename .
 +
  ?record prop:P5 ?speakerItem .
 +
  ?speakerItem rdfs:label
 +
  ?speaker filter ( lang( ?speaker ) = "en" ) .
 +
}
 +
</query>
 
|}
 
|}

Latest revision as of 08:33, 11 August 2022

✅ Speakers → missing gender value

This query returns speakers who have missing gender value. See also list of genders.
SELECT ?speaker ?speakerLabel ?gender ?language ?languageLabel (COUNT(?audio) AS ?audio)
WHERE {
  ?speaker prop:P2 entity:Q3 .
  FILTER NOT EXISTS { ?speaker prop:P8 ?gender }
  ?audio prop:P5 ?speaker .   # Filter: P5 'speaker'
  ?audio prop:P4 ?language .  # Filter: P4 'language'
  # Add labels
  SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"} 
}
GROUP BY ?speaker ?speakerLabel ?genderLabel ?language ?languageLabel  # Sorting first groups per language and speaker
ORDER BY DESC (?audio)
... Loading ...

Is Sex or Gender (sex or gender (Q7)) → List existing sexes or genders

This query is going to be DEPRECATED as the queried data will no longer be available.

SELECT ?item ?itemLabel
WHERE {
  ?item prop:P2 entity:Q7    # Filter: P2 'instance of' is Q7 'sex or gender'.
  # Add labels to each variable used.
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
  } 
}
... Loading ...

Language LL Qid → List speakers

This query is going to be DEPRECATED as the queried data will no longer be available.

SELECT ?language ?speaker ?speakerLabel ?genderLabel (COUNT(?audio) AS ?audio)
WHERE {
  VALUES ?language { entity:Q150 }
  ?speaker prop:P2 entity:Q3 .  # P2 'instance of' is Q3 'speaker'
  ?speaker prop:P4 ?language .  # P4 'language'
  ?speaker prop:P8 ?gender .  # P8 'language'
  # Audios
  ?audio prop:P5 ?speaker .   # Filter: P5 'speaker'
  ?audio prop:P4 ?language .  # Filter: P4 'language'
  # Add labels
  SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"} 
}
GROUP BY ?language ?speaker ?speakerLabel ?genderLabel
ORDER BY DESC (?audio)
... Loading ...

Speaker Qid + Language LL Qid → List records

This query is going to be DEPRECATED as the queried data will no longer be available.

SELECT ?speakerLabel ?languageLabel ?audioLabel ?filename
WHERE {
  VALUES ?speakers { entity:Q214043 entity:Q43323 }
  ?audio prop:P5 ?speakers .   # Filter: P5 Speaker
  ?audio prop:P5 ?speaker .   # Filter: P5 Speaker
  ?audio prop:P4 ?language .   # Filter: P4 language
  ?audio prop:P3 ?filename . 
  # ?speaker prop:P8 ?gender
  # Add labels
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
  } 
}
... Loading ...

✅ Languages with media type video → written word (P7), url (P3) speakers (P5)

SELECT ?word ?filename ?speaker WHERE { 
  ?record prop:P4 entity:Q99628 . 
  ?record prop:P2 entity:Q2 . 
  ?record prop:P7 ?word . 
  ?record prop:P3 ?filename . 
  ?record prop:P5 ?speakerItem . 
  ?speakerItem rdfs:label 
  ?speaker filter ( lang( ?speaker ) = "en" ) . 
}
... Loading ...