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 Queries

It was suggested that a service provider could define and provide a client with predefined queries. A predefined query enables a service provider to offer query support for commonly wanted, but difficult to express in Simple OSLC Query form. Such queries could be discovered in the service provider document (or sister document if the number of queries is unusually large).

In this proposal we include a new service in the service provider document; PredefinedQuery? . This service allows a client to execute a potentially complicated, but common, query on resources across the entire service provider by only supplying values for defined parameters.

Below are examples of the extension to the service provider document and below it an example of what a client would POST to the predefined query URL to execute the query with a specific set of parameter values.

Some things to note: This proposal for predefined query resource only allows one level of simple parameters. I think for now, allowing complex multi-properted resources as parameters is a little too much for the first pass. Also some parameters are optional.

Sample query definition in 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#">

   <oslc:ServiceProvider rdf:about="http://example.com/am-provider/Project+X">
      <dcterms:title>Project X AM Provider</dcterms:title>
      <dcterms:description>Example AM Provider for Project X</dcterms:description>
   </oslc:ServiceProvider>
   
   <!--  deleted normal predefined prefix, factory, simple query and delegated UI elements -->
   
   <oslc:PredefinedQuery>
      <dcterms:identifier>SampleQuery1</dcterms:identifier>
      <dcterms:title>A sample predefined query</dcterms:title>
      <oslc:query rdf:resource="http://example.com/predefqueries/query1" />
      <oslc:shape rdf:resource=""/>
      <oslc:predefinedQueryParameter>
         <oslc:PredefinedQueryParameter>
            <dcterms:identifier>Param1</dcterms:identifier>
            <dcterms:title>First Parameter</dcterms:title>
            <dcterms:description>The first parameter for this sample predefined query</dcterms:description>
            <oslc:valueType rdf:type="http://www.w3.org/2001/XMLSchema#dateTime"/>
            <oslc:required rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</oslc:required>
         </oslc:PredefinedQueryParameter>
      </oslc:predefinedQueryParameter>
      <oslc:predefinedQueryParameter>
         <oslc:PredefinedQueryParameter>
            <dcterms:identifier>Param2</dcterms:identifier>
            <dcterms:title>Second Parameter</dcterms:title>
            <dcterms:description>The second parameter for this sample predefined query</dcterms:description>
            <oslc:valueType rdf:type="http://www.w3.org/1999/02/22-rdf-syntax-ns#string"/>
            <oslc:required rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</oslc:required>
         </oslc:PredefinedQueryParameter>
      </oslc:predefinedQueryParameter>
   </oslc:PredefinedQuery>
   
</rdf:RDF>

A client would post a document like this to the predefined query URI identified in the discovery 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#">

   <oslc:QueryParameters>
      <oslc:parameterValue>
         <oslc:ParameterValue>
            <dcterms:identifier>Param1</dcterms:identifier>
            <oslc:value rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2002-10-10T12:12:23-05:00</oslc:value>
         </oslc:ParameterValue>
      </oslc:parameterValue>
      <oslc:parameterValue>
         <oslc:ParameterValue>
            <dcterms:identifier>Param2</dcterms:identifier>
            <oslc:value rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Verified</oslc:value>
         </oslc:ParameterValue>
      </oslc:parameterValue>
   </oslc:QueryParameters>
   
</rdf:RDF>
Edit | Attach | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 19 Jan 2011 - 17:48: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