Wikidata:WikiProject Performing arts/Tools & tasks

From Wikidata
Jump to navigation Jump to search

 

Home

 

Data Structure

 

Typologies

 

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.

Wikidata-Driven Infoboxes[edit]

Here is a list of relevant infoboxes for performing arts related articles in Wikipedia. Please feel free to edit and expand this list.

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!

Sample Queries in View of the Creation of the SAPA "Panorama" Portal[edit]

Performing Arts Productions (Co-)Produced by a Swiss Production Company[edit]

SELECT DISTINCT ?item ?itemLabel ?date_of_first_performance ?native_label ?production_company ?production_companyLabel WHERE {
  ?item (wdt:P31/wdt:P279*) wd:Q43099500.   #performing arts production
  ?item wdt:P272/wdt:P131*/wdt:P17 wd:Q39.  #production company located in Switzerland
  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!

Requirements: To be included in the selection, items need to have a production company (P272) statement; furthermore, the item of the production company needs to have a located in the administrative territorial entity (P131) or a country (P17) statement.

Notes:

  • The selection includes all types of "performing arts" productions, including music productions without staging.
  • The query generates multiple entries if a production has several (co-)producers.

Performing Arts Productions which Have Premiered in Switzerland[edit]

SELECT DISTINCT ?item ?itemLabel ?date_of_first_performance ?native_label ?production_company ?production_companyLabel WHERE {
  ?item (wdt:P31/wdt:P279*) wd:Q43099500.   #performing arts production
  ?item wdt:P4647/(wdt:P276|wdt:P131)*/wdt:P17 wd:Q39.  #venue of first performance located in Switzerland
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de". }
  OPTIONAL { ?item wdt:P1191 ?date_of_first_performance. }
  OPTIONAL { ?item wdt:P1705 ?native_label. }
  OPTIONAL { ?item wdt:P272 ?production_company. }
  }
Try it!

Requirements: To be included in the selection, items need to have a location of first performance (P4647) statement; furthermore, the venue needs to have a located in the administrative territorial entity (P131), a location (P276) or a country (P17) statement.

Notes:

  • The selection includes all types of "performing arts" productions, including music productions without staging.
  • The query generates multiple entries if a production has several (co-)producers.

Performing Arts Productions which Have Taken Place in Switzerland[edit]

SELECT DISTINCT ?item ?itemLabel ?date_of_first_performance ?native_label ?production_company ?production_companyLabel WHERE {
  ?item (wdt:P31/wdt:P279*) wd:Q43099500.   #performing arts production
  ?item (wdt:P276|wdt:P131)*/wdt:P17 wd:Q39.  #venue located in Switzerland
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de". }
  OPTIONAL { ?item wdt:P1191 ?date_of_first_performance. }
  OPTIONAL { ?item wdt:P1705 ?native_label. }
  OPTIONAL { ?item wdt:P272 ?production_company. }
  }
Try it!

Requirements: To be included in the selection, items need to have a located in the administrative territorial entity (P131), a location (P276), or a country (P17) statement.

Notes:

  • The selection includes all types of "performing arts" productions, including music productions without staging.
  • The query generates multiple entries if a production has several (co-)producers.

Staged Performing Arts Productions (Co-)Produced by a Swiss Production Company[edit]

SELECT DISTINCT ?item ?itemLabel ?date_of_first_performance WHERE {
  ?item (wdt:P31/wdt:P279*) wd:Q43099500.   #performing arts production
  MINUS { ?item (wdt:P31/wdt:P279*) wd:Q59163902 }  #filter out musical productions
  ?item wdt:P272/wdt:P131*/wdt:P17 wd:Q39.  #production company located in Switzerland
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de". }
  OPTIONAL { ?item wdt:P1191 ?date_of_first_performance. }
  }
Try it!

Requirements: To be included in the selection, items need to have a production company (P272) statement; furthermore, the item of the production company needs to have a located in the administrative territorial entity (P131) or a country (P17) statement.

Notes:

  • The selection includes all types of "performing arts" productions, at the exception of music productions (without staging); it may include operatic productions merely consisting of concert performances.

Actors and Actresses born in Switzerland and/or having Swiss Citizenship[edit]

SELECT ?item 
       ?itemLabel 
       ?birthplaceLabel 
       (group_concat(distinct ?citizenshipLabel_en;separator="; ") as ?citizenshipLabels_en)    #Concatenate the values in order not to get several rows per item.
WHERE 
{
  ?item wdt:P106 wd:Q33999.
  { ?item (wdt:P19/wdt:P131*/wdt:P17) wd:Q39 } UNION { ?item wdt:P27 wd:Q39 }.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Helps get the label in your language, if not, then en language
  OPTIONAL {?item wdt:P19 ?birthplace} .
  OPTIONAL {?item wdt:P27/rdfs:label ?citizenshipLabel_en . FILTER (lang(?citizenshipLabel_en) = "en") }
}
group by ?item                          #List all the variables for which the values are not concatenated!
         ?itemLabel
         ?birthplaceLabel
Try it!

Requirements: To be included in the selection, items need to have a occupation (P106) --> actor (Q33999) statement; furthermore, items need to have either a place of birth (P19) or a country of citizenship (P27) statement that matches the selection criterion (Switzerland).

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 building (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 vocal classification (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 vocal classification (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!