Entity service paths

Orion Context Broker supports hierarchical scopes, so entities can be assigned to a scope at creation time with updateContext (or related convenience operation). Then, queryContext and subscribeContext (and related convenience operations) can be also scoped to locate entities in the corresponding scopes.

For example, consider an Orion-based application using the following scopes (shown in the figure):

The scope to use is specified using the “Fiware-ServicePath” HTTP in update/query request. For example, to create the entity “Tree1” of type "Tree" in “Parterre1” the following Fiware-ServicePath will be used:

Fiware-ServicePath: /Madrid/Gardens/ParqueNorte/Parterre1

In order to search for “Tree1” in that scope, the same Fiware-ServicePath will be used.

Scopes are hierarchical and hierarchical search can be done. In order to do that the '#' special keyword is used. Thus, a queryContext with pattern entity id “.*” of type “Tree” in /Madrid/Gardens/ParqueNorte/# will return all the trees in ParqueNorte, Parterre1 and Parterre2.

Finally, you can query for disjoint scopes, using a comma-separated list in the Fiware-ServicePath header. For example, to get all trees in both ParqueNorte and ParqueOeste (but not ParqueSur) the following Fiware-ServicePath would be used in queryContext request:

Fiware-ServicePath: /Madrid/Gardens/ParqueNorte, /Madrid/Gardens/ParqueOeste

Some additional remarks: