NGSIv2 is an updated version of NGSIv1 that provides a more simplified and RESTful API for managing entities and their attributes. Key improvements in NGSIv2 include simplified URLs and payloads, support for native JSON data types, simplified methods for retrieving and updating attribute values, enhanced geolocation and datetime capabilities, support for transient entities, improved filtering for queries and subscriptions, and batch operations. NGSIv2 was designed from the start with RESTful principles in mind to provide a more developer-friendly API compared to NGSIv1.
Cracking JWT tokens: a tale of magic, Node.js and parallel computing - Code E...Luciano Mammino
Learn how you can use some JavaScript/Node.js black magic to crack JWT tokens and impersonate other users or escalate privileges. Just add a pinch of ZeroMQ, a dose of parallel computing, a 4 leaf clover, mix everything applying some brute force and you'll get a powerful JWT cracking potion!
Schibsted collects and analyzes 900 million events/day using AWS. This presentation gives an overview of the systems and architecture, including the solutions to GDPR.
Teaching Native Qt to Talk Web: by Alan Uthoff
Integrating native applications with web frameworks is a must for all modern applications. However, not all frameworks have a native SDKs. Learn how to interface with Web API when there is no native SDK using the robust Qt framework in C++ and QML.
Containment without Containers: Running Windows Microservices on NomadJusten Walker
The world is rapidly moving towards containerizing everything, mostly by using linux cgroups and namespaces. But, Windows has kind of been a second-class citizen in this ecosystem. While great progress has been made in the Windows Container space, it has only recently become generally available. In 2016, when we started our migration to Nomad as our Microservice scheduler, Windows containers were in still their infancy, and the only Nomad driver able to run .Net was raw_exec. In short, running and scheduling .NET Framework microservices isn't easy.
In this talk, you'll learn:
- A little more about Windows Containers and their limitations.
- How we at Jet constrain our Windows raw executables running on Nomad without Container support.
- A little bit about the Windows 32 API and how you can hook into it in your Go programs without resorting to cgo.
Slides for Jan 29, 2020 Chicago Rust Meetup talk where I discuss using Rust based Lambdas in AWS. I don't believe the talk is being recorded so might not make 100% sense, but left links on most pages for more info. Hope this is useful to folks.
Plack basics for Perl websites - YAPC::EU 2011leo lapworth
Run a website with Perl? - you should learn how to use Plack. Most Perl web frameworks support it and it makes your life a lot easier and a lot more fun
CIS14: Developing with OAuth and OIDC ConnectCloudIDSummit
David Chase, Ping Identity
Exploring the implementation and architecture of OAuth and OpenID Connect, using web and mobile applications, with topics including grant types, choosing a grant type, refresh tokens, and managing sessions
HashiConf Digital 2020: HashiCorp Vault configuration as code via HashiCorp T...Andrey Devyatkin
Hippo Technologies uses the Vault provider for Terraform. Every month, new features and capabilities are added to the provider, allowing them to improve their Vault configuration management continuously. In this talk, Andrey will share Hippo's journey, from the first, basic, steps of Terraforming Vault, to where they are now. He'll delve into what went well, what didn't work, and what you should consider before you embark on this journey, like incorporating DevSecOps.
NGSIv2 Overview for Developers That Already Know NGSIv1Fermin Galan
This document describes the novelties in NGSIv2 for people already familiar with NGSIv1. Thus, you would learn how to do the things you are familiar with NGSIv1 now in NGSIv2 as long as new and powerfull capabilities of the new version of the API. Some knowledge in NGSIv1 API is required.
Cracking JWT tokens: a tale of magic, Node.js and parallel computing - Code E...Luciano Mammino
Learn how you can use some JavaScript/Node.js black magic to crack JWT tokens and impersonate other users or escalate privileges. Just add a pinch of ZeroMQ, a dose of parallel computing, a 4 leaf clover, mix everything applying some brute force and you'll get a powerful JWT cracking potion!
Schibsted collects and analyzes 900 million events/day using AWS. This presentation gives an overview of the systems and architecture, including the solutions to GDPR.
Teaching Native Qt to Talk Web: by Alan Uthoff
Integrating native applications with web frameworks is a must for all modern applications. However, not all frameworks have a native SDKs. Learn how to interface with Web API when there is no native SDK using the robust Qt framework in C++ and QML.
Containment without Containers: Running Windows Microservices on NomadJusten Walker
The world is rapidly moving towards containerizing everything, mostly by using linux cgroups and namespaces. But, Windows has kind of been a second-class citizen in this ecosystem. While great progress has been made in the Windows Container space, it has only recently become generally available. In 2016, when we started our migration to Nomad as our Microservice scheduler, Windows containers were in still their infancy, and the only Nomad driver able to run .Net was raw_exec. In short, running and scheduling .NET Framework microservices isn't easy.
In this talk, you'll learn:
- A little more about Windows Containers and their limitations.
- How we at Jet constrain our Windows raw executables running on Nomad without Container support.
- A little bit about the Windows 32 API and how you can hook into it in your Go programs without resorting to cgo.
Slides for Jan 29, 2020 Chicago Rust Meetup talk where I discuss using Rust based Lambdas in AWS. I don't believe the talk is being recorded so might not make 100% sense, but left links on most pages for more info. Hope this is useful to folks.
Plack basics for Perl websites - YAPC::EU 2011leo lapworth
Run a website with Perl? - you should learn how to use Plack. Most Perl web frameworks support it and it makes your life a lot easier and a lot more fun
CIS14: Developing with OAuth and OIDC ConnectCloudIDSummit
David Chase, Ping Identity
Exploring the implementation and architecture of OAuth and OpenID Connect, using web and mobile applications, with topics including grant types, choosing a grant type, refresh tokens, and managing sessions
HashiConf Digital 2020: HashiCorp Vault configuration as code via HashiCorp T...Andrey Devyatkin
Hippo Technologies uses the Vault provider for Terraform. Every month, new features and capabilities are added to the provider, allowing them to improve their Vault configuration management continuously. In this talk, Andrey will share Hippo's journey, from the first, basic, steps of Terraforming Vault, to where they are now. He'll delve into what went well, what didn't work, and what you should consider before you embark on this journey, like incorporating DevSecOps.
NGSIv2 Overview for Developers That Already Know NGSIv1Fermin Galan
This document describes the novelties in NGSIv2 for people already familiar with NGSIv1. Thus, you would learn how to do the things you are familiar with NGSIv1 now in NGSIv2 as long as new and powerfull capabilities of the new version of the API. Some knowledge in NGSIv1 API is required.
FIWARE Training: NGSI-LD Concise Payloads and Merge-Patch OperationsFIWARE
An online training course run by the FIWARE Foundation in conjunction with the i4Trust project and IShare Foundation. The core part of this virtual training camp (27 Jun - 01 Jul 2022) covered all the necessary skills to develop smart solutions powered by FIWARE. It introduces the basis of Digital Twin programming using NGSI-LD (the simple yet powerful open standard API enabling to publish and access digital twin data) combined with common smart data models
In addition, it covers the supplementary FIWARE technologies used to implement the rest of functions typically required when architecting a complete smart solution: Identity and Access Management (IAM) functions to secure access to digital twin data, and functions enabling the interface with IoT and 3rd systems, or the connection with different tools for processing and monitoring current and historic big data.
Extending this core part, the training camp also cover how you can easily integrate FIWARE systems with blockchain networks to create audit-proof logs of processes and ensure transparency.
NGSI-LD Concise Payloads and Merge-Patch OperationsFIWARE
This training camp teaches you how FIWARE technologies and iSHARE, brought together under the umbrella of the i4Trust initiative, can be combined to provide the means for creation of data spaces in which multiple organizations can exchange digital twin data in a trusted and efficient manner, collaborating in the development of innovative services based on data sharing and creating value out of the data they share. SMEs and Digital Innovation Hubs (DIHs) will be equipped with the necessary know-how to use the i4Trust framework for creating data spaces!
This training camp teaches you how FIWARE technologies and iSHARE, brought together under the umbrella of the i4Trust initiative, can be combined to provide the means for creation of data spaces in which multiple organizations can exchange digital twin data in a trusted and efficient manner, collaborating in the development of innovative services based on data sharing and creating value out of the data they share. SMEs and Digital Innovation Hubs (DIHs) will be equipped with the necessary know-how to use the i4Trust framework for creating data spaces!
FIWARE Wednesday Webinars - How to Design DataModelsFIWARE
How to Design DataModels - 8th May 2019
Corresponding webinar recording: https://youtu.be/T_1DpKf6C_c
Understanding and applying Standard Data Models.
Chapter: Core
Difficulty: 3
Audience: Technical Domain Specific
Presenter: José Manuel Cantera (Senior Standardization Expert, FIWARE Foundation)
General overview of Orion Context Broker architecture. Introduction to NGSI, NGSIv2. Overview of the main functionalities of FIWARE Orion Context Broker. Creating and pulling data. Pushing data and notifications and the introduction to the batch operations.
An online training course run by the FIWARE Foundation in conjunction with the i4Trust project and IShare Foundation. The core part of this virtual training camp (27 Jun - 01 Jul 2022) covered all the necessary skills to develop smart solutions powered by FIWARE. It introduces the basis of Digital Twin programming using NGSI-LD (the simple yet powerful open standard API enabling to publish and access digital twin data) combined with common smart data models
In addition, it covers the supplementary FIWARE technologies used to implement the rest of functions typically required when architecting a complete smart solution: Identity and Access Management (IAM) functions to secure access to digital twin data, and functions enabling the interface with IoT and 3rd systems, or the connection with different tools for processing and monitoring current and historic big data.
Extending this core part, the training camp also cover how you can easily integrate FIWARE systems with blockchain networks to create audit-proof logs of processes and ensure transparency.
Actuation, Federation and Interoperability of Context BrokersFIWARE
This training camp teaches you how FIWARE technologies and iSHARE, brought together under the umbrella of the i4Trust initiative, can be combined to provide the means for creation of data spaces in which multiple organizations can exchange digital twin data in a trusted and efficient manner, collaborating in the development of innovative services based on data sharing and creating value out of the data they share. SMEs and Digital Innovation Hubs (DIHs) will be equipped with the necessary know-how to use the i4Trust framework for creating data spaces!
Solutions for bi-directional Integration between Oracle RDMBS & Apache KafkaGuido Schmutz
A Kafka cluster stores streams of records (messages) in categories called topics. It is the architectural backbone for integrating streaming data with a Data Lake, Microservices and Stream Processing. Today’s enterprises have their core systems often implemented on top of relational databases, such as the Oracle RDBMS. Implementing a new solution supporting the digital strategy using Kafka and the ecosystem can not always be done completely separate from the traditional legacy solutions. Often streaming data has to be enriched with state data which is held in an RDBMS of a legacy application. It’s important to cache this data in the stream processing solution, so that It can be efficiently joined to the data stream. But how do we make sure that the cache is kept up-to-date, if the source data changes? We can either poll for changes from Kafka using Kafka Connect or let the RDBMS push the data changes to Kafka. But what about writing data back to the legacy application, i.e. an anomaly is detected inside the stream processing solution which should trigger an action inside the legacy application. Using Kafka Connect we can write to a database table or view, which could trigger the action. But this not always the best option. If you have an Oracle RDBMS, there are many other ways to integrate the database with Kafka, such as Advanced Queueing (message broker in the database), CDC through Golden Gate or Debezium, Oracle REST Database Service (ORDS) and more. In this session, we present various blueprints for integrating an Oracle RDBMS with Apache Kafka in both directions and discuss how these blueprints can be implemented using the products mentioned before.
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...confluent
A Kafka cluster stores streams of records (messages) in categories called topics. It is the architectural backbone for integrating streaming data with a Data Lake, Microservices and Stream Processing. Today's enterprises have their core systems often implemented on top of relational databases, such as the Oracle RDBMS. Implementing a new solution supporting the digital strategy using Kafka and the ecosystem can not always be done completely separate from the traditional legacy solutions. Often streaming data has to be enriched with state data which is held in an RDBMS of a legacy application. It's important to cache this data in the stream processing solution, so that It can be efficiently joined to the data stream. But how do we make sure that the cache is kept up-to-date, if the source data changes? We can either poll for changes from Kafka using Kafka Connect or let the RDBMS push the data changes to Kafka. But what about writing data back to the legacy application, i.e. an anomaly is detected inside the stream processing solution which should trigger an action inside the legacy application. Using Kafka Connect we can write to a database table or view, which could trigger the action. But this not always the best option. If you have an Oracle RDBMS, there are many other ways to integrate the database with Kafka, such as Advanced Queueing (message broker in the database), CDC through Golden Gate or Debezium, Oracle REST Database Service (ORDS) and more. In this session, we present various blueprints for integrating an Oracle RDBMS with Apache Kafka in both directions and discuss how these blueprints can be implemented using the products mentioned before.
Ceci est l'export des slides de la conférences donnée au Drupalcamp France 2017 à Lannion
https://lannion2017.drupalcamp.bzh/programme/sessions/headless-drupal-en-pratique
Drupal Headless ? Decoupled frontend ? Je vous propose d’aborder les principes de fonctionnement, les enjeux majeurs et les solutions disponibles de cette architecture.
Des exemples de sites et d’applications ainsi que des retours d'expérience avec Angular accompagnent la présentation.
Solutions for bi-directional integration between Oracle RDBMS & Apache KafkaGuido Schmutz
Apache Kafka is a popular distributed streaming data platform. A Kafka cluster stores streams of records (messages) in categories called topics. It is the architectural backbone for integrating streaming data with a Data Lake, Microservices and Stream Processing. Data sources flowing into Kafka are often native data streams such as social media streams, telemetry data, financial transactions and many others. But these data stream only contain part of the information. A lot of data necessary in stream processing is stored in traditional systems backed by relational databases. To implement new and modern, real-time solutions, an up-to-date view of that information is needed. So how do we make sure that information can flow between the RDBMS and Kafka, so that changes are available in Kafka as soon as possible in near-real-time? This session will present different approaches for integrating relational databases with Kafka, such as Kafka Connect, Oracle GoldenGate and bridging Kafka with Oracle Advanced Queuing (AQ).
Similar to ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214 (20)
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
The European Union Agency for Law Enforcement Cooperation (Europol) has suffered an alleged data breach after a notorious threat actor claimed to have exfiltrated data from its systems. Infamous data leaker IntelBroker posted on the even more infamous BreachForums hacking forum, saying that Europol suffered a data breach this month.
The alleged breach affected Europol agencies CCSE, EC3, Europol Platform for Experts, Law Enforcement Forum, and SIRIUS. Infiltration of these entities can disrupt ongoing investigations and compromise sensitive intelligence shared among international law enforcement agencies.
However, this is neither the first nor the last activity of IntekBroker. We have compiled for you what happened in the last few days. To track such hacker activities on dark web sources like hacker forums, private Telegram channels, and other hidden platforms where cyber threats often originate, you can check SOCRadar’s Dark Web News.
Stay Informed on Threat Actors’ Activity on the Dark Web with SOCRadar!
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfJay Das
With the advent of artificial intelligence or AI tools, project management processes are undergoing a transformative shift. By using tools like ChatGPT, and Bard organizations can empower their leaders and managers to plan, execute, and monitor projects more effectively.
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
Science gateways allow science and engineering communities to access shared data, software, computing services, and instruments. Science gateways have gained a lot of traction in the last twenty years, as evidenced by projects such as the Science Gateways Community Institute (SGCI) and the Center of Excellence on Science Gateways (SGX3) in the US, The Australian Research Data Commons (ARDC) and its platforms in Australia, and the projects around Virtual Research Environments in Europe. A few mature frameworks have evolved with their different strengths and foci and have been taken up by a larger community such as the Globus Data Portal, Hubzero, Tapis, and Galaxy. However, even when gateways are built on successful frameworks, they continue to face the challenges of ongoing maintenance costs and how to meet the ever-expanding needs of the community they serve with enhanced features. It is not uncommon that gateways with compelling use cases are nonetheless unable to get past the prototype phase and become a full production service, or if they do, they don't survive more than a couple of years. While there is no guaranteed pathway to success, it seems likely that for any gateway there is a need for a strong community and/or solid funding streams to create and sustain its success. With over twenty years of examples to draw from, this presentation goes into detail for ten factors common to successful and enduring gateways that effectively serve as best practices for any new or developing gateway.
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
CyanicLab, an offshore custom software development company based in Sweden,India, Finland, is your go-to partner for startup development and innovative web design solutions. Our expert team specializes in crafting cutting-edge software tailored to meet the unique needs of startups and established enterprises alike. From conceptualization to execution, we offer comprehensive services including web and mobile app development, UI/UX design, and ongoing software maintenance. Ready to elevate your business? Contact CyanicLab today and let us propel your vision to success with our top-notch IT solutions.
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus
As part of the DOE Integrated Research Infrastructure (IRI) program, NERSC at Lawrence Berkeley National Lab and ALCF at Argonne National Lab are working closely with General Atomics on accelerating the computing requirements of the DIII-D experiment. As part of the work the team is investigating ways to speedup the time to solution for many different parts of the DIII-D workflow including how they run jobs on HPC systems. One of these routes is looking at Globus Compute as a way to replace the current method for managing tasks and we describe a brief proof of concept showing how Globus Compute could help to schedule jobs and be a tool to connect compute at different facilities.
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
Les Buildpacks existent depuis plus de 10 ans ! D’abord, ils étaient utilisés pour détecter et construire une application avant de la déployer sur certains PaaS. Ensuite, nous avons pu créer des images Docker (OCI) avec leur dernière génération, les Cloud Native Buildpacks (CNCF en incubation). Sont-ils une bonne alternative au Dockerfile ? Que sont les buildpacks Paketo ? Quelles communautés les soutiennent et comment ?
Venez le découvrir lors de cette session ignite
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Into the Box Keynote Day 2: Unveiling amazing updates and announcements for modern CFML developers! Get ready for exciting releases and updates on Ortus tools and products. Stay tuned for cutting-edge innovations designed to boost your productivity.
2. Outline • Introduction to NGSIv2
• RESTful-ness
• URL & payload simplification
• Native JSON datatypes
• Text-based attribute value set/get
• Geolocation capabilities
• Datetime support
• Transient entities
• Filtering
• Subscription improvements
• Batch operations
• Working with IDs
• Pagination
• Next things to come
2
3. Two “flavors” of NGSI API
• NGSIv1 (the one you already know )
– Original NGSI RESTful binding of OMA-NGSI
– Implemented in 2013
– Uses the /v1 prefix in resource URL
– Deprecated, so support to it will be removed at the end. You are strongly discouraged of
using NGSIv1.
• NGSIv2
– A revamped, simplified binding of OMA-NGSI
• Simple things must be easy
• Complex things should be possible
• Agile, implementation-driven approach
• Make it as developer-friendly as possible (RESTful, JSON, …)
– Enhanced functionality compared to NGSIv1 (e.g. filtering)
– Stable, ready for production, version already available
• Current NGSIv2 version is Release Candidate 2018.07 http://telefonicaid.github.io/fiware-
orion/api/v2/stable
• New features coming (see last part of this presentation)
– Uses the /v2 prefix in resource URL
• Introduction to NGSIv2
– https://docs.google.com/presentation/d/1_fv9dB5joCsOCHlb4Ld6A-
QmeIYhDzHgFHUWreGmvKU/edit#slide=id.g53c31d7074fd7bc7_0
3
4. The NGSI model is kept as it is in NGSIv2
Attributes
• Name
• Type
• Value
Entity
• EntityId
• EntityType
1 n
“has”
Metadata
• Name
• Type
• Value1 n
“has”
4
5. RESTful-ness
• In NGSIv1
– Originally based on OMA-NGSI standard operations, not really
RESTful
• The URL doesn’t identify a resource, but an operation type
• The verb is always POST
• Actually, NGSIv1 is closer to HTTP-based RPC than to RESTful
– An extended set of operations (convenience operations) were
added in a later stage but with “legacy” from standard
operations that make it hard to apply full RESTful principles
• E.g. dual response code
• NGSIv2 has been designed from scratch with RESTful
principles in mind
– Batch operations (similar to standard operations in NGSIv1)
are also provided, but without impacting the RESTful
operations in the API
5
6. RESTful-ness
6
200 OK
...
{
"contextElement" : {
"type" : "",
"isPattern" : "false",
"id" : "Car1"
},
"statusCode" : {
"code" : "404",
"reasonPhrase" : "No context element found",
"details" : "Entity id: /Car1/"
}
}
GET /v1/contextEntities/Car1
404 Not Found
...
{
"error": "NotFound",
"description": "The requested entity has not
been found. Check type and id“
}
GET /v2/entities/Car1
NGSIv1
NGSIv2
both status codes have to be taken into account by
the client in order to detect error conditions,
which increases complexity
only HTTP response code,
following RESTful principles -
simpler to process
Example: get Car1 entity
7. URL & payload simplification
• In NGSIv1 the strict alignment with OMA NGSI involves
complexity and ineffectiveness
– Message payloads include a lot of structural overhead elements not
actually needed
– Response payload in methods that don’t really need a payload from a
semantic point of view (e.g. update operation)
– Unnecessarily long structural elements in URLs
• NGSIv2 simplifies URLs and payload, leading to a much
more lean and less verbose API
7
8. URL & payload simplification
8
POST /v1/contextEntities
...
{
"id": "Car1",
"type": "Car",
"attributes": [
{
"name": "colour",
"type": "Text",
"value": "red"
}
]
}
200 OK
Location: /v2/entities?type=Car
POST /v2/entities
…
{
"id": "Car1",
"type": "Car",
"colour": {
"value": "red",
"type": "Text",
}
}
NGSIv1
NGSIv2
Most of the NGSIv1 response payload is
useless: clients only need to know the
status code. In NGSIv2 the response has
no payload at all
shorter URLs in
NGSIv2
200 OK
...
{
"contextResponses": [
{
"attributes": [
{
"name": "colour",
"type": "float",
"value": ""
}
],
"statusCode": {
"code": "200",
"reasonPhrase": "OK"
}
}
],
"id": "Car1",
"isPattern": "false",
"type": “Car"
}
structural
overhead
Example: create Car1
entity (type Car) with
attribute colour set to
“Red”
9. URL & payload simplification
9
GET /v1/contextEntities/type/Car/id/Car1/attributes/colour GET /v2/entities/Car1/attrs/colour?type=Car
NGSIv1 NGSIv2
redundant (already part of the request URL)
200 OK
...
{
"attributes": [
{
"name": "colour",
"type": "Text",
"value": " red"
}
],
"statusCode": {
"code": "200",
"reasonPhrase": "OK"
}
}
mostly useless
200 OK
...
{
"value": "red",
"type": "Text",
"metadata": {}
}
shorter URL in
NGSIv2
structural
overhead
Example: get attribute
colour at Car1 entity
(type Car)
10. URL & payload simplification
• Moreover, NGSIv2 provides simplified data representations
– keyValues: exclude attribute type and metadata
– values: only attribute values (attrs is used to order the values in the
resulting vector)
– unique: like values which in addition removes duplicate values
• Not only for retrieval operations, also for creation/update
operations
– Default attribute types are used in that case
10
GET /v2/entities/Car1/attrs?options=keyValues
200 OK
...
{
"model": "Ford",
"colour": "red",
"temp": 22
}
GET /v2/entities/Car1/attrs?options=values&attrs=model,colour,temp
200 OK
...
["Ford", "red", 22]
Example: get attribute
colour at Car1 entity (type
Car)
11. Native JSON datatypes
• In NGSIv1
– All attribute values are string based to align with XML encoding
• At the end, XML support was removed (in Orion 1.0.0), but it left
an awful legacy
– Although creation/update operations can use numbers, bool,
etc. at the end they are transformed to strings and stored in
that way internally (*)
– Retrieve operation always provides string encoded values (**)
• NGSIv2 fully supports all the types described in the JSON
specification (string, number, boolean, object, array and
null)
11
(*) Except if NGSIv1 autocast feature is used, for some types (see https://fiware-
orion.readthedocs.io/en/master/user/ngsiv1autocast/index.html)
(**) Exception: entities created/updated with NGSIv2 (which support native types) and retrieved
with NGSIv1 will render without stringification.
12. Native JSON datatypes
1212
POST /v1/contextEntities
...
{
"id": "Car1",
"type": "Car",
"attributes": [
{
"name": "speed",
"type": "Number",
"value": 98
}
]
}
POST /v2/entities?options=keyValues
…
{
"id": "Car1",
"type": "Car",
"speed": 98,
"isActive": true
}
NGSIv1
NGSIv2
created as
number but
retrieved as
string… weird!
GET /v1/contextEntities/Car1/attributes/speed
...
{
"attributes": [
{
"name": "speed",
"type": "Number",
"value": "98"
}
],
"statusCode": { … }
}
GET /v2/entities/Car1/attrs?options=keyValues
…
{
"speed": 98,
"isActive": true
}
coherent result
Example: create Car1
entity (type Car) with
attribute speed set to 98
13. Text-based attribute value set/get
• In NGSIv1
– There is no similar functionality
• NGSIv2 offers set/get attribute access directly without
anything else than the attribute value itself in the
request/response payload
– In the set operation, attribute type and metadata are kept as they are
13
PUT /v2/entities/Car1/attrs/speed/value
Content-Type: text/plain
…
86
GET /v2/entities/Car1/attrs/speed/value
200 OK
Content-Type: text/plain
…
86200 OK
…
Example: set speed attribute
value at Car1 entity
Example: get speed attribute
value at Car1 entity
14. Geolocation capabilities
• In NGSIv1
– Entity location must be a point
– Queries are based on an area specification (circle or polygon, inner or
outer area)
– Query as part of queryContext payload scope
• In NGSIv2
– In addition to point, entity location can be a line, box, polygon or
arbitrary GeoJSON
– Queries are based on a spatial relationship and a geometry
• Spatial relationships: near (max and min distance), coveredBy, intersect,
equal and disjoint
• Geometries: point, line, box, polygon
– Query as part of URL (more user-friendly than payload-based
approach)
14
15. Geolocation capabilities
15
NGSIv1
NGSIv2
Much easier and more compact in NGSIv2
POST /v1/queryContext
…
{
"entities": [
{
"type": "City",
"isPattern": "true",
"id": ".*"
}
],
"restriction": {
"scopes": [
{
"type" : "FIWARE::Location",
"value" : {
"circle": {
"centerLatitude": "40.418889",
"centerLongitude": "-3.691944",
"radius": "13500"
}
}
}
]
}
}
GET /v2/entities?
idPattern=.*&
type=City&
georel=near;maxDistance:13500&
geometry=point&
coords=40.418889,-3.691944
Example: retrieve all entities of type
“City” (no matter the id) whose
distance to Madrid city center (GPS
coordinates 40.418889,-3691944) is
less than 13.5 km
16. Geolocation capabilities
16
Point location
(the only one supported by NGSIv1)
POST /v2/entities
{
"id": "E",
"type": "T",
"location": {
"type": "geo:json",
"value": {
"type": "Polygon",
"coordinates": [ [ [2, 1], [4, 3], [5, -1], [2, 1] ] ]
} } }
POST /v2/entities
{
"id": "E",
"type": "T",
"location": {
"type": "geo:polygon",
"value": [ "2, 2", "8, 7", "-1, 4", "2, 2"]
}
}
POST /v2/entities
{
"id": "E",
"type": "T",
"location": {
"type": "geo:box",
"value": [ "2, 2", "8, 7" ]
}
}
POST /v2/entities
{
"id": "E",
"type": "T",
"location": {
"type": "geo:point",
"value": "40.41,-3.69"
}
}
POST /v2/entities
{
"id": "E",
"type": "T",
"location": {
"type": "geo:line",
"value": [ "2, 2", "8, 7" ]
}
}
Line location (e.g. a street) Box location (e.g. a squared building)
Polygon location (e.g. a city district) GeoJSON geometry (full flexibility)
17. Datetime support
• In NGSIv1
– There is no support for attributes meaning dates, they
are treated as conventional strings
• NGSIv2 implements date support
– Based on ISO ISO8601 format, including partial
representations and timezones
• See https://fiware-
orion.readthedocs.io/en/master/user/ngsiv2_implementati
on_notes/index.html#datetime-support for syntax details
– Use reserved attribute type DateTime to express a date
– Date-based filters are supported
17
18. Datetime support
• Attribute value arithmetic filters can be used with dates as if they
were numbers
• Entity dateModified and dateCreated special attributes, to get
entity creation and last modification timestamps
– They are shown in query responses using
attrs=dateModified,dateCreated
• Entity dateModified and dateCreated special metadata, to get
attribute creation and last modification timestamps
– They are shown in query responses using
metadata=dateModified,dateCreated
18
POST /v2/entities
…
{
"id": "John",
"birthDate": {
"type": "DateTime",
"value": "1979-10-14T07:21:24.238Z"
}
}
GET /v2/entities?q=birthDate<1985-01-01T00:00:00
Example: create entity John,
with birthDate attribute using
type DateTime
19. Transient entities
• In NGSIv1
– There is no support for transient entities
• NGSIv2 implements transient entities
– Attribute dateExpires (of type DateTime) provided at
creation/update time, with special semantic: once that
time is reached, the entity is expired
– What “expires” means depends on implementation
• In the case of Orion, expired entities are automatically removed
(check Orion documentation for more detail)
– Date-based filters are supported also for dateExpires
attribute
19
20. Filtering
• In NGSIv1
– Limited filtering functionality, much of it based on queryContext
complex scopes
– Filters are not supported in subscriptions
• In NGSIv2 the mechanism
– Is simpler (see next slide)
– Can be applied to both queries and subscriptions (described in a later
topic of this presentation)
20
POST /v1/queryContext
…
{
"restriction": {
"scopes": [
{
"type" : "FIWARE::StringFilter",
"value" : "temp<24"
…
}
This is the only interesting
part, all the rest is
structural overhead
Example: filtering entities
which temperature is less
than 24
21. • For the GET /v2/entities operation, retrieve all entities…
– … of a given entity type
– … whose entity id is in a list
– ... whose entity id match a regex pattern
• Example: the id starts with “Room” followed by a digit from 2 to 5
– … with an attribute that matches a given expression
• Example: attribute temp is greater than 25
• Filters can be used simultaneously (i.e. like AND condition)
21
GET /v2/entities?type=Room
GET /v2/entities?id=Room1,Room2
GET /v2/entities?idPattern=^Room[2-5]
Filtering
GET /v2/entities?q=temp>25
supported operators:
• == (or :), equal
• !=, unequal
• >, greater than
• <, less than
• >=, greater than or
equal
• <=, less than or equal
• A..B, range
• ^=, pattern (regex)
• Existence/inexistence
22. • For the GET /v2/entities operation, retrieve all entities…
– ... whose entity type match a regex pattern
– … with an attribute which sub-key matches a given expression
– … with an attribute metadata that matches a given expression
– … with an attribute metadata which sub-key matches a given
expression
22
GET /v2/entities?q=tirePressure.frontRight >130
attribute name attribute sub-key (for compound
attribute values only)
GET /v2/entities?mq=temperature.avg>25
GET /v2/entities?mq=tirePressure.accuracy.frontRight >90
metadata sub-key (for compound
metadata values only)
metadata name
Filtering
GET /v2/entities?typePattern=T[ABC]
23. • By default all attribute are included in query
responses or notifications
• The attrs field (as parameter in GET operations
and as notification sub-field in subscriptions)
can be used to specify a filtering list
• The attrs field can be also used to explicitly
include some special attributes (not included by
default)
– dateCreated: entity creation date
– dateModified: entity last modification date
– dateExpires: entity expiration date
• The “*” can be used as an alias of “all the
(regular) attributes”
23
Attributes filtering and special attributes
24. • Examples
– Include only attributes temp and lum
• In queries: GET /v2/entities?attrs=temp,lum
• In subscriptions: "attrs": [ "temp", "lum" ]
– Include dateCreated and not any other attribute
• In queries: GET /v2/entities?attrs=dateCreated
• In subscriptions: "attrs": [ "dateCreated" ]
– Include dateModified and all the other (regular)
attributes
• In queries: GET /v2/entities?attrs=dateModified,*
• In subscriptions: "attrs": [ "actionType", "*" ]
– Include all attributes (same effect that not using attrs,
not very interesting)
• In queries: GET /v2/entities?attrs=*
• In subscriptions: "attrs": [ "*" ]
24
Attributes filtering and special attributes
25. • By default all attribute metadata are included in query responses
and notifications
• The metadata field (as parameter in GET operations and as
notification sub-field in subscriptions) can be used to specify a
filtering list
• The metadata field can be also used to explicitly include some
special metadata (not included by default)
– dateCreated, dateModified: attribute creation or last modification
date
– actionType: which value is the action type corresponding to the
update triggering the notification: “update”, “append” or “delete” (*)
– previousValue: which provides the value of the attribute previous to
processing the update that triggers the notification
• The “*” can be used as an alias of “all the (regular) metadata”
25
(*) actionType “delete” not yet supported by Orion in 2.2.0.
Metadata filtering and special metadata
26. • Examples
– Include only metadata MD1 and MD2
• In queries: GET /v2/entities?metadata=MD1,MD2
• In subscriptions: "metadata": [ "MD1", "MD2" ]
– Include previousValue and not any other metadata
• In queries: GET /v2/entities?metadata=previousValue
• In subscriptions: "attrs": [ "previousValue" ]
– Include actionType and all the other (regular) metadata
• In queries: GET /v2/entities?metadata=actionType,*
• In subscriptions: "attrs": [ "actionType", "*" ]
– Include all metadatata (same effect that not using
metadata, not very interesting)
• In queries: GET /v2/entities?metadata=*
• In subscriptions: "metadata": [ "*" ]
26
Metadata filtering and special metadata
27. Subscription improvements
• NGSIv1 context subscription API is very limited
– There is no operation to list existing subscriptions
• If a client loses the ID of created subscriptions, there is no way to retrieve
them through the API
– No support for permanent subscriptions
• Creating absurdly long subscriptions (e.g. 100 years) is a dirty workaround
– Fix notification structure
• Difficult to integrate to arbitrary endpoints (e.g. public REST services)
– No support for filters
– Initial notification cannot be avoided (at it is problematic in some use
cases)
– Updates not actually changing attribute value don’t trigger notification
27
28. Subscription improvements
• NGSIv2 subscription API solves all these limitations and
introduces some additional enhancements
– Notification attributes based on “blacklist” (in addition to the
“whitelist” approach in NGSIv1)
– Ability to pause/resume subscriptions
– Oneshot subscriptions
– Initial notification can be disabled with
?options=skipInitialNotification at subscription time
– ?options=forcedUpdate URI parameter to force notification no
matter if update was actual or not
– Extra fields: times sent, last* and description
28
29. Anatomy of a NGSIv2 subscription
29
POST /v2/subscriptions
…
{
"subject": {
"entities": [
{
"id": "Room1",
"type": "Room"
}
]
},
"condition": {
"attrs": [ "temp" ]
},
"notification": {
"http": {
"url": "http://<host>:<port>/publish"
},
"attrs": [ "temp" ]
},
"expires": "2026-04-05T14:00:00.00Z",
"throttling": 5
}
201 Created
Location: /v2/subscriptions/51c0ac9ed714fb3b37d7d5a8
...
POST /v1/subscribeContext
…
{
"entities": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1"
}
],
"attributes": [ "temp“ ],
"reference": "http://<host>:<port>/publish",
"duration": "P1M",
"notifyConditions": [
{
"type": "ONCHANGE",
"condValues": [ "temp" ]
}
],
"throttling": "PT5S"
}
200 OK
...
{ "subscribeResponse": {
"duration": "P1M",
"subscriptionId": "51c0ac9ed714fb3b37d7d5a8",
"throttling": "PT5S"
} }
NGSIv1 NGSIv2
Simpler response
(no payload)
Simpler way of specifying
expiration and throttling
in NGSIv2
Redundant Example: subscribe to
Room1 entity, so
whenever a change
occurs in the temp
attribute a notification
including only temp is
sent
30. List subscriptions and special fields in NGSIv2
• List operations (not available in NGSIv1)
– GET /v2/subscriptions lists all subscriptions
– GET /v2/subscriptions/<id> retrieves information of a particular
subscription
• Whitelist vs. blacklist (in the notification field)
– Use "attrs": [ "A", "B" ] to “include A and B in the notification”
(whitelist)
– Use "exceptAttrs": [ "A", "B" ] to “include all the attributes except
A and B” (blacklist)
– Use "attrs": [ ] to include “all the attributes” (special case)
• Other informative fields (in the notification field)
– timesSent: the number of times that the subscription has been
triggered and a notification has been sent
– lastNotification: datetime corresponding to the last notification
• Other informative fields (at root level)
– description, free text descriptive text for user convenience
30
31. Permanent and paused subscriptions in NGSIv2
• The status attribute can be used to pause/resume
subscriptions
• In GET operations, the status field can be
– active: subscription is active (notifications will be sent)
– inactive: subscription is inactive (notifications will not be sent)
– expired: subscription is expired (notifications will not be sent)
– failed: described in next slide
– oneshot: described in the next to the next slide
31
PATCH /v2/subscriptions/<id>
…
{
"status": "active"
}
PATCH /v2/subscriptions/<id>
…
{
"status": "inactive"
}
To pause To resume
32. • Status failed means that last
attempt to notify failed
– E.g. the endpoint is not reachable
• Detailed information in the
notifications element
– timesSent: total number of notifications
attempts (both successful and failed)
– lastSuccess: last time that notification
was successfully sent
– lastFailure: last time that notification was
tried and failed
– lastNotification: last time the notification
was sent (either success or failure)
• Corollary: lastNotification value is the
same than either lastFailure or
lastSuccess
– lastFailureReason: cause of last failure
(text)
– lastSuccessCode: the HTTP code
(number) returned by receiving endpoint
last time a successful notification was sent
32
200 OK
Content-Type: application/json
…
[{
"id": " 51c0ac9ed714fb3b37d7d5a8 ",
"expires": "2026-04-05T14:00:00.00Z",
"status": "failed",
"subject": { … },
"notification": {
"timesSent": 3,
"lastNotification": "2016-05-31T11:19:32.00Z",
"lastSuccess": "2016-05-31T10:07:32.00Z",
"lastSuccessCode": 200,
"lastFailure": "2016-05-31T11:19:32.00Z",
"lastFailureReason": "Timeout was reached",
…
}
}]
Notification status
33. 33
Notification diagnosis workflow
"status" field
value?
"lastSuccessCode“
field value?
Subscription is inactive
so notifications are not
being sent. Update
subscription to
activate it.
Notifications are being
sent and the receiving
endpoint confirms
correct reception.
Notifications are
being sent but the
receiving endpoint
is reporting HTTP
error. Check
receiving endpoint
(e.g. logs, etc.)
Some problem is
precluding
notifications to be
sent. The
"lastFailureReason"
field value should
provide additional
information on it.
inactive
Subscription is expired
so notifications are not
being sent. Update
subscription to make it
permanent or extend
expiration time
expired active/oneshot failed
2xx
4xx,
5xx
34. • A variant of the active
status, so when the
subscription is triggered
one time (i.e. a
notification is sent) it
automatically steps to
inactive status
• An inactive subscription
can step to oneshot,
starting again the process
• Initial notification upon
subscription creation or
update is not sent in this
case
34
Oneshot subscription
200 OK
Content-Type: application/json
…
[{
"id": "51c0ac..",
"status": "oneshot",
…
}
}]
200 OK
Content-Type: application/json
…
[{
"id": "51c0ac..",
"status": "inactive",
…
}
}]
Subscription is
triggered
PATCH /v2/subscriptions/51c0ac..
{
"status": "oneshot"
}
35. Notification formats in NGSIv2
• The optional attrsFormat field can be used to choose between different notification
flavors, aligned with the representation modes
• Notifications include the NGSIv2-AttrsFormat header to help the receiver identify
the format
• legacy can be used as value for attrsFormat in order to send notifications in
NGSIv1 format
– Very useful when integrating legacy notification endpoints
35
{
"subscriptionId": "12345",
"data": [
{
"id": "Room1",
"type": "Room",
"temperature": {
"value": 23,
"type": "Number",
"metadata": {}
}
}
]
}
{
"subscriptionId": "12345",
"data": [
{
"id": "Room1",
"type": "Room",
"temperature": 23
}
]
}
{
"subscriptionId": "12345",
"data": [ [ 23 ] ]
}
normalized (default) keyValues values
Outer vector represent the list of
entities, inner vector the values of
the attribute of each entity (not too
interesting in this single-entity
single-attribute example)
36. Custom notifications in NGSIv2
• Apart from the standard formats defined in the
previous slide, NGSIv2 allows to re-define all the
notification aspects
• httpCustom is used (instead of http) with the
following subfields
– URL query parameters
– HTTP method
– HTTP headers
– Payload (not necessarily JSON!)
• A simple macro substitution language based on ${..}
syntax can be used to “fill the gaps” with entity data (id,
type or attribute values)
36
37. Custom notifications in NGSIv2
37
…
"httpCustom": {
"url": "http://foo.com/entity/${id}",
"headers": {
"Content-Type": "text/plain"
},
"method": "PUT",
"qs": {
"type": "${type}"
},
"payload": "The temperature is ${temp} degrees"
}
…
PUT http://foo.com/entity/DC_S1-D41?type=Room
Content-Type: text/plain
Content-Length: 31
The temperature is 23.4 degrees
PUT /v2/entities/DC_S1-D41/attrs/temp/value?type=Room
…
23.4
Custom notification configuration
update
notification
Example: send a text
notification (i.e. not
JSON) with temperature
value, using the entity id
and type as part of the
URL
38. 38
POST /v2/subscriptions
…
{
"subject": {
"entities": [
{
"id": "Truck11",
"type": "RoadVehicle"
},
{
"idPattern": "^Car[2-5]",
"type": "RoadVehicle"
}
],
"condition": {
"attrs": [ "speed" ],
"expression": {
"q": "speed>90",
"georel": "near;maxDistance:100000",
"geometry": "point",
"coords": "40.418889,-3.691944"
}
}
},
…
}
• Filters (described in previous
slides) can be also used in
subscriptions
– id
– type
– id pattern
– attribute values
– geographical location
Subscription filters in NGSIv2
Example: subscribe to speed changes in
entities with id Truck11 or Car2 to Car5 (both
case of type RoadVehicle) whenever speed is
greater than 90 and the vehicle distance to
Madrid city center is less than 100 km
39. 39
POST /v2/subscriptions
…
{
"subject": {
"entities": [
{
"idPattern": ".*",
"typePattern": ".*Vehicle"
},
],
"condition": {
"attrs": [ "speed" ],
"expression": {
"q": "speed>90",
"mq": "speed.average==80..100",
"georel": "near;maxDistance:100000",
"geometry": "point",
"coords": "40.418889,-3.691944"
}
}
},
…
}
• They can be used also in
subscriptions
– type pattern
– metadata value
Subscription filters in NGSIv2
Example: subscribe to speed changes in any
entities of any type ending with Vehicle (such
as RoadVehicle, AirVehicle, etc.) whenever
speed is greater than 90 its average metadata
is between 80 and 90 and the vehicle distance
to Madrid city center is less than 100 km
40. Batch operations
• In NGSIv1 we have standard operations
– POST /v1/updateContext
– POST /v1/queryContext
• Similar but more user-friendly operations have
been included in NGSIv2
– POST /v2/op/update
– POST /v2/op/query
40
41. Batch operations
41
POST /v1/updateContext
…
{
"updateAction": "APPEND“,
"contextElements": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1",
"attributes": [
{
"name": "temp",
"type": "float",
"value": "29"
}
]
}
]
}
POST /v2/op/update
{
"actionType": "append",
"entities": [
{
"type": "Room",
"id": "Room1",
"temperature":
{
"type": "Number",
"value": 29
}
}
]
}
201 Created
NGSIv1 NGSIv2
structural
overhead
200 OK
...
{
"contextResponses" : [ … ],
"statusCode" : {
"code" : "200",
"details" : "OK"
}
}
NGSIv2 response doesn’t
have any payload at all
lots of useless
stuff here
Example: create
Room1 entity (type
Room) with attribute
temp set to 29
42. Batch operations
42
POST /v1/queryContext
…
{
"entities": [
{
"type": "Room",
"isPattern": "true",
"id": ".*"
} ,
"attributes": [ "temp" ]
]
}
POST /v2/op/query
…
{
"entities": [
{
"idPattern": ".*",
"type": "T"
}
],
"attrs": [ "temp" ]
}
NGSIv1
NGSIv2
Requests are more or
less the same, but the
simplicity of NGSIv2
becomes evident
when comparing
responses
200 OK
...
{
"contextResponses": [
{
"contextElement": {
"attributes": [
{
"name": "temp",
"type": "Number",
"value": "25"
}
],
"id": "Room1",
"isPattern": "false",
"type": "Room"
},
"statusCode": { … }}
]
}
200 OK
...
[
{
"id": "Room1",
"type": "Room",
"temp": {
"type": "Number",
"value": 25
}
}
]
Example: get
temp attribute of
all entities with
type Room
43. Batch query scope
• This is the way of including q,
mq and geo filters (typically
used as URL param of a GET
operation) in a batch query
43
POST /v2/op/query
…
{
"entities": [
{
"idPattern": ".*",
"type": "T"
}
],
"attrs": [ "temp" ],
"expression": {
"q": "temp>40",
"georel": "near;maxDistance:20000",
"geometry": "point",
"coords": "40.31,-3.75"
}
}
Example: get all entities of type T
with the attribute temp as long as
that attribute is greater than 40 and
the entity distance to coordinates
(40.31, -3.75) is less than 20 km
44. Pagination
• In NGSIv1
– based on limit, offset and details
– Dirty workaround to fit count into NGSIv1
payloads, using an errorCode for something
that actually is not an error and forcing to
text based processing of the details field
– Fixed order: always by creation date
• In NGSIv2
– based on limit, offset and options=count
• This part doesn’t change too much
– Cleaner and easier way of returning count,
with the Fiware-Total-Count HTTP header
in the response
– Configurable ordering based on orderBy
parameter
• See details in the NGSIv2 specification
44
"errorCode": {
"code": "200",
"details": "Count: 322",
"reasonPhrase": "OK"
}
Fiware-Total-Count: 322
45. Working with IDs
• In NGSIv1
– Fields such as entity id, attribute name, etc. may have any value (*)
– This could cause a lot of problems as these fields use to act as IDs in
many places when propagated through notifications
• E.g. Cygnus MySQL sink may have problems when these fields are mapped
to tables names, whose allowed charset is very strict
– In addition, NGSIv1 allows ids or attribute names as "" (empty string)
which is weird and typically an error condition in the client
• NGSIv2 establishes a set of restrictions to ensure sanity in the
usage of ID fields. In particular:
– Allowed characters are those in the plain ASCII set, except the following ones:
control characters, whitespace, &, ?, / and #.
– Maximum field length is 256 characters.
– Minimum field length is 1 character.
– The rules above apply to the following six fields (identified as ID fields): entity
id, entity type, attribute name, attribute type, metadata name, metadata type
45
(*) Excluding the forbidden characters described in the Orion manual, which are general for all the fields in both
NGSIv1 and NGSIv2 APIs
46. Useful references
• Introduction to NGSI and Orion
– https://github.com/telefonicaid/fiware-orion#introductory-
presentations
• Orion Manual
– https://fiware-orion.readthedocs.io
• Orion page at FIWARE Catalogue
– http://catalogue.fiware.org/enablers/publishsubscribe-
context-broker-orion-context-broker
• NGSIv2 specs
– http://fiware.github.io/specifications/ngsiv2/stable
– http://fiware.github.io/specifications/ngsiv2/latest
• Orion support at StackOverflow
– Look for existing questions at
http://stackoverflow.com/questions/tagged/fiware-orion
– Ask your questions using the “fiware-orion” tag
• FIWARE Tour Guide Application
– https://github.com/fiware/tutorials.TourGuide-App
46