Skip to content

IoTCrawler/Search-Enabler

Repository files navigation

Search Enabler

The GraphQL-based search enabler component is considered as a main search-component of IoTCrawler. It employs a query language (GraphQL) and a query processor, which works on top of NGSI-LD-compliant component (the ranking Component or MDR). The component eliminates the lack of expressivity and functional capabilities which prevent NGSI-LD from being the main search interface the large-scale IoT metadata deployments gathered in the IoTCrawler platform. The search enablerb fills the gap between low-level sensors and high-level domain semantics about sensors data and deals with the context-dependent entities by maintaining the context in the IoTCrawler platform.

Details

GraphQL Queries

  • Streams
  • Sensors
  • Platforms
  • Observable Properties
  • Stream Observations are not exposed via GraphQL (since it's data, not metadata). Please expect receiving via stream subscriptions or query them via NGSI-LD directlty using the stream id (see example below)

Inheritance support

  • ParentTypes types declared via subClassOf in resource directive (see Example).
  • Inheritance resolution happens only in Search Enabler.
  • In NGSI-LD all inheriting entities should still have types from the IoTCrawler model to be visible to all IoTCrawler components!

Queries (with inheritance)

Querying enabler via REST API

  • POST request to http://{enalber-url}/graphql
  • Query should be placed (might be copypasted from GUI) into the body under the "query" key:
curl -d '{"query": "{\n   #streams\n   streams(\n            generatedBy: {\n                       #id: \"urn:ngsi-ld:ColorDimmableLight_Zipato_Bulb_2\"\n                       #isHostedBy: {\n                            #id: \"urn:ngsi-ld:Platform_homee_00055110D732\"\n                       #     label: \"homee_00055110D732\"\n                       #}\n                       observes: {\n                            label: \"Temperature\"\n                       #     label: \"Energy\"\n                       }\n               }\n               )\n               {\n                  id,\n                  generatedBy {\n                      id,\n                  #    label,\n                       isHostedBy{\n                                      id,\n                  #                    label,\n                                      #location\n                                    },\n                      observes{\n                      #    id,\n                          label\n                      }\n                  }\n              }\n}"}' -H "Content-Type: application/json" -X POST http://search-enabler-production.35.241.228.250.nip.io/graphql

Entities in Broker (NGSI-LD queries)