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.

Example OSLC Query Capability discussion

This examples is intended to illustrate an OSLC Query Capability works from the point-of-view of an OSLC Workgroup charged with specifying a facility for querying over blog entries and associated comments by title.

This text is based on the OSLC Core Spec DRAFT as of May 4, 2010.

Define shapes of resources to be queried

If you want people to be able to query your resources, then not only must you define your resources in OSLC terms but you must also provide an OSLC Resource Shape for each of the resources you wish to return in query results. In this section we define two resources, one for blog entry and one for blog comment.

The blog entry shape will be here http://example.com/blogs/entryshape and will define this:

  • Name: Entry
  • Namespace URI: http://open-services.net/xmlns/bogus
  • Type URI: http://open-services.net/xmlns/bogus#Entry
  • Properties:
    • dc:title (XML Literal, exactly-one) title of Podcast
    • dc:date (DateTime, exactly-one) - date/time that comment was created
    • dc:creator (In-Line Resource of type foaf:Person, exactly-one) - name of comment author
    • dc:content (XML Literal, exactly-one) - content of the comment

The blog comment shape will be here http://example.com/blogs/commentshape and will define this:

  • Name: Comment
  • Namespace URI: http://open-services.net/xmlns/bogus
  • Type URI: http://open-services.net/xmlns/bogus#Comment
  • Properties:
    • dc:date (DateTime, exactly-one) - date/time that comment was created
    • dc:creator (In-Line Resource of type foaf:Person, exactly-one) - name of comment author
    • dc:content (XML Literal, exactly-one) - content of the comment
    • blog:entry (Resource, exactly-one of type blog:Entry) - link to the Blog Entry

For the actual shape definition in XML/RDF, JSON, Atom or Turtle format: use your imagination.

Define query shape

Now that we have defined shapes for the resources, we also need to tie things together by defining a shape for the query resource. You can think of a query resource as a resource that uses mutli-valued properties to link to one or more different types of resources.

Below is a suitable query resource shape for our blog entry and comment example, represented in RDF/XML:


<oslc:Shape
     rdf:about="http://example.com/blogs/contentquery"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:dc="http://purl.org/dc/terms#"
     xmlns:oslc="http://open-services.net/xmlns/oslc#">

     <dc:title>Blog Content Query Shape</dc:title>
     <rdf:type resource="http://open-services.net/xmlns/oslc#Shape" />

     <oslc:property>
         <oslc:Property>
             <oslc:name>entry</oslc:name>
             <oslc:namespace>http://open-services.net/xmlns/blog#</oslc:namespace>
             <oslc:occurs>zero-or-many</oslc:occurs>
             <oslc:shape rdf:resource="http://example.com/blogs/entryshape" />
             <rdf:type resource="http://open-services.net/xmlns/blog#Entry" />
             <oslc:isMemberProperty>true</oslc:isMemberProperty>
         </oslc:Property>
     </oslc:property>

     <oslc:property>
          <oslc:Property>
             <oslc:name>comment</oslc:name>
             <oslc:namespace>http://open-services.net/xmlns/blog#</oslc:namespace>
             <oslc:occurs>zero-or-many</oslc:occurs>
             <oslc:shape rdf:resource="http://example.com/blogs/commentshape" />
             <rdf:type resource="http://open-services.net/xmlns/blog#Comment" />
             <oslc:isMemberProperty>true</oslc:isMemberProperty>
         </oslc:Property>
     </oslc:property>
 
  </oslc:Shape>

 

Example queries

TBD

Edit | Attach | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 04 May 2010 - 17:41:45 - DaveJohnson
 
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