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 Specification:
Turtle Representation examples

By: The OSLC Core Workgroup

Overview

In this section we provide Turtle format representations of the resources defined in the RDF/XML examples.

Note that we also provide RDF/XML Examples and JSON Examples that match the examples in this appendix.

Resources

Below is an example Turtle representation of the example blog entry.

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

<http://example.com/blogs/entry/1>
      rdf:type oslc_blog:Entry ;
      dcterms:content "\n      Anything dirty or dingy or dusty. \n      
      Anything ragged or rotten or rusty.\n   " ;
      dcterms:creator
              [ rdf:type foaf:Person ;
                foaf:name "Oscar T. Grouch"
              ] ;
      dcterms:modified "2002-10-10T12:00:00-05:00" ;
      dcterms:title "I love trash" .

Below is an example Turtle representation of the example blog comment.

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

<http://example.com/comments/1>
      rdf:type oslc_blog:Comment ;
      oslc_blog:entry <http://example.com/blogs/entry/1> ;
      dcterms:content "LOL! Tell us how you really feel, Oscar." ;
      dcterms:creator
              [ rdf:type foaf:Person ;
                foaf:name "William B. Bird"
              ] ;
      dcterms:modified "2002-10-10T12:12:23-05:00" .

Service Provider Resource

Below is an example Turtle representation of the example blog service provider.

@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dcterms:      <http://purl.org/dc/terms/> .
@prefix oslc:    <http://open-services.net/ns/core#> .


<http://example.com/bugs/service-descriptor.xml>
      rdf:type oslc:ServiceProvider ;
      oslc:prefixDefinition
              [ rdf:type oslc:PrefixDefinition ;
                oslc:prefixBase "http://purl.org/dc/terms#"@en ;
                oslc:prefix "dcterms"@en
              ] ;
      oslc:prefixDefinition
              [ rdf:type oslc:PrefixDefinition ;
                oslc:prefixBase "http://www.w3.org/1999/02/22-rdf-syntax-ns#"@en ;
                oslc:prefix "rdf"@en
              ] ;
      oslc:prefixDefinition
              [ rdf:type oslc:PrefixDefinition ;
                oslc:prefixBase "http://open-services.net/ns/core#"@en ;
                oslc:prefix "oslc"@en
              ] ;
      oslc:service
              [ rdf:type oslc:Service ;
                oslc:creationFactory
                        [ rdf:type oslc:CreationFactory ;
                          oslc:creation <http://example.com/creation/comments> ;
                          oslc:label "Blog Comments"@en ;
                          oslc:shape <http://example.com/shapes/blogcomment> ;
                          dcterms:title "Location for creation of Blog Comments"@en
                        ] ;
                oslc:creationFactory
                        [ rdf:type oslc:CreationFactory ;
                          oslc:creation <http://example.com/creation/entries> ;
                          oslc:label "Blog Entries"@en ;
                          oslc:shape <http://example.com/shapes/blogentry> ;
                          dcterms:title "Location for creation of Blog Entries"@en
                        ] ;
                oslc:domain "http://example.com/xmlns/example-cm#"@en ;
                oslc:queryCapability
                        [ rdf:type oslc:QueryCapability ;
                          oslc:label "blogquery"@en ;
                          oslc:queryBase <http://example.com/query> ;
                          oslc:shape <http://example.com/shapes/blogquery> ;
                          dcterms:title "Blog Entry and Comment Query"@en
                        ]
              ] ;
      dcterms:contributor
              [ rdf:type oslc:Contributor ;
                oslc:icon <http://example.com/icons/blogservice.ico> ;
                dcterms:identifier "com.example.oslc.blogservice"@en ;
                dcterms:title "OSLC Core Workgroup documentation department"@en
              ] ;
      dcterms:description "Example OSLC Blog Service"@en ;
      dcterms:title "Blogging Service"@en .

Shape Resource

Below is an example Turtle representation of the example blog comment shape.

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

<http://example.com/shapes/commentshape>
      rdf:type oslc:Shape , <http://open-services.net/ns/core#Shape> ;
      oslc:describes <http://open-services.net/xmlns/bogus/blog#Comment> ;
      oslc:name "Comment" ;
      oslc:namespace <http://open-services.net/xmlns/bogus/blog#> ;
      oslc:property
              [ rdf:type oslc:Property ; 
                oslc:propertyDefinition <http://purl.org/dc/terms#modified> ;
                oslc:name "modified" ;
                oslc:occurs "exactly-one" ;
                oslc:valueType <http://www.w3.org/2001/XMLSchema#dateTime>
              ] ;
      oslc:property
              [ rdf:type oslc:Property ;
                oslc:propertyDefinition <http://purl.org/dc/terms#creator> ;
                oslc:name "creator" ;
                oslc:occurs "exactly-one" ;
                oslc:shape <http://example.com/blogs/personshape> ;
                oslc:valueType <http://open-services.net/xmlns/oslc-core/resource-types#LocalResource> ;
                oslc:representation "Inline"
              ] ;
      oslc:property
              [ rdf:type oslc:Property ;
                oslc:propertyDefinition <http://purl.org/dc/terms#content> ;
                oslc:name "content" ;
                oslc:occurs "exactly-one" ;
                oslc:valueType rdf:XMLLiteral
              ] ;
      oslc:property
              [ rdf:type oslc:Property ; 
                oslc:propertyDefinition <http://open-services.net/ns/bogus/blogs#Entry> ;
                oslc:name "entry" ;
                oslc:occurs "exactly-one" ;
                oslc:valueType rdf:XMLLiteral
              ] ;
      dcterms:title "Blog Comment Shape" .

Query Resource

Below is an example Turtle representation of the example blog query result.

@prefix oslc:    <http://open-services.net/ns/core#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix oslc_blog:  <http://open-services.net/ns/bogus/blogs#> .
@prefix dcterms:  <http://purl.org/dc/terms/> .

[]    rdf:type oslc_blog:Comment ;
      dcterms:title "Comment #2" .

[]    rdf:type oslc_blog:Comment ;
      dcterms:title "Comment #1" .

[]    rdf:type oslc_blog:Comment ;
      dcterms:title "Comment #4" .

[]    rdf:type oslc_blog:Comment ;
      dcterms:title "Comment #5" .

<http://example.com/query?oslc.where=rdf:type=oslc_blog:Comment&oslc.select=dcterms:title>
      rdf:type oslc:ResponseInfo , oslc:BlogQuery ;
      dcterms:title "Blog Service Query Results for term [remote]" .

[]    rdf:type oslc_blog:Comment ;
      dcterms:title "Comment #3" .
Topic revision: r7 - 31 May 2012 - 13:14:46 - SteveSpeicher
Main.OSLCCoreSpecTurtleExamples moved from Main.OSLCCoreSpecAppendixC on 22 Oct 2010 - 18:33 by DaveJohnson - put it back
 
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