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.

OSLC Core Appendix B:

RDF/XML Representation Examples DRAFT

By: The OSLC Core Workgroup

Overview

In this appendix we introduce a fictional service with two resource types and then provide examples representations of those resources, a Resource Shape, a Query Resource Shape, a Service Provider and query results in RDF/XML format. These example representations follow the OSLC Core Representations Guidance? which uses a subset of RDF/XML.

Note that clients should be be prepared to any form of RDF/XML not just the one shown in these examples.

Example Resources: fictional OSLC Blog Service

For the sole purpose of providing representation examples, we will define a fictional OSLC Blog Service with two resources: Blog Comment and Blog Entry. Each resource has a small set of required properties and each Comment is associated with an Entry. We will use these definitions in the RDF/XML examples in this appendix and in the JSON, Atom XML and Turtle examples that follow.

For example, we will define the blog entry and blog comment resources as follows:

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

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

Next, the RDF/XML examples for the key resources in our fictional OSLC Blog Service.

Resources

Below is an example RDF/XML representation of a blog entry.

URL: http://example.com/blogs/entry/1

Click HERE to see RDF/XML validation results, triples and RDF graph.

<rdf:RDF    
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dcterms="http://purl.org/dc/terms/"    
   xmlns:foaf="http://http://xmlns.com/foaf/0.1/"    
   xmlns:oslc_blog="http://open-services.net/ns/bogus/blogs#">

   <oslc_blog:Entry
      rdf:about="http://example.com/blogs/entry/1">

      <rdf:type 
         rdf:resource="http://open-services.net/ns/bogus/blogs#Entry" />

      <dcterms:title>I love trash</dcterms:title>
      <dcterms:modified>2002-10-10T12:00:00-05:00</dcterms:modified>
      <dcterms:content>
         Anything dirty or dingy or dusty. 
         Anything ragged or rotten or rusty.
      </dcterms:content>
      <dcterms:creator>
         <foaf:Person>
             <foaf:name>Oscar T. Grouch</foaf:name>
         </foaf:Person>
      </dcterms:creator>

   </oslc_blog:Entry>

</rdf:RDF>

Below is an example RDF/XML representation of a blog comment.

URL: http://example.com/comments/1

Click HERE to see RDF/XML validation results, triples and RDF graph.

<rdf:RDF 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"    
   xmlns:dcterms="http://purl.org/dc/terms/"    
   xmlns:foaf="http://http://xmlns.com/foaf/0.1/"    
   xmlns:oslc_blog="http://open-services.net/ns/bogus/blogs#">

<oslc_blog:Comment 
   rdf:about="http://example.com/comments/1">

   <oslc_blog:entry rdf:resource="http://example.com/blogs/entry/1" />

   <dcterms:content>LOL! Tell us how you really feel, Oscar.</dcterms:content>
   <dcterms:modified>2002-10-10T12:12:23-05:00</dcterms:modified>
   <dcterms:creator>
      <foaf:Person>
          <foaf:name>William B. Bird</foaf:name>
      </foaf:Person>
   </dcterms:creator>

</oslc_blog:Comment>

</rdf:RDF>

Service Provider Resource

Below is an RDF/XML representation of a Service Provider resource for the fictional Blog Service.

Click HERE to see RDF/XML validation results, triples and RDF graph.

<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#"
   xml:lang="en">

<oslc:ServiceProvider 
   rdf:about="http://example.com/service-provider">

   <dcterms:title>Blogging Service</dcterms:title>  
   <dcterms:description>Example OSLC Blog Service</dcterms:description>

   <dcterms:publisher>
      <oslc:Publisher>
         <dcterms:title>OSLC Core Workgroup documentation department</dcterms:title>
         <dcterms:identifier>com.example.oslc.blogservice</dcterms:identifier>
         <oslc:icon rdf:resource="http://example.com/icons/blogservice.ico" />
      </oslc:Publisher>
   </dcterms:publisher>
   
   <oslc:prefixDefinition>
      < oslc:PrefixDefinition >
         <oslc:prefix>rdf</oslc:prefix>
         <oslc:prefixBase>http://www.w3.org/1999/02/22-rdf-syntax-ns#</oslc:prefixBase>
      </oslc:PrefixDefinition >
   </oslc:prefixDefinition >

   < oslc:prefixDefinition >
      < oslc:PrefixDefinition >
         <oslc:prefix>dcterms</oslc:prefix>
         <oslc:prefixBase>http://purl.org/dc/terms/</oslc:prefixBase>
      </oslc:PrefixDefinition >
   </oslc:prefixDefinition >

   < oslc:prefixDefinition >
      < oslc:PrefixDefinition >
         <oslc:prefix>oslc</oslc:prefix>
         <oslc:prefixBase>http://open-services.net/ns/core#</oslc:prefixBase>
      </oslc:PrefixDefinition >
   </oslc:prefixDefinition >

   < oslc:prefixDefinition >
      < oslc:PrefixDefinition >
         <oslc:prefix>oslc_blog</oslc:prefix>
         <oslc:prefixBase>http://open-services.net/ns/bogus/blogs#</oslc:prefixBase>
      </oslc:PrefixDefinition >
   </oslc:prefixDefinition >

   <oslc:service>
      <oslc:Service>
         <oslc:domain>http://example.com/xmlns/example-cm#</oslc:domain>

         <oslc:creationFactory>
            <oslc:CreationFactory>
               <dcterms:title>Location for creation of Blog Entries</dcterms:title>
               <oslc:label>Blog Entries</oslc:label>
               <oslc:creation rdf:resource="http://example.com/creation/entries" />
               <oslc:resourceShape rdf:resource="http://example.com/shapes/blogentry" />
               <oslc:resourceType>http://open-services.net/ns/bogus/blogs#Entry</oslc:resourceType>
               <oslc:usage>http://open-services.net/ns/core#default</oslc:usage>
            </oslc:CreationFactory>
         </oslc:creationFactory>

         <oslc:creationFactory>
            <oslc:CreationFactory>
               <dcterms:title>Location for creation of Blog Comments</dcterms:title>
               <oslc:label>Blog Comments</oslc:label>
               <oslc:creation rdf:resource="http://example.com/creation/comments" />
               <oslc:resourceShape rdf:resource="http://example.com/shapes/blogcomment" />
            </oslc:CreationFactory>
         </oslc:creationFactory>

         <oslc:queryCapability>
            <oslc:QueryCapability>
               <dcterms:title>Blog Entry and Comment Query</dcterms:title>
               <oslc:label>blogquery</oslc:label>
               <oslc:queryBase rdf:resource="http://example.com/query" />
               <oslc:resourceShape rdf:resource="http://example.com/shapes/blogquery" />
            </oslc:QueryCapability>
         </oslc:queryCapability>

      </oslc:Service>
   </oslc:service>

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

Shape Resources

Below is an example RDF/XML representation of a Resource Shape for the Blog Comment resource defined above.

URL: http://example.com/shapes/commentshape

Click HERE to see RDF/XML validation results, triples and RDF graph.

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

<oslc:Shape
   rdf:about="http://example.com/shapes/commentshape">

     <dcterms:title>Blog Comment Shape</dcterms:title>
     <rdf:type rdf:resource="http://open-services.net/ns/core#Shape" />

     <oslc:name>Comment</oslc:name>
     <oslc:describes rdf:resource="http://open-services.net/ns/bogus/blog#Comment" />

     <oslc:property>
         <oslc:Property>
             <oslc:name>modified</oslc:name>
             <oslc:occurs>exactly-one</oslc:occurs>
             <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/modified" />
             <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#dateTime" />
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>creator</oslc:name>
             <oslc:occurs>exactly-one</oslc:occurs>
             <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/creator" />
             <oslc:valueType rdf:resource="http://open-service.net/ns/core#LocalResource" />
             <oslc:representation>Either</oslc:representation>
             <oslc:shape rdf:resource="http://example.com/blogs/personshape" />
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>content</oslc:name>
             <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/content" />
             <oslc:valueType rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral" />
             <oslc:occurs>exactly-one</oslc:occurs>
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>entry</oslc:name>
             <oslc:propertyDefinition rdf:resource="http://open-services.net/ns/bogus/blogs#entry" />
             <oslc:valueType rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral" />
             <oslc:occurs>exactly-one</oslc:occurs>
         </oslc:Property>
     </oslc:property>

</oslc:Shape>

</rdf:RDF>

Query Shape Resource

Below is a Resource Shape that specifies a Query Resource that can have blog entry and blog comment values.

Click HERE to see RDF/XML validation results, triples and RDF graph.

<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:Shape
     rdf:about="http://example.com/shapes/blogquery">

     <dcterms:title>Blog Query Shape</dcterms:title>
     <rdf:type rdf:resource="http://open-services.net/ns/core#Shape" />

     <oslc:name>BlogQuery</oslc:name>
     <oslc:describes rdf:resource="http://open-services.net/ns/bogus#BlogQuery" />

     <oslc:property>
         <oslc:Property>
             <oslc:name>entry</oslc:name>
             <oslc:occurs>zero-or-many</oslc:occurs>
             <oslc:shape rdf:resource="http://example.com/blogs/entryshape" />
             <oslc:propertyDefinition rdf:resource="http://open-services.net/ns/blog#Entry" />
             <oslc:valueType rdf:resource="http://open-service.net/ns/core#Resource" />
             <oslc:representation>Inline</oslc:representation>
        </oslc:Property>
     </oslc:property>

     <oslc:property>
          <oslc:Property>
             <oslc:name>comment</oslc:name>
             <oslc:occurs>zero-or-many</oslc:occurs>
             <oslc:valueShape rdf:resource="http://example.com/blogs/commentshape" />
             <oslc:propertyDefinition rdf:resource="http://open-services.net/ns/blog#Comment" />
          </oslc:Property>
     </oslc:property>
 
     <oslc:property>
          <oslc:Property>
             <oslc:name>responseInfo</oslc:name>
             <oslc:occurs>zero-or-one</oslc:occurs>
             <oslc:valueShape rdf:resource="http://example.com/blogs/responseInfoShape" />
             <oslc:propertyDefinition rdf:resource="http://open-services.net/ns/core#ResponseInfo" />
             <oslc:valueType rdf:resource="http://open-service.net/ns/core#Resource" />
             <oslc:representation>Inline</oslc:representation>
         </oslc:Property>
     </oslc:property>
 
  </oslc:Shape>

</rdf:RDF>

Query Resource

Below is an example query resource, one which would be returned by the below query on the query capability defined above.

Click HERE to see RDF/XML validation results, triples and RDF graph.

<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_blog="http://open-services.net/ns/bogus/blogs#">

     <oslc:ResponseInfo rdf:about="http://example.com/query?oslc.from [...] entry/1&gt;">
         <dcterms:title>Blog Service Query Results for term [remote]</dcterms:title>
     </oslc:ResponseInfo>
     
     <oslc:BlogQuery rdf:about="http://example.com/query?oslc.from [...] entry/1&gt;">
   
        <oslc_blog:comment>
           <oslc_blog:Comment rdf:about="http://example.com/blogs/comment/5">
              <!-- Comment propery values, etc. -->
              <dcterms:title>Comment #5</dcterms:title>
           </oslc_blog:Comment>
        </oslc_blog:comment>
   
        <oslc_blog:comment>
           <oslc_blog:Comment rdf:about="http://example.com/blogs/comment/4">
              <!-- Comment propery values, etc. -->
              <dcterms:title>Comment #4</dcterms:title>
           </oslc_blog:Comment>
        </oslc_blog:comment>
   
        <oslc_blog:comment>
           <oslc_blog:Comment rdf:about="http://example.com/blogs/comment/2">
              <!-- Comment propery values, etc. -->
              <dcterms:title>Comment #2</dcterms:title>
           </oslc_blog:Comment>
        </oslc_blog:comment>
   
        <oslc_blog:comment>
           <oslc_blog:Comment rdf:about="http://example.com/blogs/comment/1">
              <!-- Comment propery values, etc. -->
              <dcterms:title>Comment #1</dcterms:title>
           </oslc_blog:Comment>
        </oslc_blog:comment>
   
        <oslc_blog:comment>
           <oslc_blog:Comment rdf:about="http://example.com/blogs/comment/3">
              <!-- Comment propery values, etc. -->
              <dcterms:title>Comment #3</dcterms:title>
           </oslc_blog:Comment>
        </oslc_blog:comment>
   
       <!-- etc. etc. -->
       
     </oslc:BlogQuery>

</rdf:RDF>


Topic attachments
I Attachment Action Size Date Who Comment
xmlxml query-result-rdf.xml manage 1.9 K 21 Jul 2010 - 19:43 DaveJohnson  
Edit | Attach | Print version | History: r21 < r20 < r19 < r18 < r17 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r18 - 21 Jul 2010 - 19:53:05 - 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