HistoryViewLinks to this page 2012 September 7 | 04:34 pm

Contents


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>
   <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-services.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-services.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://open-services.net/ns/core#Resource" />
     <oslc:representation rdf:resource="http://open-services.net/ns/core#Reference" />
    </oslc:Property>
   </oslc:property>

   <oslc:property>
     <oslc:Property>
       <oslc:name>identifier</oslc:name>
       <oslc:occurs rdf:resource="http://open-services.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-services.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-services.net/ns/core#Zero-or-one" />
     <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/source" />
     <oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource" />
     <oslc:representation rdf:resource="http://open-services.net/ns/core#Reference" />
    </oslc:Property>
   </oslc:property>

   <oslc:property>
    <oslc:Property>
     <oslc:name>creator</oslc:name>
     <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/creator" />
     <oslc:valueType rdf:resource="http://open-services.net/ns/core#AnyResource" />
     <oslc:range rdf:resource="http://http://xmlns.com/foaf/0.1/Person" />
     <oslc:valueShape rdf:resource="http://example.com/oslc/shapes/Person" />
     <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-many" />
     <oslc:representation rdf:resource="http://open-services.net/ns/core#Either" />
    </oslc:Property>
   </oslc:property>

   <oslc:property>
    <oslc:Property>
     <oslc:name>contributor</oslc:name>
     <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/contributor" />
     <oslc:valueType rdf:resource="http://open-services.net/ns/core#AnyResource" />
     <oslc:range rdf:resource="http://http://xmlns.com/foaf/0.1/Person" />
     <oslc:valueShape rdf:resource="http://example.com/oslc/shapes/Person" />
     <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-many" />
     <oslc:representation rdf:resource="http://open-services.net/ns/core#Either" />
    </oslc:Property>
   </oslc:property>

   <oslc:property>
     <oslc:Property>
       <oslc:name>created</oslc:name>
       <oslc:occurs rdf:resource="http://open-services.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-services.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-services.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-services.net/ns/core#Zero-or-many" />
      <oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource" />
      <oslc:representation rdf:resource="http://open-services.net/ns/core#Reference" />
     </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-services.net/ns/core#Zero-or-one" />
      <oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource" />
      <oslc:representation rdf:resource="http://open-services.net/ns/core#Reference" />
     </oslc:Property>
   </oslc:property>

</oslc:Shape>

</rdf:RDF>

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-services.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-services.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-services.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:propertyDefinition rdf:resource="http://purl.org/dc/terms/creator" />
     <oslc:valueType rdf:resource="http://open-services.net/ns/core#AnyResource" />
     <oslc:range rdf:resource="http://http://xmlns.com/foaf/0.1/Person" />
     <oslc:valueShape rdf:resource="http://example.com/oslc/shapes/Person" />
     <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-many" />
     <oslc:representation rdf:resource="http://open-services.net/ns/core#Either" />
    </oslc:Property>
   </oslc:property>

   <oslc:property>
    <oslc:Property>
     <oslc:name>contributor</oslc:name>
     <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/contributor" />
     <oslc:valueType rdf:resource="http://open-services.net/ns/core#AnyResource" />
     <oslc:range rdf:resource="http://http://xmlns.com/foaf/0.1/Person" />
     <oslc:valueShape rdf:resource="http://example.com/oslc/shapes/Person" />
     <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-many" />
     <oslc:representation rdf:resource="http://open-services.net/ns/core#Either" />
    </oslc:Property>
   </oslc:property>

   <oslc:property>
     <oslc:Property>
       <oslc:name>created</oslc:name>
       <oslc:occurs rdf:resource="http://open-services.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-services.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-services.net/ns/core#Zero-or-many" />
      <oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource" />
      <oslc:representation rdf:resource="http://open-services.net/ns/core#Reference" />
     </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-services.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-services.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-services.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>