Project:SPARQL/examples: Difference between revisions

m
(Update query UI URI)
Tags: Mobile edit Mobile web edit Advanced mobile edit
m (→‎Convention instances, including postponements: switch to universal wfd prefix)
 
Line 25: Line 25:
PREFIX wfd: <https://furry.wikibase.cloud/entity/>
PREFIX wfd: <https://furry.wikibase.cloud/entity/>
PREFIX wfdt: <https://furry.wikibase.cloud/prop/direct/>
PREFIX wfdt: <https://furry.wikibase.cloud/prop/direct/>
PREFIX wfp: <https://furry.wikibase.cloud/prop/>
PREFIX wfdp: <https://furry.wikibase.cloud/prop/>
PREFIX wfps: <https://furry.wikibase.cloud/prop/statement/>
PREFIX wfdps: <https://furry.wikibase.cloud/prop/statement/>
PREFIX wfpq: <https://furry.wikibase.cloud/prop/qualifier/>
PREFIX wfdpq: <https://furry.wikibase.cloud/prop/qualifier/>
SELECT ?eventInstanceLabel ?eventStart ?eventEnd ?eventRank ?eventSeriesLabel  
SELECT ?eventInstanceLabel ?eventStart ?eventEnd ?eventRank ?eventSeriesLabel  
WHERE  
WHERE  
Line 37: Line 37:
   #                duplicate for each start time property
   #                duplicate for each start time property
   #                (not wfdt: to get single eventStart)
   #                (not wfdt: to get single eventStart)
                   wfp:P6 ?eventStartProp.
                   wfdp:P6 ?eventStartProp.
   #                populate start time for the row with  this property
   #                populate start time for the row with  this property
   ?eventStartProp  wfps:P6 ?eventStart.
   ?eventStartProp  wfdps:P6 ?eventStart.
   #                normal or deprecated (rescheduled/cancelled)
   #                normal or deprecated (rescheduled/cancelled)
   ?eventStartProp  wikibase:rank ?eventRank.
   ?eventStartProp  wikibase:rank ?eventRank.
   #                grab end time as qualifier if present (else, one-day event)
   #                grab end time as qualifier if present (else, one-day event)
   OPTIONAL {?eventStartProp wfpq:P7 ?eventEnd}
   OPTIONAL {?eventStartProp wfdpq:P7 ?eventEnd}
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
}
ORDER BY DESC(?eventInstanceLabel) DESC(?eventStart) DESC(?eventRank)
ORDER BY DESC(?eventInstanceLabel) DESC(?eventStart) DESC(?eventRank)
</SPARQL>
</SPARQL>
Bureaucrats, emailconfirmed, Administrators
272

edits