In this scenario the client wants to find all the AM resources that have a specific relationship ( <http://acme.com/linktypes/elaborates>
) to a known resource URI ( <http://rm.acme.com/requirements/req123>
).
This scenario requires that the client has already discovered the Simple Query URI via the service catalog
Example 1. Find all resources that elaborate a requirement
Starting with Simple Query URI the client constructs a simple query and GET the resulting ATOM collection. The query before encoding is
…?query=http://acme.com/linktypes/elaborates=http://rm.acme.com/requirements/req123
A URL encoding it becomes (line break added)
…?query=http%3A%2F%2Facme.com%2Flinktypes%2Felaborates
%3Dhttp%3A%2F%2Frm.acme.com%2Frequirements%2Freq123
Request (request URI line wraps to make more readable)
GET https://am.acme.com/simplequery/project1?query=http://acme.com/linktypes/elaborates=
http://rm.acme.com/requirements/req123
Accept: application/atom+xml
Response
200 OK
Content-Type: application/atom+xml
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<id>e1a00805-1bc0-4743-98c8-0cd48377b823</id>
<updated>2010-01-11T20:57:08.187Z</updated>
<link rel="self" href="https://am.acme.com/simplequery/project1?query=http://acme.com/linktypes/elaborates=http://rm.acme.com/requirements/req123" type="application/atom+xml" />
<opensearch:totalResults>2</opensearch:totalResults>
<entry xmlns:oslc_am="http://open-services.net/xmlns/am/1.0/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<title type="text">IAudit</title>
<link href="https://am.acme.com/resources/res158" />
<oslc_am:etag>"_Txwpsfo1Ed6LKdTEwsKIAw"</oslc_am:etag>
<rdf:Description rdf:about="https://am.acme.com/resources/res158">
<dc:title>IAudit</dc:title>
<dc:description>Used to access customer audit information.</dc:description>
<dc:type rdf:resource="http://www.eclipse.org/uml2/3.0.0/UML/Interface" />
<dc:format>application/x-uml+xml</dc:format>
</rdf:Description>
</entry>
<entry xmlns:oslc_am="http://open-services.net/xmlns/am/1.0/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<title type="text">IHistory</title>
<link href="https://am.acme.com/resources/res529" />
<oslc_am:etag>"_scmSBvo1Ed6LKdTEkaDiws"</oslc_am:etag>
<rdf:Description rdf:about="https://am.acme.com/resources/res529">
<dc:title>IHistory</dc:title>
<dc:description>Edit customer history information.</dc:description>
<dc:type rdf:resource="http://www.eclipse.org/uml2/3.0.0/UML/Interface" />
<dc:format>application/x-uml+xml</dc:format>
</rdf:Description>
</entry>
</feed>