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 AM 2.0 Specification Appendix B: Resource Shapes

Introduction

Service providers may provide shape information about the resources it manages. This shape information is intended to help automated clients intelligently deal with unkown content properties.

AM Resource

The following sample is a resource shape as provided by the example.com server.

<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/am-provider/shapes/Resource">

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

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

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

   <oslc:property>
      <oslc:Property>
         <oslc:name>type</oslc:name>
         <oslc:occurs rdf:resource="http://open-service.net/ns/core#One-or-many" />
         <oslc:propertyDefinition rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" />
            <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#anyURI" />
         <oslc:representation>Reference</oslc:representation>
      </oslc:Property>
   </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>identifier</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Exactly-one" />
             <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/identifier" />
             <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#string" />
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>description</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-one" />
             <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/description" />
             <oslc:valueType rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral" />
         </oslc:Property>
     </oslc:property>

   <oslc:property>
      <oslc:Property>
         <oslc:name>source</oslc:name>
         <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-one" />
         <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/source" />
            <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#anyURI" />
         <oslc:representation>Reference</oslc:representation>
      </oslc:Property>
   </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>creator</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-many" />
             <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/am-provider/shapes/Person" />
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>contributor</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-many" />
             <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/contributor" />
             <oslc:valueType rdf:resource="http://open-service.net/ns/core#LocalResource" />
             <oslc:representation>Either</oslc:representation>
             <oslc:shape rdf:resource="http://example.com/am-provider/shapes/Person" />
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>created</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-one" />
             <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/created" />
             <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#dateTime" />
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>modified</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-one" />
             <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>type description</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-many" />
             <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/type" />
             <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#string" />
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
            <oslc:name>serviceProvider</oslc:name>
            <oslc:propertyDefinition rdf:resource="http://open-services.net/ns/core#serviceProvider" />
            <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-many" />
            <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#anyURI" />
         <oslc:representation>Reference</oslc:representation>
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
            <oslc:name>instanceShape</oslc:name>
            <oslc:propertyDefinition rdf:resource="http://open-services.net/ns/core#instanceShape" />
            <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-one" />
            <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#anyURI" />
         <oslc:representation>Reference</oslc:representation>
         </oslc:Property>
     </oslc:property>

</oslc:Shape>

</rdf:RDF>
 

Link Type Resource

The following sample is a Link Type resource shape.

<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/am-provider/shapes/LinkType">

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

     <oslc:name>Link Type</oslc:name>
     <oslc:describes rdf:resource="http://open-services.net/ns/am#LinkType" />

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

     <oslc:property>
         <oslc:Property>
             <oslc:name>identifier</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Exactly-one" />
             <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/identifier" />
             <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#string" />
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>description</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-one" />
             <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/description" />
             <oslc:valueType rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral" />
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>creator</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-many" />
             <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/am-provider/shapes/Person" />
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>contributor</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-many" />
             <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/contributor" />
             <oslc:valueType rdf:resource="http://open-service.net/ns/core#LocalResource" />
             <oslc:representation>Either</oslc:representation>
             <oslc:shape rdf:resource="http://example.com/am-provider/shapes/Person" />
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>created</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-one" />
             <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/created" />
             <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#dateTime" />
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>modified</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-one" />
             <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>serviceProvider</oslc:name>
            <oslc:propertyDefinition rdf:resource="http://open-services.net/ns/core#serviceProvider" />
            <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-many" />
            <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#anyURI" />
         <oslc:representation>Reference</oslc:representation>
         </oslc:Property>
     </oslc:property>

</oslc:Shape>

</rdf:RDF>

FOAF Person Resource

The Resource shape definition above made a reference to another shape; Person. The following sample is that Person shape definition for the FOAF Person property.

<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/am-provider/shapes/Person">

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

     <oslc:name>Person</oslc:name>
     <oslc:describes rdf:resource="http://http://xmlns.com/foaf/0.1/Person" />

     <oslc:property>
         <oslc:Property>
             <oslc:name>name</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Exactly-one" />
             <oslc:propertyDefinition rdf:resource="http://http://xmlns.com/foaf/0.1/name" />
             <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#string" />
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>mbox</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-many" />
             <oslc:propertyDefinition rdf:resource="http://http://xmlns.com/foaf/0.1/mbox" />
             <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#string" />
         </oslc:Property>
     </oslc:property>

     <oslc:property>
         <oslc:Property>
             <oslc:name>img</oslc:name>
             <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-many" />
             <oslc:propertyDefinition rdf:resource="http://http://xmlns.com/foaf/0.1/img" />
            <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#anyURI" />
         <oslc:representation>Reference</oslc:representation>
         </oslc:Property>
     </oslc:property>


</oslc:Shape>

</rdf:RDF>

Edit | Attach | Print version | History: r6 | r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 28 Jul 2010 - 14:34:38 - 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