From WikiFur Data
Jump to navigation Jump to search

These SPARQL queries can be used in the local Query Service. See Wikidata's tutorial for an overview. The custom prefix declarations are required, and do not autocomplete (wd: does, but actually queries Wikidata).


Convention series with data and logo URL

PREFIX wfd: <>
PREFIX wfdt: <>

SELECT ?itemLabel ?creationDate (CONCAT("", substr(?logoMD5, 1, 1), "/", substr(?logoMD5, 1, 2), "/", ?logoFileName) AS ?logoURL)
    ?item wfdt:P2 wfd:Q2 .
    ?item wfdt:P6 ?creationDate .
      ?item wfdt:P15 ?logoFileName.
      BIND(MD5(?logoFileName) as ?logoMD5).
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
ORDER BY ?creationDate

Convention instances, including postponements

PREFIX wfd: <>
PREFIX wfdt: <>
PREFIX wfdp: <>
PREFIX wfdps: <>
PREFIX wfdpq: <>
SELECT ?eventInstanceLabel ?eventStart ?eventEnd ?eventRank ?eventSeriesLabel 
  #                subclass of furcons
  ?eventSeries     wfdt:P2 wfd:Q2.
  #                instance of specific furcon
  ?eventInstance   wfdt:P1 ?eventSeries;
  #                duplicate for each start time property
  #                (not wfdt: to get single eventStart)
                   wfdp:P6 ?eventStartProp.
  #                populate start time for the row with  this property
  ?eventStartProp  wfdps:P6 ?eventStart.
  #                normal or deprecated (rescheduled/cancelled)
  ?eventStartProp  wikibase:rank ?eventRank.
  #                grab end time as qualifier if present (else, one-day event)
  OPTIONAL {?eventStartProp wfdpq:P7 ?eventEnd}
  OPTIONAL {?eventInstance wfdt:P3 ?eventLocation}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
ORDER BY DESC(?eventInstanceLabel) DESC(?eventStart) DESC(?eventRank)