HistoryViewLinks to this page 2012 September 7 | 01:57 pm

In this scenario the client wants to find all the AM resources that have a certain values for specific properties. This scenario requires that the client has already discovered the Simple Query URI via the service catalog

Example 1. Returning all required properties

Starting with Simple Query URI the client constructs a simple query and GET the resulting ATOM collection. In this examples the service provider is includes only the minimal information in each entry. It does not specify the creator/contributor nor timestamps. The query before encoding is

…/query=http://purl.org/dc/terms/type=UMLInterface and http://purl.org/dc/terms/description=Customer

A URL encoding it becomes

…%2Fquery%3Dhttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2Ftype%3DUMLInterface%2B
and%2Bhttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2Fdescription%3D*Customer*

Request (request URI line wraps to make more readable)

GET https://am.acme.com/simplequery/project1?query=http://purl.org/dc/terms/type=UMLInterface+and
    +http://purl.org/dc/terms/description=*Customer*
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://purl.org/dc/terms/title=UMLInterface&+http://purl.org/dc/terms/descripti" 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>
    <oslc_am:Resource>
      <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>
    </oslc_am:Resource> 
  </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>
    <oslc_am:Resource>
      <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>
    </oslc_am:Resource> 
  </entry>
</feed>

Example 2. Returning specified properties

In this example the client wants all resources that begin with the title “Web”. The properties being returned include only the title and type values.

.../query=http://purl.org/dc/terms/title=Web*     & oslc_am:properties="http://purl.org/dc/terms/title,http://purl.org/dc/terms/type"

Request (request URI line wraps to make more readable)

GET https://am.acme.com/simplequery/project1?query=http://purl.org/dc/terms/title=Web*+
    &+oslc_am:properties="http://purl.org/dc/terms/title,http://purl.org/dc/terms/type"
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://purl.org/dc/terms/title=UMLInterface&+http://purl.org/dc/terms/descripti" type="application/atom+xml" />
  <opensearch:totalResults>3</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">Web User Profile</title>
    <link href="https://am.acme.com/resources/res158" />
    <oslc_am:etag>"_Txwpsfo1Ed6LKdTEwsKIAw"</oslc_am:etag>
    <oslc_am:Resource>
      <dc:title>Web User Profile</dc:title>
      <dc:type rdf:resource="http://www.eclipse.org/uml2/3.0.0/UML/UseCase" />
    </oslc_am:Resource> 
  </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">Web Front End Configuration</title>
    <link href="https://am.acme.com/resources/res529" />
    <oslc_am:etag>"_scmSBvo1Ed6LKdTEkaDiws"</oslc_am:etag>
    <oslc_am:Resource>
      <dc:title>Web Front End Configuration</dc:title>
      <dc:type rdf:resource="http://www.ibm.com/ccl/soa/deploy/http/1.0.0/Topology" />
    </oslc_am:Resource> 
  </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">Webizer</title>
    <link href="https://am.acme.com/resources/res1821" />
    <oslc_am:etag>"_TaqYU_o1Ed6LKdTEwsKIAw"</oslc_am:etag>
    <oslc_am:Resource>
      <dc:title>Webizer</dc:title>
      <dc:type rdf:resource="http://www.eclipse.org/uml2/3.0.0/UML/Activity" />
    </oslc_am:Resource> 
  </entry>
</feed>