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.

Predefined Query Example: Locked Resources

In this example an Architecture Management service provider provides a pre-defined query to find all resources that are locked. Since locking and other resource life cycle management capabilities are beyond the scope of the current OSLC specifications, such a query can only be specified as an internal query by the service provider. This specific example does not specify a resource shape for the query, and hence is executed without parameters.

The query parameters on the service call however are still applicable.

The service provider in this example includes the follow resource definition in it service provider document:

<rdf:RDF 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dcterms="http://purl.org/dc/terms" 
   xmlns:oslc="http://open-services.net/ns/core#"
   xmlns:oslc_am="http://open-services.net/ns/am#">

   <oslc:ServiceProvider rdf:about="http://example.com/am-provider/Project+X">

      <dcterms:title>Project X AM Provider</dcterms:title>
      <oslc:service>

         <oslc:Service>
            <oslc:domain rdf:resource="http://open-services.net/ns/am#" />
    
             <!--  other properties omitted for clarity  -->        
          
            <oslc_am:predefinedQuery>
               <oslc_am:PredefineQuery>
                     <dcterms:title>Locked Resources Query</dcterms:title>
                     <dcterms:description>Returns all the currently locked resources.</dcterms:description>
                     <oslc:queryUrl rdf:resource="https://example.com/am-provider/Project+X/query/locked" />
                  </oslc_am:PredefineQuery>
            </oslc_am:predefinedQuery>
            
         </oslc:Service>

      </oslc:service>
   
   </oslc:ServiceProvider> 
</rdf:RDF>

The client executes a POST (or in this case since there is no resource shape specified for the query parameters a GET) call on the queryUrl.

Request

GET https://example.com/am-provider/Project+X/query/locked HTTP/1.1

Accept: application/rdf+xml
OSLC-Core-Version: 2.0

Response

HTTP/1.1 200 OK

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:dcterms="http://purl.org/dc/terms/"
   xmlns:oslc="http://open-services.net/ns/core#">

   <oslc:ResponseInfo
      rdf:about="https://example.com/am-provider/Project+X/query/locked">

      <dcterms:title>Locked Resources</dcterms:title>
      <oslc:totalCount>4</oslc:totalCount>

   </oslc:ResponseInfo>

   <rdf:Description
      rdf:about="https://example.com/am-provider/Project+X/query/locked">

      <rdfs:member rdf:about="http://am.acme.com/resources/res42" />
      <rdfs:member rdf:about="http://am.acme.com/resources/res123" />
      <rdfs:member rdf:about="http://am.acme.com/resources/res456" />
      <rdfs:member rdf:about="http://am.acme.com/resources/res89" />

   </rdf:Description>

</rdf:RDF> 
Edit | Attach | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 14 Aug 2012 - 16:51:41 - 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