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 Version 2.0* - DRAFT

By: The OSLC Core Specification Workgroup

* See About the version number below for the reasoning behind the Version 2.0 designation

This is a DRAFT document that is under review. You can help by reviewing carefully, raising issues for discussion on the OSLC Core WG mailing list and document specific issues that need response on the issues page here OslcCoreV1Issues? .


Overview

The Open Services for Lifecycle Collaboration (OSLC) initiative is creating an family of web services specifications for products, services and other tools that support all phases of the software and product lifecycle. The purpose of these specifications is to enable integration between products that support Application Life-cycle Management (ALM) and Product Life-cycle Management (PLM). Each part of the lifecycle or domain has its own group and specification, for example there are Change Management, Quality Management, Estimation & Measurement and more. Each of the domain specifications are built upon this core specification.

This OSLC Core Specification sets out the common features that every OSLC Service can be expected to support using terminology from the World Wide Web Consortium (W3C). New terminology that we introduce can be found in the glossary section below. This specification is most about OSLC Services, it specifies what OSLC Services MUST, SHOULD and MAY do. It also contains some requirements for other OSLC specifications and for OSLC clients.

OSLC services are accessible via a Service Provider Resource that describes the Services offered. Each Service can provide Creation Factories for resource creation, Query Capabilities for resource query and Delegated UI Dialogs to enable clients to create and select resources via a web UI. Query Capabilities and Creation Factories may offer Resource Shapes that describe the properties of resources managed by the service. This is illustrated in the diagram below. See the section below on Service Provider Resources for further discussion of these concepts.

OSLC Core Specification concepts and relationships

Diagram of OSLC concepts

This specification establishes terminology and rules for defining resources in terms of the property names and value-types that are allowed and required. OSLC domain specifications are expected to use these rules and terminologies to describe their resources. See the OSLC Defined Resources section for more on this topic.

This specification also sets out rules for creating resource representations in RDF/XML, JSON, Atom and Turtle formats. OSLC domain specifications are expected to refer to these rules when specifying how their resources are to be represented. See the OSLC Defined Resource Representations section for the representation rules and examples of each format.

About the version number. We use the version number "2.0" even though there has never been an OSLC Core Version 1.0 specification. We do this because this OSLC Core specification was written after a series of version 1.0 domain specifications were finalized by OSLC workgroups. The version 2.0 domain specifications will all be based on this Core specification and to avoid confusion this specification will also be known as Version 2.0.

About RDF. The resource and property-based data model used in OSLC resources is based on the Resource Description Framework (RDF) and OSLC requires RDF representations, but OSLC uses a small number of RDF concepts and does not require implementers to provide an RDF triple-store or a SPARQL query-engine.

Design considerations

The core philosophies of OSLC are to build on the powerful and scalable architecture of the World Wide Web and to do the simplest possible things that will work.

Build on the WWW. OSLC builds on the architecture of the WWW and follows the REST architectural pattern. This means that OSLC services provide a uniform HTTP interface, OSLC URIs are stable and opaque and, in simple terms, OSLC works like the web.

Keep things simple. Doing the simplest things that will possibly work means a couple of different things in regard to OSLC. It means starting with simple and existing concepts. For example, we model everything as resources with property values and do not stray from that model. Keeping things simple also means building on established and well-known specifications, but also carefully limiting the number of other specifications that we reference. This simplicity is intended to enable loose coupling and to make life easier for everybody: OSLC domain work groups, OSLC service implementers and OSLC client developers.

Accommodate different schemas. Because of the breadth of the OSLC domains, spanning lifecycle and platforms, OSLC has to work for systems with very different data schemas or no schemas at all. Flexibility is needed, but some OSLC Services must be able to offer resource shape information so that clients can learn what properties are allowed and required for resource creation, query and reporting.

Accommodate different representations. Different client platforms might require or at least prefer different representations. For example, in the browser a JSON or Atom format representation might work best. OSLC Services will all support RDF/XML and may support other formats including JSON, Atom and Turtle.

Glossary of terms

This is a guide to some of the terminology used in this document. The following definitions are standard W3C concepts. OSLC uses these concepts without modification – their definitions are summarized here for the convenience of the reader. See http://www.w3c.org.

  • Resource: A network data object or service that can be identified by a URI. Resources may be available in multiple representations (e.g. multiple languages, data formats, size, resolutions) or vary in other ways. (reference: HTTP)

  • Representation: An HTTP payload entity, included in an HTTP response, that is subject to content negotiation. There may exist multiple representations. associated with a particular HTTP response status. (reference: HTTP)

  • URI: Uniform Resource Identifiers are simply formatted strings which identify--via name, location, or any other characteristic -- a resource (reference: HTTP)

Here are the OSLC specific terms used in this specification:

  • OSLC Domain: an OSLC Domain is one ALM or PLM topic area such as Change Management, Requirements management or Automation. Each OSLC Domain will have its own OSLC specification that complies with this Core specification.

  • OSLC Service: a set of capabilities that enable a web client to create, retrieve, update and delete resources managed by an ALM or PLM product or online service offering and associated with one OSLC Domain.

  • OSLC Service Provider: a product or online service offering that provides an implementation of one or more OSLC Services, which may themselves implement different OSLC Domain specifications.

  • OSLC Resource: a resource that is managed by an OSLC Service, may have properties and may link to other resources including those provided by other OSLC Services.

  • OSLC Defined Resource: a resource that is either defined by an OSLC specification, defined by an OSLC Resource Shape or both.

  • OSLC Defined Properties: resource properties that are defined by an OSLC specification, defined by an OSLC Resource Shape or both.

  • OSLC Resource Shape: defines the set of OSLC Properties expected by a particular service or operation and for each their value types, allowed values, cardinality and optionality. Examples of such operations include OSLC Creation Resource and Query Resource. Other examples might include applications that display data in tables.

  • OSLC Creation Factory. An OSLC Service may provide one or more creation factories to enable the creation of new resources. A creation factory provides a URI used to create new resources via HTTP POST and may also provide Resource Shapes that describe the types of resources that may be created.

  • OSLC Query Capability: An OSLC Service may provide one or more query capabilities to enable query of resources. A query capability provides a base URI for forming query resource URIs and, optionally, Resource Shapes that describe the property values that may be expected in the resources that are queryable via the query capability.

  • OSLC Response Info Resource: An OSLC Defined Resource that provides information about a paged resource representation, e.g. the next page in a multi-page query result representation.

Notation and Conventions

The key words "MUST", "MUST NOT", "REQUIRED, SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY" and "OPTIONAL" in this document are to be interpreted as described in RFC2119.


OSLC Defined Resources

An OSLC Resource is a resource managed by an OSLC Service. An OSLC Resource is typically something like a Change Request, a Requirement or some other ALM or PLM artifact or record, but an OSLC Resource could also be a video or a presentation file. This resource could be stored in a relational database, a flat-file on disk or a source code control system.

An OSLC Service can manage any type of resource and of any content type, but OSLC also defines a special set of resources. OSLC Defined Resources are specified in this document and can be specified in any OSLC specification. Resources are defined by the properties that are allowed and required in the resource.

Defining an OSLC resource

OSLC uses a simple model of resources with property values and this model is intended to be consistent with the Resource Description Framework (RDF) data model (reference: RDF Concepts). OSLC also builds upon the Extensible Markup Language (XML) namespace mechanism (reference: XML Namespaces).

When specifying a resource or a property, OSLC Specifications define its type as a URI which can be decomposed into a namespace URI and a name. We abbreviate type URIs as Prefixed Names (reference: Prefixed Names), which are represented in XML as QNames. The namespace used for resources defined in this specification is defined as follows:

  • Namespace URI: http://open-services.net/ns/core#
  • Default Prefix: oslc

Defining an OSLC Resource

OSLC Specifications MUST provide the following information when defining an OSLC Defined Resource or Resource value-type:

  • Name (String): name of the resource which MUST be valid as the Local Name part of a QName (reference: XML Namespaces).
  • URI (URI): The URI of the resource definition. Per the rules of Prefixed Names, this URI is formed by appending the Name to the end of the Namespace URI of the specification that defines the resource. For example, the resource named Service (defined below) gets the Type URI of http://open-services.net/ns/core#Service.

Once a resource is defined, its allowed and required properties can be defined.

Defining OSLC Properties

OSLC Specifications MAY provide a list of properties allowed and/or required for a particular operation on an OSLC Defined Resource. Specifications that do so SHOULD provide the following information for each property that they define.

  • Name (String): name of the resource which MUST be valid as the Local Name part of a QName (reference: XML Namespaces).
  • URI (URI): The URI of the property's type. Per the rules of Prefixed Names, the URI is formed by appending the Name to the end of the Namespace URI associated with the property. For example, the resource named oslc:ServiceProviderCatalog (defined below in the Service Providers Section) defines a property named domain with the URI of http://open-services.net/ns/core#domain
  • Title (String): Title of the property.
  • Description (String): Description of the property.
  • Occurs (String): may be 'exactly-one', 'zero-or-one', 'one-or-many' or 'zero-or-many'
  • Value-types (URI): A property MAY allow multiple the value-types, each value-type MUST be a URI that corresponds to one of the following:
    • Literal value-types:
      • Boolean: a boolean type as specified by XSD Boolean ( http://www.w3.org/2001/XMLSchema#boolean, reference: XSD Datatypes).
      • DateTime: a Date and Time type as specified by XSD dateTime ( http://www.w3.org/2001/XMLSchema#dateTime, reference: XSD Datatypes).
      • Decimal: a decimal number type as specified by XSD Decimal ( http://www.w3.org/2001/XMLSchema#decimal, reference: XSD Datatypes).
      • Double: a double floating-point number type as specified by XSD Double ( http://www.w3.org/2001/XMLSchema#double, reference: XSD Datatypes).
      • Float: a floating-point number type as specified by XSD Float ( http://www.w3.org/2001/XMLSchema#float, reference: XSD Datatypes).
      • Integer: an integer number type as specified by XSD Integer ( http://www.w3.org/2001/XMLSchema#integer, reference: XSD Datatypes).
      • String: a string type as specified by XSD String ( http://www.w3.org/2001/XMLSchema#string, reference: XSD Datatypes).
      • XMLLiteral: a Literal XML value ( http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral).
    • Resource value-types:
      • Resource: value is a resource at a specified URI (i.e. a URI Reference) ( http://open-services.net/ns/core#Resource ).
      • Local Resource: value is a local resource available only inside the resource being defined (i.e. a Blank Node) ( http://open-services.net/ns/core#LocalResource ).
  • Representation (String): for properties with a resource value-type, OSLC specifications should also specify how the resource will be represented. The options are reference, inline or either. Refer to the OSLC Representations section below to see how this is reflected in RDF/XML, JSON and other representations.
  • Range (String): for properties with a resource value-type, OSLC specifications should also specify the range of possible resource classes allowed. This can be specifed as any or as a list of one or more resource classes specified by Prefixed Name.

In the rest of this document we will define OSLC resources as described above. The below section titled OSLC Defined Resource Representations defines how OSLC resources are to be represented in RDF/XML, JSON and other formats.

OSLC Services that wish to provide the above information in a machine-readable format might consider using OSLC Resource Shapes, see Appendix A: Common Properties and Resources for more information.

Unknown properties and content

For OSLC Defined Resources, clients should assume that an OSLC Service will discard unknown property values. An OSLC Service MAY discard property values in an OSLC Defined Resource that are not part of the resource's definition or the relevant Resource Shape.

The rule is different for clients. When doing an update, OSLC clients MUST preserve any unknown property-values and other content in OSLC Defined Resources.

Resource Operations

OSLC Services use HTTP for operations on resources, that comply with the HTTP specification (reference: HTTP).

Resource Creation

To create an OSLC Defined Resource, or any type of resource managed by a service, an OSLC client HTTP POSTs a representation of that resource to a Creation URI. See the section on Creation Factories for more information.

Resource Removal

To delete an OSLC Defined Resource, or any type of resource managed by a service, a client performs an HTTP DELETE on the resource's URI.

Resource Update

To update an OSLC Resource in an OSLC Service, a client fetches a representation of that resource via HTTP GET. The client updates the representation and then uses HTTP PUT to send the new representation to the resource's URI.

It bears repeating that, when doing an update, OSLC clients MUST preserve any unknown property-values and other content in OSLC Defined Resources.

Because the update process involves first getting a resource, modifying it and then later putting it back to the server there is the possibility of a conflict. Some other client may have have updated the resource. To mitigate this problem, OSLC Services can use the HTTP If-Match header:

  • If the HTTP If-Match header is missing OSLC services MAY return HTTP Bad Request (400) status code to indicate that the header is required.
  • If the HTTP If-Match header is present OSLC services will behave as described in the HTTP specification, returning an HTTP Precondition Failed (412) error to indicate that the header does not match.
  • If the HTTP If-Match header is present and it matches, but there is some other problem or conflict with the update then OSLC services MAY return an HTTP Conflict (409) to indicate that problem.

OSLC Services MAY use other techniques for resource update such as OSLC Core Guidance: Partial Update.

Resource Paging

OSLC services MAY support a technique called Resource Paging to enable clients to retrieve resources one page at a time.

When a client requests a resource, the client can expect that the entire resource will be returned in the response, with all property values. This can be problematic because, in some cases, resources may be so large that a client might not want to retrieve the entire resource in one HTTP response.

One solution for response size-sensitive Clients is to check size before loading. Clients that do not wish to load large resources can use the HTTP HEAD method to determine the size of a resource and, according to the rules of HTTP the server's SHOULD include an HTTP Content-Length header that indicates the size of the resource as the "decimal number of OCTETs." If the size is too large, a client can choose not to retrieve the resource.

Another solution is to use Resource Paging.

Here's how Resource Paging works. To get a paged version of a resource, a client adds the "key=value" pair oslc.paging=true to the query component of the resource URI and the server MAY respond by returning a representation that contains partial information about the resource; only a subset of the resource's property values. When a page is returned it, and it is NOT the last page in the sequence, then it SHOULD include an oslc:ResponseInfo (defined below), which that contains a resource-valued property oslc:nextPage that links to a resource that represents the next page of property-values.

A client can also request paging by adding the "key=value" pair oslc.pageSize to the query string component of the resource URI. By adding this, a client requests that the server respond with a specific number of property values. For example, oslc.pageSize=20 indicates to the server that the client would like 20 values per page. OSLC services MAY ignore oslc.pageSize.

When Resource Paging is used, the values of a multi-valued property MAY be split across resource pages. Each property value MUST be represented in its entirety and not split across multiple partial resource pages.

Unstable Paging

Because HTTP is a stateless protocol and OSLC Services manage resources that can change frequently, OSLC clients SHOULD assume that resources can change as they page through them using the oslc:nextPage mechanism.

Stable Paging

Some OSLC Services might wish to guarantee stable paging, meaning that the chain of oslc:nextPage links in a resource represent a snapshot in time and wil not change as the client pages through them. OSLC specification that require stable paging SHOULD state this requirement and specify to which resources it applies.

Note that because stable paging implementations are based on server-side state, it is possible that such state will expire. Implementations can use the HTTP Code 410 (Expired) to indicate to clients that the next-page link they requested has expired.

Response Information

Resources returned via Resource Paging MUST include resource of type oslc:ResponseInfo. A response info value describes information about the HTTP response body in which it appears. This specification defines its use for resource paging.

  • Name: ResponseInfo
  • URI: http://open-services.net/ns/core#ResponseInfo

Prefixed Name Occurs Read-only Value-typeSorted ascending Represen-tation Range Description
oslc:totalCount zero-or-one True Integer n/a n/a Total number of results across all pages, its value should be non-negative.
oslc:nextPage zero-or-one True Resource Reference unspecified Link to next page of response
dcterms:title zero-or-one True XML Literal n/a n/a Title of the response
dcterms:description zero-or-one True XML Literal n/a n/a Description of response

Here's an example, using the OSLC Core RDF/XML representation guidance, that illustrates how the oslc:ResponseInfo resource is included.

Example: Resource Paging, partial response with response info resource

Example URI: http://example.com/blogs/entry/1?oslc.paging=true&pageno=2

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

   <oslc_blog:Entry
      rdf:about="http://example.com/blogs/entry/1">
      <!-- partial property values of of the blog entry -->
   </oslc_blog:Entry>

   <oslc:ResponseInfo rdf:about="http://example.com/blogs/entry/1?oslc.paging=true&pageno=2">
      <oslc:nextPage rdf:resource="http://example.com/blogs/entry/1?oslc.paging=true&pageno=3" />
   </oslc:ResponseInfo>

</rdf:RDF>

Refer to the OSLC Defined Resource Representation guidance for an explanation of how the response info resource may be represented in RDF/XML.

Selective Property Values

OSLC services MAY support a technique called Selective Properties to enable clients to retrieve only selected property values.

By adding the key=value pair oslc.properties, specified below, to a resource URI, a client can request a new resource with a subset of the original resource's values. Here's how the selective properties values oslc.properties and oslc.prefix work.

oslc.properties

The oslc.properties key=value pair lets you specify the set of properties to match in a property tree pattern. Both immediate and nested properties may be specified. A nested property is a property that belongs to the resource referenced by another property. Nested properties are enclosed in brace brackets, and this nesting may be done recursively, i.e. a nested property may contain other nested properties.

For example, suppose we have a bug report resource at the following URL:

 http://example.com/bugs/4242

Suppose this bug resource has properties such as dcterms:title, dcterms:description, and dcterms:creator, and that dcterms:creator refers to a person resource that has properties such as foaf:givenName and foaf:familyName. Suppose you want a representation of the bug report that includes its dcterms:title and the foaf:givenName and foaf:familyName of the person refered to by its dcterms:creator. The following URL illustrates the use of the oslc.properties query value to include those properties:

http://example.com/bugs/4242?oslc.properties=dcterms:title,dcterms:creator{foaf:givenName,foaf:familyName} 

Syntax

The oslc.properties pair is defined by the oslc_properties term in the following BNF grammar:

oslc_properties ::= "oslc.properties=" properties
properties      ::= property ("," property)*
property        ::= identifier | nested_prop | wildcard
identifier      ::= PrefixedName 
PrefixedName    ::= /* see "SPARQL Query Lanaguage for RDF", http://www.w3.org/TR/rdf-sparql-query/#rPrefixedName */
nested_prop     ::= property "{" properties "}"
wildcard        ::= "*"

oslc.prefix

In our examples of oslc.properties, property names include a URI prefix, i.e. dcterms: or foaf:. An OSLC service SHOULD predefine URI prefixes for its properties. Here we assume that OSLC has predefined the Dublin Core ( dcterms:) and Friend of a Friend ( foaf:) prefixes. However, OSLC resources SHOULD also be open to new content, which means that new properties may not have predefined URI prefixes. We therefore need a way to define new URI prefixes in resource requests. The oslc.prefix value lets you specify URI prefixes used in property names. For example, suppose the foaf: prefix was not predefined. The following URL illustrates the use of the oslc.prefix value to define it:

http://example.com/bugs/4242?oslc.prefix=foaf=<http://xmlns.com/foaf/0.1/>&oslc.properties=foaf:lastName,...

Syntax

The syntax of the oslc.prefix is defined by the oslc_prefix term in the following BNF grammar:

oslc_prefix ::= "oslc.prefix=" prefix_defs
prefix_defs ::= prefix_def ("," prefix_def)*
prefix_def  ::= prefix "=" uri_ref_esc
prefix      ::= PN_PREFIX
PN_PREFIX   ::= /* see "SPARQL Query Lanaguage for RDF", http://www.w3.org/TR/rdf-sparql-query/#rPN_PREFIX */
uri_ref_esc ::= /* an angle bracket-delimited URI reference in which > and \ are \-escaped. */

Common Properties

OSLC domains specifications are strongly encouraged to use the common properties approved by the OSLC Core Workgroup (See OSLC Core Spec Appendix A DRAFT) rather than defining new properties.


Service Provider Resources

OSLC services are accessible via a Service Provider Resources that describes each service, which domain specifications the service implements as well as the creation, query and delegated UI capabilities of each service.

Additionally, a provider may offer a Service Provider Catalog that lists related Service Providers.

Conceptual Model

The conceptual model of Service Provider Catalog and Service Provider resources is simple. They are both resources with property values. The values allowed and required in each type of resource are defined below.

The diagram below illustrates the Service Provider Catalog and Service Provider concepts and relationships. As you can see there are two Resources defined: Service Provider Catalog and Service Provider. There are also a set of Local In-Line Resources that are used inside the Resources to define namespaces, OAuth configurations, contributors as well as services and their capabilities.

Service Provider concepts and relationships

Next, we will formally define the Service Provider Catalog and Service Provider resources.

Resource: Service Provider Catalog

Service Provider Catalogs are used in the discovery of OSLC Service Providers, to simplify the configuration of tools that will integrate with providers of OSLC-defined services. These catalogs may contain contain other nested catalogs as well as service providers.

  • Name: ServiceProviderCatalog
  • URI: http://open-services.net/ns/core#ServiceProviderCatalog

Prefixed Name Occurs Read-only Value-type Represen-tation Range Description
dcterms:title zero-or-one True XMLLiteral n/a n/a Title of the service provider catalog
dcterms:description zero-or-one True XMLLiteral n/a n/a Description of the service provider catalog
dcterms:publisher zero-or-one True Local Resource Inline oslc:Publisher Describes the software product that provides the implementation.
oslc:domain zero-or-many True Resource Reference n/a URI of the OSLC domain specification that may be implemented by referenced services
oslc:serviceProvider zero-or-many True Resource Either oslc:ServiceProvider A service offered by the service provider.
oslc:serviceProviderCatalog zero-or-many True Resource Either oslc:ServiceProivderCatalog Additional service provider catalog.
oslc:oauthConfiguration zero-or-many True Local Resource Inline oslc:OAuthConfiguration Defines the three OAuth URIs required for a client to act as an OAuth consumer.

Resource: Service Provider

A Service Provider describes a set of services offered by an OSLC implementation.

  • Name: ServiceProvider
  • URI: http://open-services.net/ns/core#ServiceProvider

Prefixed Name Occurs Read-only Value-type Represen-tation Range Description
dcterms:title zero-or-one True XMLLiteral n/a n/a Title of the service provider
dcterms:description zero-or-one True XMLLiteral n/a n/a Description of the service provider
dcterms:publisher zero-or-one True Local Resource Inline oslc:Publisher Describes the software product that provides the implementation.
oslc:service one-or-many True Local Resource Inline oslc:Service Describes a service offered by the service provider.
oslc:details one-or-many True Resource Reference any A URL that may be used to retrieve a web page to determine additional details about the service provider.
oslc:prefixDefinition zero-or-more True Local Resource Inline oslc:PrefixDefinition Defines a namespace prefix for use in JSON representations and in forming OSLC Query Syntax strings.
oslc:oauthConfiguration zero-or-one True Local Resource Inline oslc:OAuthConfiguration Defines the three OAuth URIs required for a client to act as an OAuth consumer.

Resource: Service

A Service describes the specific services offered by an implementation of an OSLC specification.

  • Name: Service
  • URI: http://open-services.net/ns/core#Service

Prefixed Name Occurs Read-only Value-type Represen-tation Range Description
oslc:domain exactly-one True Resource n/a Any namespace URI of the OSLC domain specification that is implemented by this service.
oslc:creationFactory zero-or-many True Local Resource n/a oslc:CreationFactory enables clients to create new resources
oslc:queryCapability zero-or-many True Local Resource n/a oslc:QueryCapability enables clients query across a collection of resources
oslc:selectionDialog zero-or-many True Local Resource n/a oslc:Dialog enables clients to select a resource via UI
oslc:creationDialog zero-or-many True Local Resource n/a oslc:Dialog enables clients to create a resource via UI

Resource: Creation Factory

A Creation Factory describes a creation factory, capable of creating new resources via HTTP GET.

  • Name: CreationFactory
  • URI: http://open-services.net/ns/core#CreationFactory

Prefixed Name Occurs Read-only Value-type Represen-tation Range Description
dcterms:title exactly-one True XMLLiteral n/a n/a title string that could be used for display
oslc:label zero-or-one True String n/a n/a very short label for use in menu items
oslc:creation exactly-one True Resource Reference n/a to create a new resource via the factory, post it to this URI
oslc:resourceShape zero-or-many True Resource Reference oslc:ResourceShape a Creation Factory MAY provide Resource Shapes that describe shapes of resources that may be created.
oslc:resourceType zero-or-more True anyURI n/a n/a the expected resource type URI of the resource that will be created using this creation factory. These would be the URIs found in the result resource's rdf:type property.
oslc:usage zero-or-more True String n/a n/a an identifier for the domain specified usage of this creation factory. If a service provides multiple creation factories, it may designate the primary or default one that should be used with a property value of http://open-services/ns/core#default

Resource: Query Capability

A Query Capability describes a query capability, capable of querying resources via HTTP GET or POST.

  • Name: QueryCapability
  • URI: http://open-services.net/ns/core#QueryCapability

Prefixed Name Occurs Read-only Value-type Represen-tation Range Description
dcterms:title exactly-one True XMLLiteral n/a n/a title string that could be used for display
oslc:label zero-or-one True String n/a n/a very short label for use in menu items
oslc:queryBase exactly-one True Resource Reference n/a the base URI to use for queries. Queries may be invoked either by HTTP GET or HTTP POST. For HTTP GET, a query URI is formed by appending a key=value pair to the base URI. For HTTP POST, the query parameters are encoded as content with media type application/x-www-form-urlencoded and sent in the request body. The base URI MAY accept other query languages and media types in the request body, e.g. application/sparql-query for SPARQL queries.
oslc:resourceShape zero-or-one True Resource Reference n/a the Query Capability SHOULD provide a Resource Shape that describes the query base URI.
oslc:resourceType zero-or-more True anyURI n/a n/a the expected resource type URI that will be returned with this query capability. These would be the URIs found in the result resource's rdf:type property.
oslc:usage zero-or-more True String n/a n/a an identifier for the domain specified usage of this query capability. If a service provides multiple query capabilities, it may designate the primary or default one that should be used with a property value of http://open-services/ns/core#default

Resource: Dialog

A Dialog describes a delegated user interface (UI) which can be used to allow a user to interactively create a new resource or pick a resource.

  • Name: Dialog
  • URI: http://open-services.net/ns/core#Dialog

Prefixed Name Occurs Read-only Value-type Represen-tation Range Description
dcterms:title exactly-one True XMLLiteral n/a n/a title string that could be used for display
oslc:label zero-or-one True String n/a n/a very short label for use in menu items
oslc:dialog exactly-one True Resource Reference n/a the URI of the dialog
oslc:hintWidth zero-or-one True String n/a n/a valid values for these attributes is defined by the CSS 2 height attribute (reference: CSS2)
oslc:hintHeight zero-or-one True String n/a n/a valid values for these attributes is defined by the CSS 2 height attribute (reference: CSS2)
oslc:resourceType zero-or-more True anyURI n/a n/a the expected resource type URI for the resources that will be returned when using this dialog. These would be the URIs found in the result resource's rdf:type property.
oslc:usage zero-or-more True String n/a n/a an identifier for the domain specified usage of this dialog. If a service provides multiple selection or creation dialogs, it may designate the primary or default one that should be used with a property value of http://open-services/ns/core#default

Resource: Publisher

A Publisher identifies and describes the software product that provides the OSLC implementation.

  • Name: Publisher
  • URI: http://open-services.net/ns/core#Publisher

Prefixed Name Occurs Read-only Value-type Represen-tation Range Description
dcterms:title exactly-one True XMLLiteral n/a n/a title string that could be used for display
oslc:label zero-or-one True String n/a n/a very short label for use in menu items
dcterms:identifier exactly-one unspecified String n/a n/a A URN that uniquely identifies the implementation
oslc:icon zero-or-one True Resource reference n/a URL to an icon file that represents the provider. This icon should be a favicon format and 16x16 pixels in size

Resource: Prefix Definition

Service Providers MUST provide a Prefix Definition for each prefix supported by the service. Each Prefix Definition defines a namespace prefix that clients MAY use in forming OSLC Query Syntax strings.

  • Name: PrefixDefinition
  • URI: http://open-services.net/ns/core#PrefixDefinition

Prefixed Name Occurs Read-only Value-type Represen-tation Range Description
oslc:prefix exactly-one True String n/a n/a namespace prefix to be used for this namespace
oslc:prefixBase exactly-one True String n/a n/a the base URI of the namespace

Resource: OAuth Configuration

Service Providers that support OAuth Authentication SHOULD provide a way for clients to automatically discover the three OAuth URIs necessary to act as an OAuth Consumer.

  • Name: OAuthConfiguration
  • URI: http://open-services.net/ns/core#OAuthConfiguration

Prefixed Name Occurs Read-only Value-type Represen-tation Range Description
oslc:oauthRequestTokenURI exactly-one True Resource Reference n/a URI for obtaining OAuth request token
oslc:authorizationURI exactly-one True Resource Reference n/a URI for obtaining OAuth authorization
oslc:oauthAccessTokenURI exactly-one True Resource Reference n/a URI for obtaining OAuth access token

The next sections cover the Creation Factory and Query Capability in more detail.


Creation Factories

An OSLC Service can provide one or more creation factory to enable the creation of new resources. A creation factory provides a Creation URI used to create new resources via HTTP POST and may also provide Resource Shapes that describe the types of resources that may be created. To create a new OSLC Resource, an OSLC client POSTs a representation of that resource to a Creation Factory's Creation URI.

  • An HTTP POST of content to a Creation URI SHOULD result in the creation of a new resource or an explanation of why creation did not occur via the appropriate HTTP status code.
  • The response to a successful HTTP POST of content to a Creation URI SHOULD include a HTTP Location header that specifies the URI of the newly created resource.

Creating an OSLC Defined Resource

To create an OSLC Defined Resource, an OSLC Client first forms an representation of that resource including the desired and required property values. A client can learn what properties are allowed in a new OSLC Defined Resource via the OSLC specification that defines or, in some cases via a Resource Shape resource. Next the client uses HTTP POST to post that representation to a Creation URI.

  • The response to a successful HTTP POST of a representation to a Creation Resource URI MAY include a representation of the newly created resource.
  • The resource returned MAY contain changes to properties made by the server or new properties added by the server.

Query Capabilities

An OSLC Service may provide one or more Query Capabilities to enable query of resources. A Query Capability provides a base URI for forming Query Resource URIs and MAY provide Resource Shapes that describe the property values that may be expected in the resources that are queryable via the query capability. Thus, Query Capabilities provide a way to discover the resources managed by an OSLC Service.

In a Query Capability, the base URI, as defined by the oslc:queryBase property, is itself a resource managed by the service and it acts as the starting subject resource for the queries based on it. Since the list may contains hundreds of thousands of members, queries are used to filter the list for members that satisfy certain conditions, e.g. the bugs that have high priority and were created this week.

Conceptual Model

To perform a query an OSLC client first creates a URI by starting with a Query Capability's base URI as a base and adding a URI Query String to express the query criteria. The OSLC client then uses HTTP GET to request a Query Resource representation of the query results. The Query Resource representation will contain property values about the query and a collection of resources that match the query criteria.

HTTP GET Queries

To perform an HTTP GET query, an OSLC client starts with the base URI as defined by the oslc:queryBase property of a Query Capability, and appends to it query parameters in a syntax supported by the service. The resulting URI is the query URI. The OSLC client sends an HTTP GET request to the query URI, optionally specifying the preferred content media type for the query response in the HTTP Accept header. OSLC services MUST support query responses in RDF/XML format (media type application/rdf+xml) and MAY support other formats. OSLC services SHOULD support the Query Syntax defined in this specification, but MAY support other syntaxes.

HTTP POST Queries

Alternatively, the client MAY encode the query parameters in the HTTP request body as media type application/x-www-form-urlencoded, and send an HTTP POST request to the base URI. An OSLC service MAY support other query languages using other media types in the request body, e.g. SPARQL (media type application/sparql-query).

Query Syntax

A query URI can be formed by adding a query string to the end of the Query Capability's base URI (or by sending the query string in the request body when using HTTP POST). The syntax used to express the query criteria in that string is specified by each OSLC domain specification.

  • OSLC domain specifications MAY define their own syntax for expressing query criteria in a string.
  • OSLC domain specifications MAY require the OSLC Core Query Syntax as specified below.

The OSLC Core Spec Query Specification document defines a standard set of OSLC query parameters that other OSLC domain specifications MAY use to query resources.


Delegated User Interface Dialogs

OSLC specifications target specific integration scenarios and in some cases, allowing one product to delegate to a user interface defined in another product is a more effective way to support a use case than an HTTP interface that can only be accessed programmatically. There are two cases where this is especially true:

  • Resource creation. When a user is using a web application needs to create a new resource in an OSLC Service Provider. In this case the web application asks the service provider to provide a UI for resource creation and the provider notifies the application when the creation has been completed or canceled by the user.
  • Resource selection. When a user is using web application and needs to pick a resource managed by a OSLC Service Provider. In this case the web application asks the service provider to provide a UI for resource selection and the provider notifies the application when a resource or resources has been selected or if the selection was canceled.

To support these two cases, below we define OSLC Delegated User Interface (UI) Dialogs. Delegated UI Dialogs are a technique where one provider can embed a creation or selection UI into another using a combination of an HTML <iframe> and JavaScript code. The diagram below illustrates how delegated UI dialogs work in a scenario where Provider A wants to allow a user to select or create a resource managed by Provider B.

Delegated UI Dialogs

Next, the details of the Delegated UI Dialog protocol.

Terminology

The following terms are used in discussions of Delegated UI Dialogs:

  • UI Consumer - a web application that is embedding a Delegated UI Dialog from an OSLC Service Provider. This consumer could be a web page, with the Delegated UI Dialog loaded into an iframe or a native application, e.g. an IDE like Eclipse, that is embedding a web browser component.

  • UI Provider - an OSLC Service provider that offers one or more Delegated UI Dialogs. These dialogs will be specified in the provider's Service Provider resource.

The next sections explain how Delegated UI Dialogs work.

Post Message and Window Name protocols

To support the widest range of web browsers, we define two different protocols for communicating the information about the user's action from the UI Provider and back to the UI Consumer. These are the Post Message and Window Name protocols described below.

In both the Post Message and Window Name protocols, the way that a UI Consumer includes a Delegated UI Dialog in an HTML page is to create an iframe and specify the src as the URI of the Delegated UI Dialog to be included plus. The UI Consumer indicates the protocol to be used by appending one of the two fragment identifiers below to the URI:

  • #oslc-core-postMessage-1.0 - Indicates that the Post Message protocol is to be used
  • #oslc-core-windowName-1.0 - Indicates that the Window Name protocol is to be used

The JavaScript code example below shows now a UI Provider can determine which protocol is in use:

    if (window.location.hash == '#oslc-core-windowName-1.0') {       
        // Window Name protocol in use
    } else if (window.location.hash == '#oslc-core-postMessage-1.0') {
        // Post Message protocol in use
    } 

iframe Creation Considerations

Regardless of the protocol in effect, it is recommended that UI Consumers follow the below iframe creation guidelines to provide a more seamless user experience:

  • Embed the iframe within a div element, with height and width set to the values specified in the Service Resource that declares the Delegated UI Dialog. The iframe itself should be set to width and height of '100%.'
  • Set the iframe border size to '0'
  • Set the iframe scrolling to 'auto'

Next, the details for each of the two protocols.

Post Message Protocol

The Post Message protocol relies on the HTML5 function window.postMessage() (reference: HTML5), available in the latest or pending releases of most browsers. UI Consumers must anticipate other, unrelated uses of postMessage(), and should ignore messages not conforming to this protocol.

Typically, the embedded page will be loaded in a window inside another window, such as a iframe inside some surrounding webpage. In such cases, postMessage() must be called on that parent window. But in a native application, an outer page is not needed and the embedded page may be shown directly in the browser's "root" window. When the embedded page has no parent window, it must call postMessage() on its own window.

Here are the responsibilities of the UI Consumer and UI Provider in Post Message protocol.

The UI Consumer's responsibilities

  1. Include the Delegated UI Dialog via iframe (i.e setting iframe src to the URI of the Delegated UI Dialog) or via an embedded browser. Append the fragment identifier #oslc-postMessage-1.0 to the URL to indicate that Post Message is the desired protocol.
  2. Add a 'message' listener to the outer window to receive messages from the Delegated UI Dialog.
  3. Listen for window 'message' events, ignoring events from other sources or not prefixed with "oslc-response:"
  4. When message from Delegated UI Dialog indicates user completed action, free resources and handle action.

The UI Provider's responsibilities

  1. Provide Delegated UI Dialog, an HTML page that provides a user interface for resource creation or selection.
  2. Allow user to perform resource creation or selection.
  3. Once user has created, selected or canceled, send notification using postMessage() to the page's parent window, passed in event.data string, must be prefixed with "oslc-response:" See below for the two possible response formats, one for resource selection and one for creation.
  4. If the page is not parented, then the message is posted to the page's own window. The page must ignore this message to itself.

The below JavaScript code example shows how a UI Provider page would send a response using postMessage() and taking into account the fact that some pages are not parented.

   function respondWithPostMessage(/*string*/ response) {
      (window.parent | window).postMessage("oslc-response:" + response, "*");
   }

Now, the Window Name protocol.

Window Name Protocol

The Window Name protocol uses the HTML DOM window.name property to communicate the response (reference: Window Object) from the UI Provider to the UI Consumer. This special property of window maintains its value even as the window navigates to a different origin, but the ifame's window.name can only be read when the accessing window shares the same origin. For this to happen, when the embedded page is finished it must set the window.name and also change the window.location to a page with the same origin as the outer frame. This not only allows the UI Consumer to access the result, but also fires an event telling the UI Consumer when to do so. This return location is passed to the embedded page using the window.name property.

Here are the responsibilities of the UI Consumer and UI Provider in Window Name protocol.

The UI Consumer's responsibilities

  1. Include the Delegated UI Dialog via iframe (i.e setting iframe src to the URI of the Delegated UI Dialog) or via an embedded browser. Append the fragment identifier #oslc-core-windowName-1.0 to the URL to indicate that Window Name is the desired protocol.
  2. On the iframe, set the frame's window.name to indicate the Return URL.
  3. On the iframe, Listen for 'onload' events
  4. When an 'onload' event occues an the frame's location is equal to the Return URL then read the response from the window.name and finish.

The following Javascript code illustrates the protocol. The code for the destroyFrame(), handleMessage() and displayFrame() methods are not provided in this example, but should be obvious to a JavaScript developer. The UI Consumer must provide these methods.

function windowNameProtocol(/*string*/ dialogURI, onDataReceived) {

   // Step #1: create iframe for Delegated UI Dialog, 
   // adding fragment to indicate the protocol
   var frame = doc.createElement('iframe');
   frame.src= url + #oslc-core-postMessage-1.0';

   // Step #2: set the iframe's window.name to indicate the Return URL
   frame.name = "http://localhost/blank.html";

   // Step #3: listen for onload events on the iframe
   frame.onload = function() {

      try { // May throw an exception if the frame's location is still a different origin

         // Step #4: when frame's location is equal to the Return URL 
         // then read response and return.
         if (frame.contentWindow.location == returnLocation) {
            var message = frame.contentWindow.name;
            destroyFrame(frame);
            handleMessage(message);
         }
      } catch(e) {
         // ignore: access exception when trying to access window name
      };
   };
   displayFrame(frame);
}

The UI Provider's responsibilities

As soon as the embedded page has loaded, perform the following:

  1. Provide Delegated UI Dialog, an HTML page that provides a user interface for resource creation or selection.
  2. Read the Return URL from the window.name variable
  3. Allow user to perform resource creation or selection.
  4. Once user has created, selected or canceled, communicate the user's response by setting the window.name variable to the response. See below for the two possible response formats, one for resource selection and one for creation.
  5. Indicate that user has responded by setting the window.location to the Return URL specified by the UI Consumer.

The JavaScript example below shows how a UI Provider might notify its UI Consumer after a user has responded.

function respondWithWindowName(/*string*/ response) {
   // Step #2: read the return URL
   var returnURL = window.name;

   // Step #4: send the response via the window.name variable
   window.name = response;

   // Step #5: indicate that user has responded
   window.location = returnURL;
}

Resource Selection

Resource Selection can be used when a UI Consumer wants to allow a user to pick a resource that is managed by an OSLC Service. Using either the Post Message or Window Name protocols defined above, the UI Consumer uses an iframe to embed a selection dialog that is provided by the service, then awaits notification that the user has selected a resource.

To enable Resource Selection, an OSLC Service MUST provide in its Service Resource a value for the oslc:selectionDialog property. The property value will include a oslc:dialogURI property that indicates the URI of the selection dialog.

Regardless of how the response from the UI Provider is conveyed to the UI Consumer, the response SHOULD be formatted as follows:

  • Name: results
  • URI: http://open-services.net/ns/core#results

Prefixed Name Occurs Read-only Value-type Represen-tation Range Description
rdf:resource occurs True Resource Reference n/a URI of the resource selected or created
oslc:label occurs True String n/a n/a Short label describing the resource selected

An empty array indicates that the resource selector has been canceled

An example Resource Selection response:

{
    "oslc:results" : [{
            "oslc:label": "Bug 123: Server crash",
            "rdf:resource": "http://example.com/bug123" 
        }, {
            "oslc:label": "Bug 456: Client hangs on startup",
            "rdf:resource": "http://example.com/bug456" 
        }
    ]
} 

Resource Creation

Resource Creation can be used when a UI Consumer wants to allow a user to create a new resource that is managed by an OSLC Service. Using either the Post Message or Window Name protocols defined above, the UI Consumer uses an iframe to embed a creation dialog that is provided by the service, then awaits notification that the user has created a resource.

To enable Resource Creation, an OSLC Service MUST provide in its Service Resource a value for the oslc:creationDialog property. The property value will include a oslc:dialogURI property that indicates the URI of the creation dialog.

Regardless of how the response from the UI Provider is conveyed to the UI Consumer, the response SHOULD be formatted as defined by oslc:results

Example:

{
    "oslc:results" : [ {
            "oslc:label": "Bug 123: Server crash",
            "rdf:resource": "http://example.com/bug123" 
        }, {
            "oslc:label": "Bug 456: Client hangs on startup",
            "rdf:resource": "http://example.com/bug456" 
        }
    ]
} 

Prefilling Creation Dialogs

Service providers MAY support receiving a POST request whose content body is a change request resource definition to the {Creation Dialog URI} to retrieve a URI that represents the embedded page to be used. Service providers MUST respond with a response status of 201 (Created) with the response header Location whose value is the URI to request the newly created form. Service providers MAY NOT maintain the created form in a persistent storage. Clients SHOULD expect that after some elapsed time, a GET on these transient response URIs MAY result with response status codes of 404 (Not found) or a 3xx (Redirect).

That brings us to the end of the Delegated UI section. Next up: Authentication.


Authentication

OSLC Services use standard web protocols for authentication. OSLC Services can use HTTP Basic Authentication, OAuth or both.

HTTP Basic Authentication

OSLC Services MAY protect resources with HTTP Basic Authentication. OSLC Services that use HTTP Basic Authentication SHOULD do so only via SSL.

OAuth Authentication

OSLC Services MAY protected resources with OAuth Authentication.

Form Based Authentication

OSLC Services MAY use other authentication mechanisms, including those common described as Form Based Authentication. OSLC Services that choose to use other authentication mechanisms are responsible for specifying how those mechanisms work.


Error Responses

OSLC Services the standard mechanisms of HTTP to report status and error codes to clients. When an error occurs and useful information can be provided to clients OSLC Services SHOULD return error information in the body of the response.

OSLC Services SHOULD use the Error resource defined below as the basis for forming error responses. OSLC Services SHOULD return an Error resource using the same representation requested by the client via the HTTP Accept header.

Conceptual Model

The following OSLC Defined Resource can be used as the basis for forming an error response.

Resource: Error

  • Name: Error
  • URI: http://open-services.net/ns/core#Error

Prefixed Name Occurs Read-only Value-type Represen-tation Range Description
oslc:statusCode exactly-one True String n/a n/a the HTTP status code reported with the error.
oslc:message exactly-one True String n/a n/a an informative message describing the error that occurred.
oslc:exendedError zero-or-one True Either Either oslc:ExtendedError Extended error information

Resource: Extended Error

  • Name: ExendedError
  • URI: http://open-services.net/ns/core#ExtendedError

Prefixed Name Occurs Read-only Value-type Represen-tation Range Description
oslc:moreInfo zero-or-one True Resource Reference Any a resource giving more information on the error SHOULD be of an HTML content-type.
oslc:rel zero-or-one True String n/a n/a if present and set to 'alternate' then indicates that work-around is provided, behavior for other values is undefined.
oslc:hintWidth zero-or-one True String n/a n/a valid values for these attributes is defined by the CSS 2 width attribute (reference: CSS2)be specified by OSLC Service.
oslc:hintHeight zero-or-one True String n/a n/a valid values for these attributes is defined by the CSS 2 width attribute (reference: CSS2)be specified by OSLC Service.


Specification Versioning

One of the goals of the OSLC initiative is to mitigate or eliminate the need for lock-step version upgrades, where clients or services target one version of a specification and break when new versions are introduced -- requiring all services to be upgraded simultaneously.

In this section we specify a version header that will enable old "Version 1" OSLC clients to continue to work and share the same resource URIs as used by clients that specifically target the Core. And we establish rules that will enable clients to continue to work as new versions of specifications are introduced.

Supporting pre-Core clients

We anticipate that the OSLC Core and domain specifications will each be versioned independently and each version will be assigned a version number, but we would like to avoid exposing version numbers in OSLC implementations. There is one use case that requires version information to be exposed. We must ensure that old OSLC "Version 1" clients continue to work.

To enable OSLC Service specifications to evolve without breaking existing clients, we introduce an HTTP Header, OSLC-Core-Version set to the Core specification version number "2.0". We expect clients that target the Core to send this HTTP header.

  • If the OSLC-Core-Version header is present and set to a version that the service can support, then the service MUST return a representation that is complies with the specified version.
  • If the OSLC-Core-Version header is present and indicates a specification version that the service cannot support, the service SHOULD respond with what it determines is the most compatible version that it can return.
  • If the OSLC-Core-Version header is not present then the OSLC Service SHOULD respond by returning a resource that conforms to the earliest or most compatible (as determined by the implementation) specification version's representation. Services that never offered an OSLC Version 1 interface can ignore this restriction.
  • When returning an OSLC Defined Resource, OSLC Services MUST return the OSLC-Core-Version header set to the Core specification with which the representation complies.

Rules for new versions of OSLC specifications

When specifying a new version of an OSLC specification the rule is this:

A new version of an OSLC specification is not allowed to introduce changes that will break old clients.

Here are some guidelines for OSLC workgroups defining new specifications or upgrades to existing ones:

  • If you believe that you need a property but cannot agree on the value-type, then this is a strong indication that you should not attempt to standardize on the property. Once decide on a value-type you are stuck with it forever. Wait until you have the scenarios or implementation experience needed to agree on type.
  • When introducing a new capability in a new version of a specification, e.g. a creation factory, query capability or delegated UI dialog; one that works differently than those specified in the Core spec or older versions of your own specification, you should create a new resource type to represent the service. This will enable old clients to continue to work against old services. and new clients to work with your new capabilities.
  • When defining resources, do not remove, change the meaning or the value-type of any properties that you defined in earlier versions of the specification. You can add new properties but not change those that already exist.
  • It is possible to relax restrictions on clients, because relaxing restrictions should not break clients. But it us not possible to relax restrictions on services, because clients expect to find the required fields and if they are missing, clients will break.
  • Before defining a new property within your OSLC domain's namespace consult the list of common properties in OSLC Core Spec Appendix A DRAFT to see if using a common property would be more appropriate.

Migrating to the Core Specification

Most of the first OSLC specifications were developed before this Core specification existed and do not implement versioning as described above and so must use some other mechanism to migrate to the OSLC Core v1.0 specification.

OSLC implementations that wish to continue to support old pre-Core OSLC or OSLC v1.0 specifications can do so by keeping the old implementation in place and adding the new OSLC Core v1 implementation with different service provider, query capability and creation factory URIs.


OSLC Defined Resource Representations

This section specifies what resource representations are required for OSLC resources, some requirements for providing representations and some rational for the requirement that OSLC services provide RDF/XML representations. Here are the OSLC Core requirements for representations:

OSLC services MUST provide RDF/XML and MAY provide other formats such as Turtle and JSON. OSLC services MUST use content-type application/rdf+xml for RDF/XML representations and MAY also serve it as application/xml according to the rules of HTTP.

Though the OSLC Core workgroup does provide (reference: OSLC Core Representations Guidance? ) guidance on how to form RDF/XML representations using a subset of RDF/XML, OSLC clients SHOULD NOT assume any specific form of RDF/XML.

For HTTP POST and PUT operations, OSLC services SHOULD accept RDF/XML content and *MAY *accept other representations. OSLC domain specifications should specify which formats are required and which, if any, are optional.

Use standard content-types

Note that existing standard content-types are used, e.g. application/rdf+xml and application/json, in this document and no new content-types are introduced. Those writing OSLC specifications are strongly encouraged to follow this pattern -- use standard and existing content-types and avoid inventing new content-types for existing formats.

In past OSLC specifications we defined a specific RDF/XML format for each resource defined and gave each its own content-type. This implied to consumers that each resource had a different format when in reality they were all standard RDF/XML. Using different content-types makes it more difficult to write generic tools, crawlers and other services that work across all data.

Order of property values insignificant

This specification defines how OSLC property values are to be represented in a variety of formats. Except in the case of a sorted Query Response, the ordering of property values is insignificant. OSLC clients and service providers MUST not place any significance on the ordering of property values in representations.

Use Absolute URIs

OSLC representations MUST use absolute URIs in all cases except XML representations, where the xml:base attribute may be used to allow relative URIs to be resolved to absolute form (reference: XML Base).

Before a resource representation that uses xml:base is posted to an OSLC Service for creation, it may include relative URIs that cannot be resolved until the OSLC Service has received, created and assigned a URI to the new resource.

Why does OSLC require RDF/XML representations?

The primary mechanisms to create strong support for the software development life-cycle are integration of information across all the activities of the life-cycle, support for the processes that control the ways in which people modify that information, and automation of repetitive tasks. To be able to integrate information across the life-cycle, Products that implement part of the life-cycle must expose data in ways that other tools can understand. Those other tools may implement other parts of the life-cycle or may be separate analysis tools that support querying, reporting, trend analysis etc.

Some resource formats are easier than others for representing data. XML is a popular and flexible format for representing data, but it has some important disadvantages. There are many different patterns for encoding data in XML and a client cannot "find" the data within an XML format without knowing what patterns have been used. XML Schema is popular for describing the "shape" of XML, but unfortunately, XML Schema does not help you locate the data within the XML, it just constrains the overall XML. There is no standard for locating data in XML - people often use their own conventions built on XPath to describe how to locate the data within XML documents, but there is no standard for how to organize all those XPath expressions.

JSON has some significant advantages over XML in this regard. JSON allows any client to recover the property names and values without the need for prior understanding of a data schema or representation format. JSON also has the advantage of being extremely popular with JavaScript? programmers and is well supported by a range of programming languages, not just JavaScript? . However, JSON has a few deficiencies for the purposes of OSLC. JSON has no schema language equivalent to XML Schema to validate content. JSON does not support namespaces. And while JSON is very good at describing a single data structure, it's not so effective at representing facts about multiple web resources in a single message.

There are two representation technologies that are part of the RDF family of technologies that have the positive characteristics of JSON without the limitations - RDF-XML and Turtle. One of those, RDF-XML, is based on XML. Because RDF-XML prescribes the patterns for encoding data in XML, you can extract data from RDF-XML without the need for extra information about the representation, just as you can with JSON. Because RDF-XML and Turtle are both based on RDF, they support namespaces and can represent facts about many different resources. Turtle has the advantage of being simple and elegant, like JSON - it is like a JSON that is better integrated with the world-wide web. RDF-XML has the characteristic of being based on XML which many people see as an advantage. Both of these technologies have the disadvantage of being much less well-known and broadly supported than JSON.

After much debate, we have selected RDF-XML as the format to mandate to ensure that all OSLC resources are represented in a way that allows an external client to always be able to extract the data without extensive prior knowledge of the representation format. Although RDF-XML lacks the simplicity, elegance and popularity of JSON, it integrated much better with the WWW and it aligns with XML. Turtle has all the positive aspects of an RDF foundation with the elegance and simplicity of JSON, but lacks the alignment with XML that many find important. The choice between Turtle and RDF-XML comes down to a trade-off of simplicity and elegance against XML alignment. The choice between JSON and the RDF technologies comes down to a trade-off between popularity and better integration with the web. "Raw" XML does not come close enough to meeting requirements to be a candidate.

Appendix A: Common Properties

See separate page OSLC Core Spec Appendix A DRAFT

Appendix B: RDF/XML Representation examples

See separate page OSLC Core Spec Appendix B DRAFT

Appendix C: Turtle Representation examples

See separate page OSLC Core Spec Appendix C DRAFT

Appendix D: JSON Representation examples

See separate page OSLC Core Spec Appendix D DRAFT

Appendix E: Atom Xml Representation examples

See separate page OSLC Core Spec Appendix E DRAFT

Appendix F: References

These are the specifications referenced by the OSLC Core Specification.

Topic attachments
I Attachment Action Size Date Who Comment
xmlxml blog-comment-rdf.xml manage 0.7 K 21 Jul 2010 - 19:25 DaveJohnson  
xmlxml blog-comment-shape-rdf.xml manage 2.2 K 21 Jul 2010 - 19:26 DaveJohnson  
xmlxml blog-entry-rdf.xml manage 0.9 K 05 May 2010 - 19:19 DaveJohnson  
pngpng oslc-core-overview.png manage 56.2 K 02 Jun 2010 - 01:44 DaveJohnson  
pngpng oslc-core-provider.png manage 95.4 K 20 Jul 2010 - 15:51 DaveJohnson many corrections to properties
pngpng oslc-core-shapes.png manage 48.1 K 25 May 2010 - 18:59 DaveJohnson  
pngpng oslc-delegated.png manage 86.1 K 04 May 2010 - 14:44 DaveJohnson  
xmlxml query-result-rdf.xml manage 1.9 K 21 Jul 2010 - 19:47 DaveJohnson  
xmlxml query-shape-rdf.xml manage 1.9 K 21 Jul 2010 - 19:45 DaveJohnson  
xmlxml service-provider-rdf.xml manage 3.3 K 21 Jul 2010 - 19:30 DaveJohnson  
Edit | Attach | Print version | History: r138 | r136 < r135 < r134 < r133 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r134 - 21 Jul 2010 - 20:38:08 - 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