So, if a service is serving a Hale document, and a client requests a fragment, there is a sound and consistent way we could handle that (or that the client could handle it).
If an attribute matches the first part (divided by slashes) of a fragment it gets the attribute:
"_links" {"self": {"href": "http://some.hale.doc/resource"}},
"attr1": "foo"
"attr2": {"sub1": "ninja", "sub2": "cow"}
"_embedded": {"items": [{"_links": {"self": {"href": "some.hale.doc/resource/id1"}}}]}
}
http://some.hale.doc/resource#attr1 returns
http://some.hale.doc/resource#attr2 returns
{"sub1": "ninja", "sub2": "cow"}
You can also subselect
http://some.hale.doc/resource#attr2/sub1
If no attribute matches, check embedded:
http://some.hale.doc/resource#items
[{"_links": {"self": {"href": "some.hale.doc/resource/id1"}}}]
otherwise try and match a link
http://some.hale.doc/resource#self
{"href": "http://some.hale.doc/resource"}
and again you can subselect
http://some.hale.doc/resource#self/href
"http://some.hale.doc/resource"
(Obviously this is just some thoughts...)