[Fiware-tech-help] NGSI-v2 schema checking

Federico Michele Facca federico.facca at martel-innovate.com
Mon Mar 14 20:33:04 CET 2022


Hi Dimitris,
The Orion context broker does not support any schema validation. This means that if this is key to you, you will need to build your on solution for doing that. The problem anyhow would be that synch schema validation introduces latency which is far from ideal in almost real time apps.

An idea could be to do validation asynchronously, for example leveraging envoy proxy, you could implement validation on response and log failed validations in a message queue or returned in the response.

Data will be injected without delay, and you will be able to get some insight on the validation process. Still, this work easily for post (i.e. full entity validation), implementing the logic for single (or multiple) attribute updates would require some schema manipulation. 

Cheers,

Dr. FEDERICO MICHELE FACCA
CTO
0041 78 807 58 38
Martel Innovate  -  Professional support for innovation projects  
Click to download our innovators' insights!  
Follow Us on Twitter

> Il giorno 14 mar 2022, alle ore 19:15, Alberto Abella <alberto.abella at fiware.org> ha scritto:
> 
> 
> Regarding schemas for validation
> For validating payloads you have more than open-licensed 700 data models with a json schema at the Smart Data Models Program.
> In the menu option Search you can look for anything in a data model . There is always a file named schema.json which contains the json schema you could use. Anyhow this has to be done externally to the broker.
> Besides this it is a colalborative program so you can contribute with yours as long as there is an actual use case and you accept to release it with an open license.
> 
> There are plenty of libraries for schema validation or online services. As far as I know this can be validated externally. I've heard that somebody from the university of cantabria have developed some libraries to validate with NGSIv2 but I guess they could provide you with more info.
> 
> Best
> 
> 
>> On Mon, 2022-03-14 at 19:56 +0200, Dimitris Kalogeras wrote:
>> Hi to all of you,
>> 
>> I am doing a data modeling utilizing NGSIv2 for a specific domain. In 
>> order to avoid error propagation between publisher and subscriber
>> through the Orion Context broker I would like to verify that messages 
>> conform to a json schema. Does by any chance
>> Orion support validation according to NGSIv2 schema when external 
>> applications POST to broker  ?
>> 
>> 
>> Kind regards
>> Dimitris
>> 
>> 
> -- 
> Alberto Abella FIWARE Foundation 
> Data Modelling Expert and Technological Evangelist
> +34 629655772
> 
> @fiware @aabella
> https://www.linkedin.com/in/albertoabella/
> 
> 
> 
> Open session (live on Mondays) Contribution Manual Slack channel FAQs NGSI-LD examples generator key values, normalized Surveys to users Widget for finding data models Export in CSV and DTDL Adopters cases Incubated repository Editor for non-technical contributors List of incubated data models Video tutorials Checking proper documentation Checking reuse of attributes Attributes database Credit to contributors
> __________________________________________________________________________________________
> 
> You can get more information about our cookies and privacy policies on the following links:
> - https://fiware-legal.readthedocs.io/en/latest/PersonalDataProtectionPolicy.html
> - https://fiware-legal.readthedocs.io/en/latest/FIWARECookiesPolicy.html
> 
> 
> fiware-tech-help mailing list
> fiware-tech-help at lists.fiware.org
> 
> To unsubscribe from fiware-tech-help mailing list, go to the information page of the list at:
> https://lists.fiware.org/listinfo/fiware-tech-help
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fiware.org/private/fiware-tech-help/attachments/20220314/ad0e3ec7/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image-M5E0A1.png
Type: image/png
Size: 11279 bytes
Desc: not available
URL: <https://lists.fiware.org/private/fiware-tech-help/attachments/20220314/ad0e3ec7/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GMThumb_5Years_AlbertoAbella_smal.png
Type: image/png
Size: 68623 bytes
Desc: not available
URL: <https://lists.fiware.org/private/fiware-tech-help/attachments/20220314/ad0e3ec7/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SmartDataModels_Banner_General.png
Type: image/png
Size: 101513 bytes
Desc: not available
URL: <https://lists.fiware.org/private/fiware-tech-help/attachments/20220314/ad0e3ec7/attachment-0005.png>


More information about the Fiware-tech-help mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy