Template:SPARQL/published in place

Template documentation[view] [edit] [history] [purge]


UsageEdit

SPARQL query for works with a place of publication (P291) of a place, or any place in that place.

Parameters:

  • 1: The Q-id of the place
  • name: Override for the place name (if not given: the label of 1 from Wikidata)

Example

{{SPARQL|query=
 {{SPARQL/published in place|Q724}}
}}
# Items published in Q724 (Maine)
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?page_titleWS where {
    VALUES ?Maine  { wd:Q724 }
    ?item wdt:P291/wdt:P131* ?Maine  . # P291 = published in

    OPTIONAL {
      ?article schema:about ?item;
      schema:isPartOf <https://en.wikisource.org/>;
      schema:name ?page_titleWS.
    }

    SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
Go to query page

See alsoEdit