This wiki is locked. Future workgroup activity and specification development must take place at our new wiki. For more information, see this blog post about the new governance model and this post about changes to the website.

Scenario: Find AM Resources with Properties

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 discoveed 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/title=UMLInterface     & http://purl.org/dc/terms/description=*Customer*

A URL encoding it becomes

../query=http%3A%2F%2Fpurl.org%2Fdc%2Fterms%2Ftitle%3DUMLInterface%26+http%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%3A%2F%2Fpurl.org%2Fdc%2Fterms%2Ftitle%3DUMLInterface+%26
                +http%3A%2F%2Fpurl.org%2Fdc%2Fterms%2Fdescription%3D*Customer*
Accept: application/atom+xml
Response
200 OK
Content-Type: application/atom+xml

<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns="http://www.w3.org/2005/Atom" 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%3A%2F%2Fpurl.org%2Fdc%2Fterms%2Ftitle%3DUMLInterface%26+http%3A%2F%2Fpurl.org%2Fdc%2Fterms%2Fdescription%3D*Customer*" 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%3A%2F%2Fpurl.org%2Fdc%2Fterms%2Ftitle%3DWeb*+
    %26+oslc_am%3Aproperties%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fterms%2Ftitle%2Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2Ftype%22
Accept: application/atom+xml
Response
200 OK
Content-Type: application/atom+xml

<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns="http://www.w3.org/2005/Atom" 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%3A%2F%2Fpurl.org%2Fdc%2Fterms%2Ftitle%3DUMLInterface%26+http%3A%2F%2Fpurl.org%2Fdc%2Fterms%2Fdescription%3D*Customer*" 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>
 
Edit | Attach | Print version | History: r8 | r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r4 - 12 Jan 2010 - 15:03:16 - JimConallen
 
This site is powered by the TWiki collaboration platform Copyright � by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Contributions are governed by our Terms of Use
Ideas, requests, problems regarding this site? Send feedback