Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-15113

[fiware-stackoverflow] How to make exposed locally JSON data seen as Context Provider by FIWARE Orion Context Broker?

    Details

      Description

      Created question in FIWARE Q/A platform on 06-12-2018 at 16:12
      Please, ANSWER this question AT https://stackoverflow.com/questions/53654763/how-to-make-exposed-locally-json-data-seen-as-context-provider-by-fiware-orion-c

      Question:
      How to make exposed locally JSON data seen as Context Provider by FIWARE Orion Context Broker?

      Description:
      I think that I am doing everything alright, but I still cannot make JSON data exposed on my local server to be seen as Context Provider by FIWARE Orion Context Broker.

      SETUP

      I have whole Orion Context Broker all setup and running after following this commands:

      docker pull mongo:3.6
      docker pull fiware/orion
      docker network create fiware_default

      docker run -d --name=mongo-db --network=fiware_default \
      --expose=27017 mongo:3.6 --bind_ip_all --smallfiles
      docker run -d --name fiware-orion -h orion --network=fiware_default \
      -p 1026:1026 fiware/orion -dbhost mongo-db

      ENTITIES

      I also added one Store entity (from https://github.com/Fiware/tutorials.Getting-Started tutorial) by running:

      curl -iX POST \
      'http://localhost:1026/v2/entities' \
      -H 'Content-Type: application/json' \
      -d '
      {
      "id": "urn:ngsi-ld:Store:001",
      "type": "Store",
      "address": {
      "type": "PostalAddress",
      "value":

      { "streetAddress": "Bornholmer Straße 65", "addressRegion": "Berlin", "addressLocality": "Prenzlauer Berg", "postalCode": "10439" }

      },
      "location": {
      "type": "geo:json",
      "value":

      { "type": "Point", "coordinates": [13.3986, 52.5547] }

      },
      "name":

      { "type": "Text", "value": "Bösebrücke Einkauf" }

      }'

      Moreover I also successfully registered my Context Provider:

      curl -iX POST 'http://localhost:1026/v2/registrations' -H 'Content-Type: application/json' -d '{
      "description": "Temperature Provider",
      "dataProvided": {
      "entities": [

      { "id": "urn:ngsi-ld:Store:001", "type": "Store" }

      ],
      "attrs": [
      "temperature"
      ]
      },
      "provider": {
      "http":

      { "url": "http://localhost:8080/temperature" }

      ,
      "legacyForwarding": true
      }
      }'

      CONTEXT PROVIDER

      I exposed locally my Context Provider (exposed by my SpringBoot application written in Java 10) at http://localhost:8080/temperature. The JSON data (returned in html body) looks like that:

      {"contextResponses":[{"contextElement":{"attributes":[

      {"name":"temperature","type":"float","value":"16"}

      ],"id":"urn:ngsi-ld:Store:001","isPattern":"false","type":"Store"},"statusCode":{"code":"200","reasonPhrase":"OK"}}]}

      PROBLEM

      When I try to get other entity's attributes (like name or location) it works fine, but when I try to get temperature attribute with this query:

      curl -X GET 'http://localhost:1026/v2/entities/urn:ngsi-ld:Store:001/attrs/temperature/value'

      I get the following error:

      {"error":"NotFound","description":"The entity does not have such an attribute"}

      The only one error log in the Context Broker docker is:

      time=Thursday 06 Dec 15:29:37 2018.751Z | lvl=WARN | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=postQueryContext.cpp[146]:queryForward | msg=Runtime Error (error forwarding 'Query' to providing application)

        Activity

        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        jmcantera Jose Manuel Cantera made changes -
        Resolution Done [ 10000 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        jmcantera Jose Manuel Cantera made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        fla Fernando Lopez made changes -
        Assignee Jose Manuel Cantera [ jmcantera ]
        fla Fernando Lopez made changes -
        HD-Enabler Orion [ 10875 ]
        Description
        Created question in FIWARE Q/A platform on 06-12-2018 at 16:12
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/53654763/how-to-make-exposed-locally-json-data-seen-as-context-provider-by-fiware-orion-c


        +Question:+
        How to make exposed locally JSON data seen as Context Provider by FIWARE Orion Context Broker?

        +Description:+
        I think that I am doing everything alright, but I still cannot make JSON data exposed on my local server to be seen as Context Provider by FIWARE Orion Context Broker.



        SETUP

        I have whole Orion Context Broker all setup and running after following this commands:

        docker pull mongo:3.6
        docker pull fiware/orion
        docker network create fiware_default

        docker run -d --name=mongo-db --network=fiware_default \
          --expose=27017 mongo:3.6 --bind_ip_all --smallfiles
        docker run -d --name fiware-orion -h orion --network=fiware_default \
          -p 1026:1026 fiware/orion -dbhost mongo-db




        ENTITIES

        I also added one Store entity (from https://github.com/Fiware/tutorials.Getting-Started tutorial) by running:

            curl -iX POST \
          'http://localhost:1026/v2/entities' \
          -H 'Content-Type: application/json' \
          -d '
        {
            "id": "urn:ngsi-ld:Store:001",
            "type": "Store",
            "address": {
                "type": "PostalAddress",
                "value": {
                    "streetAddress": "Bornholmer Straße 65",
                    "addressRegion": "Berlin",
                    "addressLocality": "Prenzlauer Berg",
                    "postalCode": "10439"
                }
            },
            "location": {
                "type": "geo:json",
                "value": {
                     "type": "Point",
                     "coordinates": [13.3986, 52.5547]
                }
            },
            "name": {
                "type": "Text",
                "value": "Bösebrücke Einkauf"
            }
        }'


        Moreover I also successfully registered my Context Provider:

            curl -iX POST 'http://localhost:1026/v2/registrations' -H 'Content-Type: application/json' -d '{
          "description": "Temperature Provider",
          "dataProvided": {
            "entities": [
              {
                "id": "urn:ngsi-ld:Store:001",
                "type": "Store"
              }
            ],
            "attrs": [
              "temperature"
            ]
          },
          "provider": {
            "http": {
              "url": "http://localhost:8080/temperature"
            },
             "legacyForwarding": true
          }
        }'




        CONTEXT PROVIDER

        I exposed locally my Context Provider (exposed by my SpringBoot application written in Java 10) at http://localhost:8080/temperature. The JSON data (returned in html body) looks like that:

        {"contextResponses":[{"contextElement":{"attributes":[{"name":"temperature","type":"float","value":"16"}],"id":"urn:ngsi-ld:Store:001","isPattern":"false","type":"Store"},"statusCode":{"code":"200","reasonPhrase":"OK"}}]}




        PROBLEM

        When I try to get other entity's attributes (like name or location) it works fine, but when I try to get temperature attribute with this query:

        curl -X GET 'http://localhost:1026/v2/entities/urn:ngsi-ld:Store:001/attrs/temperature/value'


        I get the following error:

        {"error":"NotFound","description":"The entity does not have such an attribute"}


        The only one error log in the Context Broker docker is:

        time=Thursday 06 Dec 15:29:37 2018.751Z | lvl=WARN | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=postQueryContext.cpp[146]:queryForward | msg=Runtime Error (error forwarding 'Query' to providing application)

        Created question in FIWARE Q/A platform on 06-12-2018 at 16:12
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/53654763/how-to-make-exposed-locally-json-data-seen-as-context-provider-by-fiware-orion-c


        +Question:+
        How to make exposed locally JSON data seen as Context Provider by FIWARE Orion Context Broker?

        +Description:+
        I think that I am doing everything alright, but I still cannot make JSON data exposed on my local server to be seen as Context Provider by FIWARE Orion Context Broker.



        SETUP

        I have whole Orion Context Broker all setup and running after following this commands:

        docker pull mongo:3.6
        docker pull fiware/orion
        docker network create fiware_default

        docker run -d --name=mongo-db --network=fiware_default \
          --expose=27017 mongo:3.6 --bind_ip_all --smallfiles
        docker run -d --name fiware-orion -h orion --network=fiware_default \
          -p 1026:1026 fiware/orion -dbhost mongo-db




        ENTITIES

        I also added one Store entity (from https://github.com/Fiware/tutorials.Getting-Started tutorial) by running:

            curl -iX POST \
          'http://localhost:1026/v2/entities' \
          -H 'Content-Type: application/json' \
          -d '
        {
            "id": "urn:ngsi-ld:Store:001",
            "type": "Store",
            "address": {
                "type": "PostalAddress",
                "value": {
                    "streetAddress": "Bornholmer Straße 65",
                    "addressRegion": "Berlin",
                    "addressLocality": "Prenzlauer Berg",
                    "postalCode": "10439"
                }
            },
            "location": {
                "type": "geo:json",
                "value": {
                     "type": "Point",
                     "coordinates": [13.3986, 52.5547]
                }
            },
            "name": {
                "type": "Text",
                "value": "Bösebrücke Einkauf"
            }
        }'


        Moreover I also successfully registered my Context Provider:

            curl -iX POST 'http://localhost:1026/v2/registrations' -H 'Content-Type: application/json' -d '{
          "description": "Temperature Provider",
          "dataProvided": {
            "entities": [
              {
                "id": "urn:ngsi-ld:Store:001",
                "type": "Store"
              }
            ],
            "attrs": [
              "temperature"
            ]
          },
          "provider": {
            "http": {
              "url": "http://localhost:8080/temperature"
            },
             "legacyForwarding": true
          }
        }'




        CONTEXT PROVIDER

        I exposed locally my Context Provider (exposed by my SpringBoot application written in Java 10) at http://localhost:8080/temperature. The JSON data (returned in html body) looks like that:

        {"contextResponses":[{"contextElement":{"attributes":[{"name":"temperature","type":"float","value":"16"}],"id":"urn:ngsi-ld:Store:001","isPattern":"false","type":"Store"},"statusCode":{"code":"200","reasonPhrase":"OK"}}]}




        PROBLEM

        When I try to get other entity's attributes (like name or location) it works fine, but when I try to get temperature attribute with this query:

        curl -X GET 'http://localhost:1026/v2/entities/urn:ngsi-ld:Store:001/attrs/temperature/value'


        I get the following error:

        {"error":"NotFound","description":"The entity does not have such an attribute"}


        The only one error log in the Context Broker docker is:

        time=Thursday 06 Dec 15:29:37 2018.751Z | lvl=WARN | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=postQueryContext.cpp[146]:queryForward | msg=Runtime Error (error forwarding 'Query' to providing application)

        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            jmcantera Jose Manuel Cantera
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: