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 conform to the OSLC Core rules for RDF/XML representations.
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 Comment. 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
- Namespace URI:
http://open-services.net/xmlns/bogus/blogs#
- Type URI:
http://open-services.net/xmlns/bogus/bogus/blogs#Entry
- Properties:
-
dc:title
(XML Literal, exactly-one) title of Podcast
-
dc:modified
(DateTime, exactly-one) - date/time that comment was created
-
dc:creator
(Local In-Line Resource of type foaf:Person
, exactly-one) - name of comment author
-
dc:content
(XML Literal, exactly-one) - content of the comment
- Name:
Comment
- Namespace URI: =http://open-services.net/xmlns/bogus/blogs=
- Type URI:
http://open-services.net/xmlns/bogus/blogs#Comment
- Properties:
-
dc:modified
(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
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.
Click
HERE to see RDF/XML validation results, triples and RDF graph.
<oslc_blog:Entry
rdf:about="http://example.com/blogs/entry/42"
xmlns:oslc_blog="http://open-services.net/xmlns/oslc-core/bogus/blogs#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf="http://http://xmlns.com/foaf/0.1/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:type
rdf:resource="http://open-services.net/xmlns/oslc-core/bogus/blogs#Entry" />
<dc:title>I love trash</dc:title>
<dc:modified>2002-10-10T12:00:00-05:00</dc:modified>
<dc:content>
Anything dirty or dingy or dusty.
Anything ragged or rotten or rusty.
</dc:content>
<dc:creator>
<foaf:Person>
<foaf:name>Oscar T. Grouch</foaf:name>
</foaf:Person>
</dc:creator>
</oslc_blog:Entry>
Below is an example RDF/XML representation of a blog comment.
Click
HERE to see RDF/XML validation results, triples and RDF graph.
<oslc_blog:Comment
rdf:about="http://example.com/comments/883"
xmlns:oslc_blog="http://open-services.net/xmlns/oslc-core/bogus/blogs#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf="http://http://xmlns.com/foaf/0.1/"
xmlns:dc="http://purl.org/dc/elements/1.1/" >
<oslc_blog:entry rdf:resource="http://example.com/blogs/entry/42" />
<dc:content>LOL! Tell us how you really feel, Oscar.</dc:content>
<dc:modified>2002-10-10T12:12:23-05:00</dc:modified>
<dc:creator>
<foaf:Person>
<foaf:name>William B. Bird</foaf:name>
</foaf:Person>
</dc:creator>
</oslc_blog:Comment>
Shape Resources
Below is an example RDF/XML representation of a Resource Shape for the Blog Comment resource defined above.
Click
HERE to see RDF/XML validation results, triples and RDF graph.
<oslc:Shape
rdf:about="http://example.com/shapes/commentshape"
xmlns:oslc="http://open-services.net/xmlns/oslc-core#"
xmlns:oslc_blog="http://open-services.net/xmlns/oslc-core/bogus/blogs#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf="http://http://xmlns.com/foaf/0.1/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title>Blog Comment Shape</dc:title>
<rdf:type rdf:resource="http://open-services.net/xmlns/oslc#Shape" />
<oslc:name>Comment</oslc:name>
<oslc:namespace rdf:resource="http://open-services.net/xmlns/bogus/blog#" />
<oslc:describes rdf:resource="http://open-services.net/xmlns/bogus/blog#Comment" />
<oslc:property>
<oslc:Property>
<oslc:name>modified</oslc:name>
<oslc:occurs>exactly-one</oslc:occurs>
<oslc:namespace rdf:resource="http://purl.org/dc/terms#" />
<rdf:type 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:namespace rdf:resource="http://purl.org/dc/terms#"/>
<rdf:type rdf:resource="http://purl.org/dc/terms#creator" />
<oslc:valueType rdf:resource="http://open-service.net/xmlns/oslc-core/resource-types#LocalInlineResource" />
<oslc:shape rdf:resource="http://example.com/blogs/personshape" />
</oslc:Property>
</oslc:property>
<oslc:property>
<oslc:Property>
<oslc:name>content</oslc:name>
<oslc:namespace rdf:resource="http://purl.org/dc/terms#" />
<rdf:type 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:namespace rdf:resource="http://purl.org/dc/terms#" />
<rdf:type 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:Shape>
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.
<oslc:Shape
rdf:about="http://example.com/shapes/blogquery"
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 Query Shape</dc:title>
<rdf:type rdf:resource="http://open-services.net/xmlns/oslc#Shape" />
<oslc:name>BlogQuery</oslc:name>
<oslc:namespace rdf:resource="http://open-services.net/xmlns/bogus#" />
<oslc:describes rdf:resource="http://open-services.net/xmlns/bogus#BlogQuery" />
<oslc:property>
<oslc:Property>
<oslc:name>entry</oslc:name>
<oslc:namespace rdf:resource="http://open-services.net/xmlns/blog#" />
<oslc:occurs>zero-or-many</oslc:occurs>
<oslc:shape rdf:resource="http://example.com/blogs/entryshape" />
<rdf:type rdf:resource="http://open-services.net/xmlns/blog#Entry" />
<oslc:valueType rdf:resource="http://open-service.net/xmlns/oslc-core/resource-types#InlineResource" />
<oslc:isMemberProperty>true</oslc:isMemberProperty>
</oslc:Property>
</oslc:property>
<oslc:property>
<oslc:Property>
<oslc:name>comment</oslc:name>
<oslc:namespace rdf:resource="http://open-services.net/xmlns/blog#" />
<oslc:occurs>zero-or-many</oslc:occurs>
<oslc:shape rdf:resource="http://example.com/blogs/commentshape" />
<rdf:type rdf:resource="http://open-services.net/xmlns/blog#Comment" />
<oslc:isMemberProperty>true</oslc:isMemberProperty>
<oslc:valueType rdf:resource="http://open-service.net/xmlns/oslc-core/resource-types#InlineResource" />
</oslc:Property>
</oslc:property>
<oslc:property>
<oslc:Property>
<oslc:name>responseInfo</oslc:name>
<oslc:namespace rdf:resource="http://open-services.net/xmlns/oslc#" />
<oslc:occurs>zero-or-one</oslc:occurs>
<oslc:shape rdf:resource="http://example.com/blogs/responseInfoShape" />
<rdf:type rdf:resource="http://open-services.net/xmlns/oslc#ResponseInfo" />
<oslc:valueType rdf:resource="http://open-service.net/xmlns/oslc-core/resource-types#InlineResource" />
</oslc:Property>
</oslc:property>
</oslc:Shape>
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.
<oslc:ServiceProvider
rdf:about="http://example.com/service-provider"
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#"
xml:lang="en">
<dc:title>Blogging Service</dc:title>
<dc:description>Example OSLC Blog Service</dc:description>
<dc:contributor>
<oslc:Contributor>
<dc:title>OSLC Core Workgroup documentation department</dc:title>
<dc:identifier>com.example.oslc.blogservice</dc:identifier>
<oslc:icon rdf:resource="http://example.com/icons/blogservice.ico" />
</oslc:Contributor>
</dc:contributor>
<oslc:namespaceDefinition>
<oslc:NamepaceDefintion>
<oslc:prefix>rdf</oslc:prefix>
<oslc:namespaceURI>http://www.w3.org/1999/02/22-rdf-syntax-ns#</oslc:namespaceURI>
</oslc:NamepaceDefintion>
</oslc:namespaceDefinition>
<oslc:namespaceDefinition>
<oslc:NamepaceDefintion>
<oslc:prefix>dc</oslc:prefix>
<oslc:namespaceURI>http://purl.org/dc/terms#</oslc:namespaceURI>
</oslc:NamepaceDefintion>
</oslc:namespaceDefinition>
<oslc:namespaceDefinition>
<oslc:NamepaceDefintion>
<oslc:prefix>oslc</oslc:prefix>
<oslc:namespaceURI>http://open-services.net/xmlns/oslc#</oslc:namespaceURI>
</oslc:NamepaceDefintion>
</oslc:namespaceDefinition>
<oslc:namespaceDefinition>
<oslc:NamepaceDefintion>
<oslc:prefix>oslc_blog</oslc:prefix>
<oslc:namespaceURI>http://open-services.net/xmlns/bogus/blogs#</oslc:namespaceURI>
</oslc:NamepaceDefintion>
</oslc:namespaceDefinition>
<oslc:service>
<oslc:Service>
<oslc:domain>http://example.com/xmlns/example-cm#</oslc:domain>
<oslc:creationFactory>
<oslc:CreationFactory>
<dc:title>Location for creation of Blog Entries</dc:title>
<oslc:label>Blog Entries</oslc:label>
<oslc:creation rdf:resource="http://example.com/creation/entries" />
<oslc:shape rdf:resource="http://example.com/shapes/blogentry" />
</oslc:CreationFactory>
</oslc:creationFactory>
<oslc:creationFactory>
<oslc:CreationFactory>
<dc:title>Location for creation of Blog Comments</dc:title>
<oslc:label>Blog Comments</oslc:label>
<oslc:creation rdf:resource="http://example.com/creation/comments" />
<oslc:shape rdf:resource="http://example.com/shapes/blogcomment" />
</oslc:CreationFactory>
</oslc:creationFactory>
<oslc:queryCapability>
<oslc:QueryCapability>
<dc:title>Blog Entry and Comment Query</dc:title>
<oslc:label>blogquery</oslc:label>
<oslc:queryBase rdf:resource="http://example.com/query" />
<oslc:shape rdf:resource="http://example.com/shapes/blogquery" />
</oslc:QueryCapability>
</oslc:queryCapability>
</oslc:Service>
</oslc:service>
</oslc:ServiceProvider>
Query Resource
Below is an example query resource, one which would be returned by the below query on our
Click
HERE to see RDF/XML validation results, triples and RDF graph.
<oslc_blog:BlogQuery
rdf:about="http://example.com/query;"
xmlns:oslc_blog="http://open-services.net/xmlns/bogus/blogs#"
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#">
<oslc:responseInfo>
<oslc:ResponseInfo>
<dc:title>Blog Service Query Results for term [remote]</dc:title>
<oslc:self rdf:resource="http://example.com/query?oslc.from [...] entry/42>" />
</oslc:ResponseInfo>
</oslc:responseInfo>
<oslc_blog:comment rdf:resource="http://example.com/blogs/comment/346" />
<oslc_blog:comment rdf:resource="http://example.com/blogs/comment/344" />
<oslc_blog:comment rdf:resource="http://example.com/blogs/comment/673" />
<oslc_blog:comment rdf:resource="http://example.com/blogs/comment/232" />
<oslc_blog:comment rdf:resource="http://example.com/blogs/comment/333" />
<!-- etc. etc. -->
</oslc_blog:BlogQuery>