Not sure if you can do this altogether. If you relate to another web application, the established standard refers to relative URLs, then this resolves the id argument against the request URL:
http://example.com/foo/bar/1/?id=/foo/bar/xyz/
http://example.com/foo/bar/1/?id=../xyz/
(code as needed)
This helps in the examples given, since the two URLs are in the same domino. Otherwise, I suppose you just need to accept full URLs.
Prefixes are commonly used in the RDF world, of course, but it doesn’t feel very RESTful unless you provide a means to look up mappings.
source
share