Details
-
Type: extRequest
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
Labels:None
-
Sender Email:
-
External Participants:
-
HD-Chapter:Data
-
HD-Enabler:Orion
Description
XXX sent a message using the contact form at
https://catalogue.fiware.org/.
Hello,
I'm preparing laboratory script for presenting features of of OCB, however
there is a misconception on how OCB references to Data Models defined by
FIWARE. I'm aware of parameter 'type', which is supplied along with new
entity. The problem is with OCB. How does it difference between data models?
I can add variables from other data model into other which don't match. I
can't find the controller for it and if there is no any that's really shame.
That way model can be mistaken and the example is not really educational. It
could be useful if after defining a model for entity, OCB could interact
somehow with user and check, or debug what it receives. That way it would be
more professional I guess and fore sure more safe to use. If OCB doen't have
that feature there is a possibility for further development from our side,
however it won't happen in the forthcoming year or so, because there is no a
student for taking care of it yet as a part of thesis.
Activity
- All
- Comments
- History
- Activity
- Transitions
Comment by juliozinga@gmail.com :
Hi,
I don't understand exactely your question, but i suposed you need to use
the keyValue mode ?options=keyValues
In this example (
https://github.com/Fiware/dataModels/blob/master/Device/Device/doc/spec.md)
Examples:
url:
host:port/v2/entities?options=keyValues
Example in python( adapted from
http://telefonicaid.github.io/fiware-orion/api/v2/stable/cookbook/):
from urllib2 import Request, urlopenvalues = """
{ "id": "device-9845A", "type": "Device", "category": ["sensor"], "controlledProperty": ["fillingLevel","temperature"], "controlledAsset": ["wastecontainer-Osuna-100"], "ipAddress": "192.14.56.78", "mcc": "214", "mnc": "07", "batteryLevel": 0.75, "serialNumber": "9845A", "refDeviceModel": "myDevice-wastecontainer-sensor-345", "value": "l=0.22;t=21.2", "deviceState": "ok", "dateFirstUsed": "2014-09-11T11:00:00Z", "owner": ["http://person.org/leon"] }"""headers =
{ 'Content-Type': 'application/json'}request = Request('
http://fiware-ngsi2.apiblueprint.org/v2/entities?options=keyValues
', data=values, headers=headers)response_body =
urlopen(request).read()print response_body