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).

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: r1 - 17 Jan 2011 - 19:34:43 - 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