POIs in and around Berlin

This example shows a search for instances of type odta:POI which are located within a radius of 15km around the coordinates 51.345545,12.37414, which is somewhere in Berlin.

We are searching for instances with the @type property and the sq:nearby function. The call looks as follows:

curl --location 'https://proxy.opendatagermany.io/api/ts/v2/kg/things?sortSeed=1&filterDsList=https://semantify.it/list/LRVOilZZ6&lang=de' \
--header 'Content-Type: application/ld+json' \
--header 'page-size: 50' \
--header 'page: 1' \
--header 'x-api-key: API_KEY' \
--data-raw '{
  "@context": {
    "ds": "https://vocab.sti2.at/ds/",
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "schema": "https://schema.org/",
    "sh": "http://www.w3.org/ns/shacl#",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "odta": "https://odta.io/voc/",
    "sq": "http://www.onlim.com/shapequery/",
    "@vocab": "http://www.onlim.com/shapequery/"
  },
  "sq:query": [
    {
      "@type": "odta:PointOfInterest",
      "schema:geo": {
        "sq:nearby": {
          "sq:latitude": "51.345545",
          "sq:longitude": "12.37414",
          "sq:distance": "15"
        }
      }
    }
  ]
}'

We get a response that looks something like this:

{
  "metaData": {
    "dsCount": {
      "https://semantify.it/ds/sloejGAwT": {
        "count": "123",
        "name": {
          "de": "Sehenswürdigkeit"
        }
      }
    },
    "page-size": 50,
    "sortSeed": "1",
    "total": 518,
    "current-page": 1
  },
  "data": [
    {
      "@type": [
        "https://schema.org/Thing",
        "https://schema.org/Place",
        "https://schema.org/TouristAttraction",
        "https://odta.io/voc/PointOfInterest"
      ],
      "https://vocab.sti2.at/ds/compliesWith": {
        "@id": "https://semantify.it/ds/sloejGAwT"
      },
      "@id": "http://onlim.com/entity/3afcda58-86a3-406c-9675-f5946844a726"
    },

The @id in line 27 we use for the follow-up query:

curl --location --request GET 'https://proxy.opendatagermany.io/api/ts/v2/kg/things/3afcda58-86a3-406c-9675-f5946844a726?projectionDs=https://semantify.it/ds/Xkd5YH3-1' \
--header 'Content-Type: application/ld+json' \
--header 'x-api-key: API_KEY'

Then we get the full object in the response:

[
  {
    "@id": "http://onlim.com/entity/3afcda58-86a3-406c-9675-f5946844a726",
    "@type": [
      "https://schema.org/TouristAttraction",
      "https://odta.io/voc/PointOfInterest"
    ],
    "https://schema.org/description": [
      {
        "@language": "de",
        "@value": "Die Krochsiedlung wurde von 1929 bis 1930 erbaut. Das Gemeinschaftsprojekt der Architekten Paul Mebes, Paul Emmerich, Johannes Koppe, Adolf Muesmann und Max Fricke befindet sich im Leipziger Stadtteil Gohlis. Der jüdische Bankier Hans Kroch, der auch das Krochhaus in der Goethestraße in Auftrag gab, finanzierte das Projekt mit.\nDie Krochsiedlung wurde als erste Bauetappe einer geplanten Wohnstadt „Neu-Gohlis“ geplant. Die unweit gelegene Versöhnungskirche sollte im Mittelpunkt der neuen Siedlung liegen. Das Projekt wurde jedoch nie vollendet. Damals verkörperte das Wohngebiet neuzeitliche Wohnkultur, die der Wohnungsnot in der späten Weimarer Republik Abhilfe schaffte. In den drei- und viergeschossigen Mehrfamilienhäusern befinden sich bis heute 1018 Wohnungen mit für den Bauhaus charakteristischen Wintergärten, die in den 1990er Jahren umfassend saniert wurden.\nUm das architekturhistorische und geschichtliche Erbe der Krochsiedlung zu pflegen, wurde 1991 der „Bürgerverein Krochsiedlung e.V.“ gegründet."
      },
      {
        "@language": "en",
        "@value": "The Krochsiedlung was built between 1929 and 1930. The collaborative project by architects Paul Mebes, Paul Emmerich, Johannes Koppe, Adolf Muesmann and Max Fricke is located in Leipzig's Gohlis district. The Jewish banker Hans Kroch, who also commissioned the Krochhaus in Goethestraße, helped finance the project.\nThe Krochsiedlung was supposed to be the first construction of a planned residential town \"Neu-Gohlis\". The nearby Reconciliation Church was supposed to be the centre of the new settlement. The project, however, was never completed. At that time, the residential area embodied modern residential culture and remedied the housing shortage of the late Weimar Republic. To this day, the three and four-storey apartment buildings contain 1018 apartments with conservatories characteristic of Bauhaus, which were extensively renovated in the 1990s.\nIn 1991, the \"Bürgerverein Krochsiedlung e.V.\" was founded to preserve the architectural and historical heritage of the Krochsiedlung."
      },
      {
        "@id": "http://onlim.com/entity/ea9c2e03-d677-4027-8e94-049e2fbf50d2"
      }
    ],
    "https://schema.org/identifier": {
      "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
      "@value": "https://dztkg.destination.one/item/open-data-sachsen-tourismus/POI/p_100144693"
    },
    "https://schema.org/name": {
      "@language": "de",
      "@value": "Krochsiedlung"
    },
    "https://schema.org/sdLicense": {
      "@id": "http://onlim.com/entity/6de714b3-f848-4f59-bd94-47626e87f380",
      "@type": "https://schema.org/CreativeWork",
      "https://schema.org/license": {
        "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
        "@value": "http://www.leipzig.travelhttp//www.leipzig.travel"
      },
      "https://vocab.sti2.at/ds/compliesWith": {
        "@id": "https://semantify.it/ds/08qsF9fXz"
      }
    },
    "https://vocab.sti2.at/ds/compliesWith": {
      "@id": "https://semantify.it/ds/sloejGAwT"
    }
  }
]

Note:

  1. The query above uses a projection DS. This might cause some properties not to be present in the response. Remove this parameter or change the projection DS if this is not what you expected.
  2. This call fetches an instance with a local name from the Onlim namespace (http://onlim.com/entity/). Therefore, the namespace parameter can be omitted. For completeness, the call pretending NOT to use the Onlim namespace will be shown below:
curl --location --request GET 'https://proxy.opendatagermany.io/api/ts/v2/kg/things/3afcda58-86a3-406c-9675-f5946844a726?ns=http://onlim.com/entity/&projectionDs=https://semantify.it/ds/Xkd5YH3-1' \
--header 'Content-Type: application/ld+json' \
--header 'x-api-key: API_KEY'

.