Wikidata:WikiProject Performing arts/Tools & tasks

From Wikidata
Jump to navigation Jump to search

Pfeil oben.svg

 

Home

 

Data Structure

 

Typology

 

Data Sources

 

Use Cases

 

Tools & Tasks

 

Statistics

 

Tools for Entity Extraction[edit]

  • Role Extractor Script – tool used to extract data about roles from Wikipedia articles about plays (operas, musicals, theatre plays, etc.), to match the data against existing data in Wikidata, and to produce QuickStatements code to add new items to Wikidata and to complement existing ones.

Sample Queries[edit]

Theatre Troupes in Switzerland[edit]

SELECT DISTINCT ?item ?itemLabel ?typeLabel ?municipalityLabel ?cantonLabel 
WHERE
{
  {?item wdt:P31 wd:Q2416217}.
  {?item wdt:P131/wdt:P17 wd:Q39 } UNION {?item wdt:P17 wd:Q39}.
  
  OPTIONAL{?item wdt:P31 ?type}
  OPTIONAL { ?item wdt:P131 ?municipality . FILTER EXISTS {?municipality wdt:P31 wd:Q70208} }
  OPTIONAL { ?item wdt:P131 ?canton . FILTER EXISTS {?canton wdt:P31 wd:Q23058} }
  
  SERVICE wikibase:label {bd:serviceParam wikibase:language"en,de".}
}

Try it!

Performing Arts Productions Produced by Schauspielhaus Zürich[edit]

SELECT DISTINCT ?item ?itemLabel ?date_of_first_performance ?native_label ?production_company ?production_companyLabel WHERE {
  ?item (wdt:P31/wdt:P279*) wd:Q43099500.
  ?item wdt:P272 wd:Q40313234.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de". }
  OPTIONAL { ?item wdt:P1191 ?date_of_first_performance. }
  OPTIONAL { ?item wdt:P1705 ?native_label. }
  OPTIONAL { ?item wdt:P272 ?production_company. }
}

Try it!

Operas in the Order of their First Performance[edit]

SELECT (replace(group_concat(distinct ?composer;separator="; "), "http://www.wikidata.org/entity/", "") as ?composers)  #Strip the path in order to get only the Q-number.
       (group_concat(distinct ?composerLabel;separator="; ") as ?composerLabels)
       ?opera 
       ?operaLabel 
       ?languageLabel 
       ?worldpremiere
WHERE 
{
  ?opera wdt:P31/wdt:P279* wd:Q1344.
  ?opera wdt:P1191 ?worldpremiere .
  OPTIONAL { ?opera wdt:P86 ?composer }
  OPTIONAL { ?opera wdt:P86/rdfs:label ?composerLabel . FILTER (lang(?composerLabel) = "en") }
  OPTIONAL { ?opera wdt:P407 ?language }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,fr,it,es,ru" }
}
GROUP BY ?opera
         ?operaLabel
         ?languageLabel 
         ?worldpremiere

ORDER BY ASC(?worldpremiere)

Try it!

Wikidata items with statements that are referenced to the Opera Database[edit]

SELECT DISTINCT ?item ?itemLabel ?typeLabel
WHERE {
               ?item ?prop ?statement .
               ?item wdt:P31 ?type .
               ?statement prov:wasDerivedFrom ?reference .
               ?reference pr:P248 wd:Q54366466
               SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

Try it!

Exploration of the Ontology[edit]

Properties had by music venue (Q8719053) and its subclasses (apart from instance of (P31))[edit]

SELECT ?prop ?propLabel (COUNT(?music_venue) AS ?count) WHERE {
?music_venue wdt:P31/wdt:P279? wd:Q8719053 ; # music venues or 1st-level subtypes
?p [].
?prop wikibase:directClaim ?p FILTER (?prop != wd:P31)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?prop ?propLabel
ORDER BY DESC(?count)

Try it!

Properties had by theatre (Q24354) and its subclasses (apart from instance of (P31))[edit]

SELECT ?prop ?propLabel (COUNT(?theater) AS ?count) WHERE {
?theater wdt:P31/wdt:P279? wd:Q24354 ; # theaters or 1st-level subtypes
?p [].
?prop wikibase:directClaim ?p FILTER (?prop != wd:P31)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?prop ?propLabel
ORDER BY DESC(?count)

Try it!

Properties of performing arts production (Q43099500) and its subclasses[edit]

SELECT ?property ?propertyLabel ?count WITH {
  SELECT ?property (COUNT(DISTINCT ?statement) AS ?count) WHERE {
    ?item wdt:P31/wdt:P279* wd:Q43099500;
          ?p ?statement.
    ?property a wikibase:Property;
              wikibase:claim ?p.
    FILTER(?property != wd:P31)
  }
  GROUP BY ?property
  ORDER BY DESC(?count)
  LIMIT 200
} AS %results WHERE {
  INCLUDE %results.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-GB,en,en". }
}
ORDER BY DESC(?count)

Try it!

Items of the class performing arts production (Q43099500) with the property composer (P86)[edit]

SELECT DISTINCT ?item ?itemLabel 
WHERE 
{
  ?item wdt:P31/wdt:P279* wd:Q43099500;
        wdt:P86 ?o.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Items of the class performing arts production (Q43099500) with properties composer (P86), librettist (P87), choreographer (P1809), screenwriter (P58), author (P50), or creator (P170)[edit]

These properties are potentially problematic as they should only be directly associated with items of the class theatrical production (Q7777570) if they are not associated with the work the item is based on. Otherwise they should be indicated for the work. Some of the items corresponding to the criteria of this query may actually be theatrical, choreographic and/or musical works and not theatrical productions.

SELECT DISTINCT ?item ?itemLabel 
WHERE 
{
  { ?item wdt:P31/wdt:P279* wd:Q43099500;
        wdt:P86 ?o. }
  UNION { ?item wdt:P31/wdt:P279* wd:Q43099500;
                wdt:P87 ?o. }  
  UNION { ?item wdt:P31/wdt:P279* wd:Q43099500;
                wdt:P1809 ?o. }
  UNION { ?item wdt:P31/wdt:P279* wd:Q43099500;
                wdt:P58 ?o. }
  UNION { ?item wdt:P31/wdt:P279* wd:Q43099500;
                wdt:P50 ?o. }
  UNION { ?item wdt:P31/wdt:P279* wd:Q43099500;
                wdt:P170 ?o. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!


Properties of performance (Q35140) and its subclasses[edit]

SELECT ?property ?propertyLabel ?count WITH {
  SELECT ?property (COUNT(DISTINCT ?statement) AS ?count) WHERE {
    ?item wdt:P31/wdt:P279* wd:Q35140;
          ?p ?statement.
    ?property a wikibase:Property;
              wikibase:claim ?p.
    FILTER(?property != wd:P31)
  }
  GROUP BY ?property
  ORDER BY DESC(?count)
  LIMIT 200
} AS %results WHERE {
  INCLUDE %results.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-GB,en,en". }
}
ORDER BY DESC(?count)

Try it!

Properties of series of performances (Q43100730) and its subclasses[edit]

SELECT ?property ?propertyLabel ?count WITH {
  SELECT ?property (COUNT(DISTINCT ?statement) AS ?count) WHERE {
    ?item wdt:P31/wdt:P279* wd:Q43100730;
          ?p ?statement.
    ?property a wikibase:Property;
              wikibase:claim ?p.
    FILTER(?property != wd:P31)
  }
  GROUP BY ?property
  ORDER BY DESC(?count)
  LIMIT 200
} AS %results WHERE {
  INCLUDE %results.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-GB,en,en". }
}
ORDER BY DESC(?count)

Try it!

Subclasses of Fach (Q1748957) (voice type)[edit]

SELECT ?item ?itemLabel 
WHERE 
{
  ?item wdt:P31/wdt:P279* wd:Q1748957.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Items with a voice type (P412) or a Fach (P1731) property[edit]

#Humans with a voice tpye (P412) property.
SELECT ?singer ?singerLabel ?voiceType ?voiceTypeLabel 
WHERE 
{
  ?singer wdt:P31/wdt:P279* wd:Q5.
  ?singer wdt:P412 ?voiceType.
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

#Humans with a Fach (P1731) property.
SELECT ?singer ?singerLabel ?fach ?fachLabel 
WHERE 
{
  ?singer wdt:P31/wdt:P279* wd:Q5.
  ?singer wdt:P1731 ?fach.
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

# Humans with a voice type (P412) and a Fach (P1731) property.
SELECT ?singer ?singerLabel ?voiceType ?voiceTypeLabel ?fach ?fachLabel
WHERE 
{
  ?singer wdt:P31/wdt:P279* wd:Q5.
  ?singer wdt:P412 ?voiceType.
  ?singer wdt:P1731 ?fach.
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

#Operatic characters with a voice type (P412) property.
SELECT ?character ?characterLabel ?voiceType ?voiceTypeLabel 
WHERE 
{
  ?character wdt:P31/wdt:P279* wd:Q50386450.
  ?character wdt:P412 ?voiceType.
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

#Operatic characters with a Fach (P1731) property.
SELECT ?character ?characterLabel ?fach ?fachLabel 
WHERE 
{
  ?character wdt:P31/wdt:P279* wd:Q50386450.
  ?character wdt:P1731 ?fach.
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!


Usage statistics for voice type (P412) and Fach (P1731)[edit]

#Voice types of humans in the order of frequency of use.
SELECT ?value ?valueLabel ?count WITH {
  SELECT ?value (COUNT(DISTINCT ?singer) AS ?count) WHERE {
    ?singer wdt:P31/wdt:P279* wd:Q5.
    ?singer wdt:P412 ?value.
    }
  GROUP BY ?value
  ORDER BY DESC(?count)
  LIMIT 100
} AS %results WHERE {
  INCLUDE %results.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-US,en,en". }
}
ORDER BY DESC(?count)

Try it!

#Fach of humans in the order of frequency of use.
SELECT ?value ?valueLabel ?count WITH {
  SELECT ?value (COUNT(DISTINCT ?singer) AS ?count) WHERE {
    ?singer wdt:P31/wdt:P279* wd:Q5.
    ?singer wdt:P1731 ?value.
    }
  GROUP BY ?value
  ORDER BY DESC(?count)
  LIMIT 100
} AS %results WHERE {
  INCLUDE %results.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-US,en,en". }
}
ORDER BY DESC(?count)

Try it!

#Voice types of operatic characters in the order of frequency of use.
SELECT ?value ?valueLabel ?count WITH {
  SELECT ?value (COUNT(DISTINCT ?character) AS ?count) WHERE {
    ?character wdt:P31/wdt:P279* wd:Q50386450.
    ?character wdt:P412 ?value.
    }
  GROUP BY ?value
  ORDER BY DESC(?count)
  LIMIT 100
} AS %results WHERE {
  INCLUDE %results.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-US,en,en". }
}
ORDER BY DESC(?count)

Try it!

#Fach of operatic characters in the order of frequency of use.
SELECT ?value ?valueLabel ?count WITH {
  SELECT ?value (COUNT(DISTINCT ?character) AS ?count) WHERE {
    ?character wdt:P31/wdt:P279* wd:Q50386450.
    ?character wdt:P1731 ?value.
    }
  GROUP BY ?value
  ORDER BY DESC(?count)
  LIMIT 100
} AS %results WHERE {
  INCLUDE %results.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-US,en,en". }
}
ORDER BY DESC(?count)

Try it!