query-8b03ca9b3f5e9897bf1f5aed7899e2b5
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?media ?title ?duration
WHERE
{
{
select ?media ?title where {
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam wikibase:endpoint "commons.wikimedia.org" .
bd:serviceParam mwapi:gcmtitle "Category:Media of the day" .
bd:serviceParam mwapi:generator "categorymembers" .
bd:serviceParam mwapi:gcmtype "file" .
bd:serviceParam mwapi:gcmlimit "max" .
?title wikibase:apiOutput mwapi:title .
?pageid wikibase:apiOutput "@pageid" .
}
BIND (URI(CONCAT('https://commons.wikimedia.org/entity/M', ?pageid)) AS ?media)
}
} ?media a schema:VideoObject .
?media schema:duration ?duration_ .
bind ("00:00:00"^^xsd:time + ?duration_ as ?duration)
}
order by desc(?duration)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?duration"):::projected
v5("?duration_")
v4("?media"):::projected
v3("?pageid")
v2("?title"):::projected
c14(["max"]):::literal
c10(["categorymembers"]):::literal
c2(["bd:serviceParam"]):::iri
c12(["file"]):::literal
c19(["schema:VideoObject"]):::iri
c8(["Category:Media of the day"]):::literal
c16(["mwapi:title"]):::iri
c6(["commons.wikimedia.org"]):::literal
c17(["@pageid"]):::literal
c4(["Generator"]):::literal
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c2 --"mwapi:api"--> c4
c2 --"mwapi:endpoint"--> c6
c2 --"mwapi:gcmtitle"--> c8
c2 --"mwapi:generator"--> c10
c2 --"mwapi:gcmtype"--> c12
c2 --"mwapi:gcmlimit"--> c14
v2 --"mwapi:apiOutput"--> c16
v3 --"mwapi:apiOutput"--> c17
end
bind0[/"concat('https://commons.wikimedia.org/entity/M',?pageid)"/]
v3 --o bind0
bind0 --as--o v4
v4 --"a"--> c19
v4 --"schema:duration"--> v5
bind1[/"'00:00:00^^xsd:time' + ?duration_"/]
v5 --o bind1
bind1 --as--o v6