telkkar / NwsApi

C# library for the API from the National Weather Service. Extreme work in progress.
0 stars 0 forks source link

Investigate differences between NWS API alert formats #2

Open telkkar opened 6 years ago

telkkar commented 6 years ago

Issue/Description NWS API Documentation

The response for alerts can come in several formats, but the two the library will be most concerned with is the JSON-LD format and the CAP/ATOM/CAP-ATOM format.

JSON-LD is the format that this library will be using for other non-alert API requests, so the precedent stands for using JSON-LD. This is especially so since the NWS created the new API and specifically called out JSON-LD as the option chosen to address the problems in the old API.

CAP is the Common Alerting Protocol and is the standard format for alerts exchange. The NWS documentation does not mention this format in any detail other than how to request it from the API. This format is used internationally and is used by more than just the NWS.

Questions

  1. Do either of the JSON-LD or CAP response formats provide more information than the other format?
  2. Is the format of one easier to parse than the other?
  3. Will consumers of this library want to be given the raw CAP response? Or just a parsed version of it in a C# object?
telkkar commented 6 years ago

There's an open-source CAP library for C# called cap-net, but it doesn't seem to target .Net core (aka, I can't get it to build... yet).

jimwallery commented 4 years ago

In you efforts, have you been able to get a JSON-LD deserialized from JSON-LD to a c# object? I am finding little information on others that have managed this.

telkkar commented 4 years ago

I haven't put any effort into deserializing JSON-LD into a C# object; I focused primarily on the non LD parts of the JSON response.

I also found little information when searching for anyone who was working with JSON-LD in C#. I found json-ld.net but when I did my initial round of investigation in 2018, the repo at that point hadn't been touched since 2016. Since then it looks like it's been getting activity.

jimwallery commented 4 years ago

Thank you for your response. I am also checking this out with some other sources and if I come up with anything I will let you know. In the meantime I will check out json-ld.net you have referenced.

Sent from my iPhone

On May 21, 2020, at 8:27 PM, William Michael Holbrook II notifications@github.com wrote:



I haven't put any effort into deserializing JSON-LD into a C# object; I focused primarily on the non LD parts of the JSON response.

I also found little information when searching for anyone who was working with JSON-LD in C#. I found json-ld.nethttps://github.com/linked-data-dotnet/json-ld.net but when I did my initial round of investigation in 2018, the repo at that point hadn't been touched since 2016. Since then it looks like it's been getting activity.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/telkkar/NwsApi/issues/2#issuecomment-632427925, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJKCFE4TFKRJGTVV3A5FEI3RSXIF7ANCNFSM4FAYQHNA.