-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can/should extended link relations resolve to resource objects? #202
Comments
i do not think that the idea of home is to "describe the entire structure". think of it rather than of a well-designed home page of a site: it has the most popular entry points to paths through the site, but is nowhere near to being a complete site map. when it comes to the dereferencing extended link relations: i do not think that JSON home has anything to do with that. if that's a pattern you'd like to follow (some people do it, not very many, though), then you can do that. if you not only want to interpret extended link relation as URIs, but also make them discoverable as resources (if i am understanding correctly what you want to do), then i think neither RFC 5988 nor JSON home give you the expressivity you want. if that is what you want to do, then isn't what you need a link relation that (and i am sorry for this confusing twist but it's unavoidable) would allow you to say "this link relation identifies links to resources which themselves are used as link relation types." i do not think i have seen such a link relation being defined or used, afaict the people interested in using link relation URIs as identifiers for resources describing the link relations simply tend to do so and then assume that clients know about this. am i even close to understanding your question? if not, please rephrase a bit. thanks! |
I also don't view json-home as a replacement for Sitemap.
That's a way JSON-LD (RDF) is used, isn't it? Every property in your JSON is a word in a vocabulary such as schema.org, identifiable by its own URI. By using URIs to identify both the subject, the adjective and the verb of what you're modelling in your resources, you pretty much have the RDF triplet right there. |
I agree - sorry if I wasn't very clear in my original issue. I was referring only to the Resource Object concept discussed within the JSON Home draft spec.
It took me a second, but that does make sense 😀 . In this case I'm working on a HAL-based API which encourages Custom link relation types to "be URIs that when dereferenced in a web browser provide relevant documentation". I'm looking to expand that documentation with additional media types beyond HTML to provide a more machine readable format and thought that the Resource Objects might be a good representation for that. |
On 2016-11-03 08:01, Graham Conzett wrote:
i'll leave the authoritative answer to @mnot. in the end, i wouldn't the main point behind the concept is that it allows these resource this terminology is a bit unfortunate for other ways of communicating regardless of these "spec engineering" issues: do not read too much into
i am glad i was on the right track!
i don't think that resource objects are what you think they are, as i as @asbjornu pointed out, if you want to to RDF-ish kinds of things, the important (and confusing) part of this is that true hypermedia RDF has no such concept: RDF has no concept of links, all URIs are |
@dret Thank you for the detailed reply! That clarifies terminology and focus of what JSON Home is trying to accomplish. As a point of clarification (and I'm hopefully not drifting too far off topic here) when I mentioned RFC 5988 I was referencing section 4.2 specifically which says (emphasis added)
So while a custom link relation should be treated as an opaque identifier it seems to imply that optionally dereferencing the URI is acceptable on some level (I'm not using RDF currently). I guess what I'm really looking for is an existing media type that can describe the relation when the URI is dereferenced. |
@dret -- RDF is a Language. It only prescribes the use of IRIs to identify the subject, predicate, and object (optionally) of RDF-Language sentences. Linked Data is simply about the "best practice" of using HTTP URIs to identify the subject, predicate, and object (optionally) of RDF-Language sentences. If you create a document containing RDF-Language sentences, that adheres to Linked Data principles, you end up with a hypermedia document (or resource). Note, that's achievable using a variety of sentence construction notations e.g., RDF-Turtle, JSON-LD, RDF-XML, CSV, and many others. @conzett -- You are correct in your assumptions about a link relation i.e., a relation identified by a hyperlink (e.g., HTTP URI). When said hyperlink is de-referenced it will resolve to a document that describes its semantics (meaning). Simple demonstration (best experienced via our Structured Data Sniffer Extension): {
In the example above, you can look-up the semantics of relations such as schema:sameAs, schema:mentions, schema:mainEntity, schema:mainEntityOfPage, schema:name, or schema:image by simply clicking on the links by which they've identified. |
On 2016-11-03 09:21, Graham Conzett wrote:
"describe the relation when the URI is dereferenced" is probably not RFC 5988 says link relation identifiers are opaque. end of story. there i think what you might be looking for (as mentioned in an earlier one place worth looking might be the hydra vocabulary, but you probably |
I'm not sure we're all interpreting "opaque" the same way, then, and I feel like I'm missing something. Since the RFC specifically allows that the identifiers might be meaningfully dereferenced, that is not the same (to me) as saying that they are completely opaque tokens. It allows that you may be able to do something with them. It just doesn't impose any requirements on whoever created the URI to support any such thing. To me, "opaque" means that the identifier might as well be random gibberish. There's some sort of subtle distinction here that I think I'm not quite getting. |
On 2016-11-03 11:01, Henry Andrews wrote:
the spec simply says it needs to be a URI, and that the only "meaning"
we have this tendency to think that a URI is something beyond its pure |
Then why talk about what it might reference? |
To be clear, I'm not looking to assert that URIs used for identification purposes should be automatically dereferencable, that is clearly against the RFC. I'm trying to figure out the point of both saying "this is what it should point to if it points to anything" and then completely refusing to allow that it might point to something, which is what this feels like. |
On 2016-11-03 11:10, Henry Andrews wrote:
are you talking about the RFC 5988 text here? RFC 5988 simply but we're drifting pretty far away from the original issue here. |
On 2016-11-03 11:13, Henry Andrews wrote:
it does not refuse that at all. it simple is agnostic about that part, |
@conzett : Excerpting what @dret stated in his comment i.e., ""describe the relation when the URI is dereferenced" is probably not Do you want to achieve the following? Naturally, in regards to the statement above, the document content type (or media type) may vary e.g., JSON, JSON-LD, RDF-Turtle, RDF-XML, CSV, or many others (each has an IANA media type). If so, then you have a working example in the document identified by the HTTP URI: #202 (comment) :) |
@handrews : You are correct about identifier opacity. Confusion arises when HTTP URIs as used as Identifiers due to their implicit duality i.e., they serve two functions: 1) entity denotation 2) resolution to connotation (i.e., name->entity-description-document-address indirection). Whenever you encounter Linked Data for instance, it simply boils down to exploiting the aforementioned duality combined with the ubiquity of HTTP en route to a Semantic Web -- where the meaning of relations (links) become discernible by way of dereference :) |
@kidehen Yeah I think we're on the same page. @dret I don't think that the RFC refuses that, but your statement seemed to. It's clear to me at this point that that was not your intention. I still don't get why the RFC talks about what the referenced resource might be, but that's not a JSON Home issue so I'll go ponder it somewhere else :-) |
Bringing this back around (after digesting everyone's comments) perhaps JSON home would help me here. If the preference is to not dereference link extension URIs for documentation, I need some place where I can provide additional information about the link. Things like URL template parameters and general documentation. I'm struggling with where that information would reside currently. |
maybe https://tools.ietf.org/html/draft-wilde-service-link-rel can help? |
@conzett : If you choose to follow Linked Data principles you will find that location becomes less of an issue for documents that describe entity relationship types (relations) that you identify using HTTP URIs (hyperlinks). For instance, using nanotation, you can even use a Github post to hold your relation descriptions . SeeAlso: https://medium.com/openlink-software-blog/data-de-silo-fication-using-combined-power-of-rdf-language-nanotation-755f2e7a904d -- detailed examples of other notes-oriented data spaces as places to exploit Linked Data using nanotation. |
@conzett JSON Schema / Hyper-Schema? |
@conzett : I have a few posts that describe the use of RDF-Language sentences to describes Web Service APIs and the Actions they provide: [1] https://medium.com/virtuoso-blog/describing-web-services-using-a-linked-data-doc-using-schema-org-terms-6caa399fc97a -- Describing Web Services using terms from Schema.org vocabulary [2] https://medium.com/virtuoso-blog/api-descriptions-for-humans-machines-ec04ce1d1a9a -- Here I demonstrate description of Uber APIs that were originally described using Swagger. @conzett @handrews : If you follow the links that identify relations in my descriptions you will also see how integration with Hydra occurs. The key here is to be able to simply click on a link whenever you are curious about what an HTTP URI identifies. |
@asbjornu I was very interested in Hydra before I started down this path but unfortunately I need to support some kind of XML format in addition to JSON. It looks like it could potentially be used with RDF/XML but I haven't seen any solid examples of that. |
@conzett -- You can transform content of an RDF-Turtle or JSON-LD document into RDF-XML. Those notations and document content types have no bearing on terms defined in an Ontology or Vocabulary such as Hydra. There are many tools that offer automatic content transformation circa., 2016 which means the document type used to publish an ontology or vocabulary shouldn't be an impediment to comprehension and use :) |
On 2016-11-04 11:06, Graham Conzett wrote:
don't fall into the trap of thinking that RDF/XML qualifies as an "XML |
Closing because AFAICT there isn't any action for the spec here. But feel free to keep chatting :) |
@mnot : Yes, I agree. Fundamentally, an IRI is an acceptable value. If the resource owner wants said IRI to resolve to a document that describes what it denotes (i.e., its referent) then an HTTP URI can be used, in line with the principles outlined in the "Linked Data" meme. In a nutshell, "horses for courses" :) |
I stumbled on json-home while looking for a way to describe extended link relations as part of a hypermedia API per RFC5988. It looks like the scope is just to describe the entire application structure at the root of the API (hence "home") however, it seems like parts of the specification could be very useful for providing documentation about relations deeper in the API.
For example, if I've navigated to URI
http://example.org/foos/45
and I am presented with a link relationrel="http://example.org/rel/widgets"
(either as a LINK header, HAL body, etc.) it seems pretty useful to be able to resolve that relation URI to a single resource object in order to provide "a definition of the semantics of the relation type."Is this reasonable or totally beyond the scope of what json-home is trying to do? Describing the entire structure up front only seems a little at odds with "discoverability," but even if it's not is there any downside to providing additional contextual definitions in the form of resource objects?
The text was updated successfully, but these errors were encountered: