Created
November 23, 2024 02:00
-
-
Save rolandcrosby/2a8852e3f7273289a97fa31e567fd5e7 to your computer and use it in GitHub Desktop.
Movies with the longest duration between the original and the sequel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ?original ?sequel ?originalLabel ?sequelLabel (min(?originalDates) AS ?originalDate) (min(?sequelDates) AS ?sequelDate) | |
WHERE | |
{ | |
?sequel wdt:P155 ?original . | |
?original wdt:P31/wdt:P279* wd:Q11424 . | |
?sequel wdt:P31/wdt:P279* wd:Q11424 . | |
?original wdt:P577 ?originalDates . | |
?sequel wdt:P577 ?sequelDates . | |
?original rdfs:label ?originalLabel . | |
?sequel rdfs:label ?sequelLabel | |
FILTER NOT EXISTS { ?original wdt:P155 ?prequel } | |
FILTER(LANG(?originalLabel) = "en") | |
FILTER(LANG(?sequelLabel) = "en") | |
FILTER(datatype(?originalDates) = xsd:dateTime) | |
FILTER(datatype(?sequelDates) = xsd:dateTime) | |
} | |
GROUP BY ?original ?originalLabel ?sequel ?sequelLabel | |
ORDER BY (YEAR(?originalDate) - YEAR(?sequelDate)) | |
LIMIT 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment