I'm trying to figure out whether I should use embedded resources or not. I have the following WADL:
<application>
<resources base="
http://example.org/">
<resource id="ID.1" path="">
<resource id="ID.1.1" path="">
<method name="GET" />
<method name="GET" />
</resource>
<resource id="ID.1.2" path="">
<method name="GET" />
<method name="GET" />
</resource>
</resource>
</resources>
<resource id="ID.2" path="foo" />
</application>
basically I want to group similar access to a resource under ID.1. For example, if I do content negotiation for an RDF-XML or RDF-Turtle representation, then I would like to group it under an RDF access to the resource vs. HTML or XHTML representation, for example like this:
<resource id="ID.1.1" path="">
<doc title="RDF access to resource" />
<method name="GET">
<request>
<param name="Accept" style="header" required="true" repeating="false" type="xsd:string">
<option value="application/rdf+xml" />
</param>
<param name="Accept-Charset" style="header" required="false" repeating="false" type="xsd:string" default="*" />
<param name="Accept-Encoding" style="header" required="false" repeating="false" type="xsd:string" default="*" />
<param name="Accept-Language" style="header" required="false" repeating="false" type="xsd:string" default="*" />
</request>
</method>
<method name="GET">
<request>
<param name="Accept" style="header" required="true" repeating="false" type="xsd:string">
<option value="text/turtle" />
<option value="application/x-turtle" />
</param>
<param name="Accept-Charset" style="header" required="false" repeating="false" type="xsd:string" default="*" />
<param name="Accept-Encoding" style="header" required="false" repeating="false" type="xsd:string" default="*" />
<param name="Accept-Language" style="header" required="false" repeating="false" type="xsd:string" default="*" />
</request>
</method>
</resource>
I realize that I could have written it as:
<application>
<resources base="
http://example.org/">
<resource id="ID.1" path="">
<method name="GET" />
<method name="GET" />
<method name="GET" />
<method name="GET" />
</resource>
</resources>
<resource id="ID.2" path="foo" />
</application>
So my question is: is it OK to use embedded resources in this manner and what is the impact on the path for the embedded resource, e.g., section 2.5.1 Generating Resource Identifiers is playing with my mind such that I'm not sure that the path for ID.1.1 and ID.1.2 will still be
http://example.org/.
Thanks, Andy.