- From: Judson Lester <nyarly@gmail.com>
- Date: Fri, 23 May 2025 11:57:12 -0700
- To: public-hydra@w3.org
- Message-ID: <CAOpbp3dPTOT8nouOU79Xfzc90gdT6zYb=OfPJe3O-bq5Fd2eaA@mail.gmail.com>
Over this last week, I've recalled the shortcoming I ran up against using Hydra. What I realize is that it's really an issue with JSON-LD. Which itself makes me want to see Hydra incorporated into that CG. Here's my use case: I'm building an SPA. Not unusual, I'm using the path in the browser to decide which page component to display, and using elements from the path to store or reference resources in the API. (Alternatively, I could decide to embed one or more API URLs as identifiers into the browser URL, or base64 part of my state as a query parameter - I rejected those alternatives on a number of grounds, some merely aesthetic.) So, given a particular browser URL, and the means to extract a map of keys and values from it, I can use and IriTemplate to construct the API URL to fetch the data that the page needs, or to know where to send state transfers. The problem I have is: how do I construct these browser APIs? The solution I came to was that my resources have "nicknames" which are effectively the key/value maps that go with their IriTemplate that's equivalent to their Link. I'm not at all sure how common this approach is, but the logic that led me here seems reasonable enough that I doubt I'm alone in reaching the conclusion. (The alternative here would be some kind of parser to do the extraction, but RFC 6750 templates are not parser descriptions and I didn't want to go through developing a subset that could serve as such.) Now we have the issue of how to represent these nicknames, and I feel like I found a good notional approach. IIRC it came from a comment by Ian Dickenson somewhere. Essentially, we use SKOS Notations on the resource, and the "keys" are custom types used to distinguish each value on the resource. The trouble I came to is that I would like to represent this in JSON-LD as a kind of "type map" - I want to have a nickname object whose keys are types and whose values are value nodes in the corresponding RDF. The obvious solution (and here details escape me) was to use an `@type` keyword, but that conflicts with existing JSON-LD usage. Anyhow, I know that got well into the weeds, but that's my immediate motivation to see the Hydra CG get back off the ground and be integrated with the JSON-LD one. -- Judson Lester 805.535.5751 nyarly@gmail.com
Received on Friday, 23 May 2025 18:57:28 UTC