0

I'm trying to retrieve a list of points of interests of a given class or subclass (museum, skyscraper, etc.) in a given city and to display for each of them:

  • The list of translated labels in all known languages in a single row (for eg. "Statue of Liberty[en]___Freiheitsstatue[de]___Statua della libertà[it]")
  • The latitude and longitude
  • Other properties (for example the height of skyscrapers, if any)

What I did so far is:

SELECT DISTINCT ?item (GROUP_CONCAT(DISTINCT ?lbl; separator='___') AS ?label) WHERE {
  ?item wdt:P131* wd:Q61 .
  ?item wdt:P31/wdt:P279* wd:Q33506 .
  ?item rdfs:label ?l .
  BIND(CONCAT(STR(?l), ' (', LANG(?l), ')') AS ?lbl)
}
GROUP BY ?item

View on Wikidata

How can I add the other info?

logi-kal
  • 7,107
  • 6
  • 31
  • 43
Davide
  • 764
  • 1
  • 6
  • 18
  • By "other properties" you mean anything else about POI? And do you really need anything in a single row? Like you did for the labels. – UninformedUser Mar 21 '17 at 12:18
  • Yes, if possible I would like to show them in a single row, like I did with the labels. By other properties I mean some properties that I will select to show. I just don't know how to query them in order to show in a separate column. – Davide Mar 21 '17 at 12:51
  • Well, it's just to add another triple pattern, e.g. for a property `wdt:P11` you just add `?item wdt:P11 ?valP11 .`. But if the property has multiple values, you need to add `GROUP_CONCAT` again, otherwise, you get multiple rows for the same item, with each row showing another value of the property. – UninformedUser Mar 22 '17 at 06:33

0 Answers0