Last active
September 6, 2017 05:11
-
-
Save OdinsHat/d1b6ef97b535cf115fe2731d0793d737 to your computer and use it in GitHub Desktop.
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 ?item ?dt ?date (COUNT(distinct ?sitelink) as ?count) | |
WHERE { values ?offsetmin { "1920-02-27T00:00:00"^^xsd:dateTime }. values ?offset0 { "1920-02-17T00:00:00"^^xsd:dateTime }. values ?offsetmax { "1920-02-07T00:00:00"^^xsd:dateTime }. | |
VALUES ?filmtype {wd:Q11424 wd:Q24862 wd:Q506240 wd:Q336144} . | |
Bind((NOW() - ?offsetmin) as ?mintime). | |
Bind((NOW() - ?offsetmax) as ?maxtime). | |
?item wdt:P31 ?filmtype . | |
?item p:P577/psv:P577 ?date node . | |
?date node wikibase:timeValue ?date . | |
FILTER (?date > "2015-12-31T00:00:00Z"^^xsd:dateTime) ?date node wikibase:timePrecision "11"^^xsd:integer . Bind((?date - ?offset0) as ?datetime ). FILTER ( ?datetime > ?mintime ) . FILTER ( ?datetime < ?maxtime ) . BIND (SUBSTR(Str(?date),1,10) as ?dt) . OPTIONAL { ?sitelink <http://schema.org/about> ?item . } } | |
GROUP BY ?item ?dt ?date | |
ORDER BY ?dt |
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
PREFIX wikibase: <http://wikiba.se/ontology#> | |
PREFIX wd: <http://www.wikidata.org/entity/> | |
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
PREFIX p: <http://www.wikidata.org/prop/> | |
PREFIX q: <http://www.wikidata.org/prop/qualifier/> | |
PREFIX v: <http://www.wikidata.org/prop/statement/> | |
PREFIX pr: <http://www.wikidata.org/prop/reference/> | |
PREFIX prov: <http://www.w3.org/ns/prov#> | |
PREFIX psv: <http://www.wikidata.org/prop/statement/value/> | |
SELECT ?item ?dt ?date (COUNT(distinct ?sitelink) as ?count) WHERE { values ?offsetmin { "1920-02-27T00:00:00"^^xsd:dateTime }. values ?offset0 { "1920-02-17T00:00:00"^^xsd:dateTime }. values ?offsetmax { "1920-02-07T00:00:00"^^xsd:dateTime }. VALUES ?filmtype {wd:Q11424 wd:Q24862 wd:Q506240 wd:Q336144} . Bind((NOW() - ?offsetmin) as ?mintime). Bind((NOW() - ?offsetmax) as ?maxtime). ?item wdt:P31 ?filmtype . ?item p:P577/psv:P577 ?date_node . ?date_node wikibase:timeValue ?date . FILTER (?date > "2015-12-31T00:00:00Z"^^xsd:dateTime) ?date_node wikibase:timePrecision "11"^^xsd:integer . Bind((?date - ?offset0) as ?datetime ). FILTER ( ?datetime > ?mintime ) . FILTER ( ?datetime < ?maxtime ) . BIND (SUBSTR(Str(?date),1,10) as ?dt) . OPTIONAL { ?sitelink <http://schema.org/about> ?item . } } GROUP BY ?item ?dt ?date ORDER BY ?dt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment