GithubHelp home page GithubHelp logo

orange-opensource / python-ngsild-client Goto Github PK

View Code? Open in Web Editor NEW
13.0 18.0 7.0 4.34 MB

ngsildclient is a Python library dedicated to NGSI-LD. It's both a NGSI-LD API client and a toolbox to create and manipulate NGSI-LD entities effortlessly.

License: Apache License 2.0

Python 99.87% Dockerfile 0.13%
fiware ngsi-ld ngsi-ld-client python-library python-wrapper

python-ngsild-client's Issues

Batch upsert with AsyncClient fails with Unsupported Media type

Hi,

I tried to make a batch upsert using the AsyncClient:

async with AsyncClient(hostname=CONTEXT_BROKER_HOST, port=CONTEXT_BROKER_PORT, tenant=DEFAULT_TENANT) as client:
    await client.batch.upsert(entities, update=True)                

But following error log is produced:

ngsildclient.api.asyn.client - INFO - Connecting client ...
ngsildclient.api.exceptions - INFO - problemdetails={'type': 'Unsupported Media type', 'title': 'Unsupported Media type', 'detail': 'No content type header provided'}
ngsildclient.api.exceptions - INFO - pd_type='Unsupported Media type'
ngsildclient.api.exceptions - INFO - exception=None

With the synchronous client everything works fine.

Context-Broker not recognizing the mapping of same relationship type to multiple objects using python-ngsild-client

Dear Python-ngsild Developer,

Please, I am having some constraints in properly passing the same relationship type referenced to multiple object via my context broker.
For example:
entyi = Entity("Vehicle", "A456742")
entyi.rel("isParked", ["OffStreetParking:Downtown4", "OffStreetParking:Downtown5", "OffStreetParking:Downtown6"]).

This example successfully creates the mapping of "isParked" to the multiple object types in my python script. However, when I try to create the entity in my context broker (stellio-context-broker) using "client.create(entyi)", it only recognizes the first entity "OffStreetParking:Downtown4" and ignores the rest objects that are supposed to be created. Attached to this complaint is the image of my script and graph representation in Neo4j since stellio is backed by the Neo4j database. I would appreciate your feedback to overcome this obstacle. Thank you.

Screenshot from 2022-06-17 11-04-52
Screenshot from 2022-06-17 11-06-00

Request: Support options for Batch Operations /upsert and /update

Hi,

the NGSI-LD spec defines several query parameters that can be used with the entityOperations/upsert and entityOperations/update endpoints, e.g. entityOperations/upsert?options=update.

It would be nice to have support for these options within the client.

Query to create an example

How to create following example:

{
"id": "urn:ngsi-ld:vehicle:Abc123",
"type": "vehicle",
"@context": ["https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"],
"room": {
"type": "Property",
"value": 23,
"temp": {
"type": "Property",
"value": 40,
"temp1": {
"type": "Property",
"value": 54
}
},
"presure": {
"type": "Property",
"value": 40,
"tempPre": {
"type": "Property",
"value": 54
}
}
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.