General parameters of the stagings
Back to the overview of all query topics: back
Which productions had the most/fewest performances?
PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>
SELECT ?production ?productionLabel ?numberOfPerformances WHERE {
?production wdt:P3 wd:Q309. # Production is a production [Q309]
?production wdt:P16 ?numberOfPerformances. # Production has a number of performances [P16]
SERVICE wikibase:label { # Adds readable labels
bd:serviceParam wikibase:language "en".
}
}
ORDER BY DESC(?numberOfPerformances) # Sort by number of performances (DESC = highest first)
LIMIT 1 # Show only the top result
In line 10, leave ‘DESC’ for most performances and insert ‘ASC’ for the lowest number of performances at this point.
In line 11: To display all productions including their number of performances, delete ‘LIMIT 1’.
Click here: Test SPARQL query
How long did the longest/shortest performance of the productions listed here last?
PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>
SELECT ?production ?productionLabel ?duration WHERE {
?production wdt:P3 wd:Q309. # Production is a production [Q309]
?production wdt:P22 ?duration. # Production has a duration [P22]
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en".
}
}
ORDER BY DESC(?duration) # Orders results by descending duration (DESC for longest, ASC for shortest)
LIMIT 1 # Only returns the production with the longest/shortest duration
In line 10, leave ‘DESC’ for the longest performance duration and insert ‘ASC’ for the shortest performance duration at this point.
In line 11: To display all productions including their performance duration, delete ‘LIMIT 1’.
Click here: Test SPARQL query
How long did the average performance of the productions listed here last?
PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>
SELECT (AVG(?duration) AS ?averageDuration) WHERE { # AVG(?duration) = average duration, stored as ?averageDuration
?production wdt:P3 wd:Q309. # Production is a production [Q309]
?production wdt:P22 ?duration. # Production has a duration [P22]
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en".
}
}
After line 5, ‘?production wdt:P4 wd:Q309.’ can be inserted if the query should only refer to productions based on the literary template ‘Terror’ (as soon as further productions are modelled on this Wikibase instance that also refer to other works).
Click here: Test SPARQL query
Which production had an interval/no intermission?
PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>
SELECT ?production ?productionLabel ?intermission WHERE {
?production wdt:P3 wd:Q309. # Production is a production [Q309]
?production wdt:P34 ?intermission. # Production has a number of intermissions
FILTER (?intermission = 0) # Filters productions with 0 intermissions (1 for one intermission, etc.)
SERVICE wikibase:label { # Adds readable labels
bd:serviceParam wikibase:language "en".
}
}
Click here: Test SPARQL queryIn line 6 under FILTER (?pause = 0), leave the number at 0 for zero pauses, 1 for one pause, 2 for two pauses, etc.
Visualisation of performance data as a scatter chart and timeline
PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>
#defaultView:ScatterChart
SELECT ?date ?productionLabel ?venueLabel WHERE {
?production wdt:P37 ?date. # Production has a performance date [P37]
?production wdt:P8 ?venue. # Production has a venue [P8]
SERVICE wikibase:label { # Adds readable labels
bd:serviceParam wikibase:language "en".
}
}
ORDER BY ?date
Click here: Test SPARQL query
Timeline:
PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>
#defaultView:Timeline
SELECT ?date ?productionLabel ?venueLabel WHERE {
?production wdt:P37 ?date. # Production has a performance date [P37]
?production wdt:P8 ?venue. # Production has a venue [P8]
SERVICE wikibase:label { # Adds readable labels
bd:serviceParam wikibase:language "en".
}
}
ORDER BY ?date
Click here: Test SPARQL query