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

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 work 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, a 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 property names and types 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.

We are using 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.

A word about RDF. The resource, property, value data model used for OSLC resources is based on Resource Description Framework (RDF) and OSLC requires RDF representations, but OSLC does not require implementers to provide an RDF triple-store or a SPARQL query-engine.

A word about Atom. Atom Publishing Protocol (APP) and Atom Syndication Format (ASF) formats are referenced in this document, but OSLC is not APP and OSLC implementations do not have to comply with APP.

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. It also means limiting the number of other specifications that we reference. Keeping things simple 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 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 query result, 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 defining a resource or a property, OSLC Specifications define its name as a URI and its type as a URI. We abbreviate the resource's or property's name as a Prefixed Name (reference: Prefixed Names), which is represented in XML as a QName.

Before resources are defined, we must first define a domain.

Defining an OSLC Domain

This specification defines a set of core resources with properties, and recommends common properties that may be used by other OSLC specifications. Each OSLC domain is expected to define it's own resources and properties. Each OSLC domain is also expected to define a namespace, consisting of a Namespace URI and a default prefix.

  • Namespace URI (URI): the Namespace URI of the resource's name. All resources and properties defined within an OSLC domain specification will typically share the same namespace URI. For example, all resources and properties that we define in this specification are given the Namespace URI or http://open-services.net/xmlns/oslc#.
  • Default Prefix (String): names that exist within a namespace are prefixed with a string that services as an abbreviation of the Namespace URI. OSLC domains that support the OSLC Query Syntax (defined below) MUST define default prefixes for all of the namespaces that they use.

The namespace used for resources defined in this specification is defined as follows:

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

Once a domain is defined, resources within it can be defined.

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 the resource which MUST be valid as the Local Name part of a QName (reference: XML Namespaces).
  • Type URI (URI): The Type URI of the resource, also known as the RDF Type. Per the rules of Prefixed Names, the Type URI is formed by appending the Name to to the end of the Namespace URI. For example, the resource named Service (defined below) gets the Type URI of http://open-services.net/xmlns/oslc#Service.

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

Defining OSLC Properties

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

  • Name (String): name of the the resource which MUST be valid as the Local Name part of a QName (reference: XML Namespaces).
  • Title (String): Title of the property.
  • Description (String): Description of the property.
  • Occurs (String): may be 'exactly-one', 'at-most-one', 'zero-or-many' or 'one-or-many'.
  • Extended (Boolean): if true this indicates that the property value, then in OSLC services that support OSLC Query Syntax this property value MAY only occur in resources whose URI includes the oslc.properties parameter.
  • 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).
      • Integer: an integer number type as specified by XSD Integer ( http://www.w3.org/2001/XMLSchema#integer, 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).
      • String: a string type as specified by XSD String ( http://www.w3.org/2001/XMLSchema#string, reference: XSD Datatypes).
      • National Language String: a string type based on XSD String ( http://open-service.net/xmlns/oslc-core-1.0#MultiLanguageString). Used in cases where multiple translations of a string must be provided. Each value represents one language.
      • XMLLiteral: a Literal XML value ( http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral).
    • Resource value-types:
      • Resource: value is a resource available at a specified URI, represented in RDF/XML as an element with an rdf:resource attribute that specifies the URI.
      • Local Resource: value is local to the current resource and available only via a local ID, represented in RDF/XML as an element with an rdf:nodeID attribute that specifies the local ID. Used to reference a Local Inline Resource.
      • Inline Resource: value is a resource available at a specified URI, but with property values represented inline in the current resource, represented in RDF/XML as an element containing property value elements and with an rdf:about attribute specifying the URI.
      • Local Inline Resource: value a resource that is local to the current resource, which contains property values, represented in RDF/XML as an element containing property value elements and MAY have an rdf:nodeID attribute specifying the resource’s local ID.

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.

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.

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 he new representation to the resource's URI.

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.

Common Properties

OSLC domains specifications are strongly encouraged to use the common properties defined by this Core specification (See Appendix A for Common Properties) rather than defining new properties.

Next we cover Resource Shapes, a way to provide a resource definition in a machine readable form.


Resource Shapes

In some cases, to create resources and to query those that already exist within an OSLC Service, OSLC clients needs a way to learn which properties are commonly used in or required by the service. Resource Shape Resources meet this need.

A Resource Shape describes the properties that are allowed or required by one type of resource. An OSLC Creation Factory can provide a Resource Shape so that you know what properties are allowed and required to create a resource. An OSLC Query Capability can provide a Resource Shape so that you know what properties are available for query. And, within a Resource Shape, a resource value-type can provide its own Resource Shape.

Conceptual Model

A Resource Shape is an resource that defines the allowed or required properties of one type of resource. As you can see in the diagram below a resource shape contains properties, and properties with Resource value-types can specify their own shapes.

Resource Shape diagram

The next sections define the Resource Shape and Property resources.

Resource: Resource Shape

A Resource Shape resource can have a title and a type.

  • Name: Shape
  • Suggested Prefix: oslc
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Type URI: http://open-services.net/xmlns/oslc#Shape
  • Version String: oslc-core-1.0
  • Properties
    • rdf:type (Resource, exactly-one): a Query Resource MUST include one rdf:type property with value of http://open-services.net/xmlns/oslc#Shape
    • oslc:describes (Resource, exactly-one): Type URI of the resource described by this shape.=
    • dc:title (String, zero-or-one): a Query Resource SHOULD include a meaningful and non-empty title.
    • oslc:property (Local Inline Resource of type oslc:Property, zero-or-more): the properties that are allowed or required by this shape.
    • Other properties MAY be specified by OSLC Services

Resource: Allowed Values

  • Name: AllowedValues
  • Suggested Prefix: oslc
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Type URI: http://open-services.net/xmlns/oslc#AllowedValues
  • Properties
    • rdf:type (Resource, zero-or-more): a Query Resource MUST include one rdf:type property with value of http://open-services.net/xmlns/oslc#AllowedValues
    • oslc:allowedValue (Any value-type, one-or-many): value allowed for a property
    • Other properties MAY be specified by OSLC Services

Value-type: Property

A Property resource describes one allowed or required property of a resource.

  • Name: Property
  • Suggested Prefix: oslc
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Type URI: http://open-services.net/xmlns/oslc#Property
  • Properties
    • rdf:type (Resource, exactly-one) - The type of property being defined
    • oslc:name (String, exactly-one) - Name of property being defined
    • oslc:namespace (Resource, exactly-one) - Namespace of property
    • dc:title (National Language String, one-or-more): name of the property
    • dc:description (String, at-most-one): description of the property
    • oslc:extended (Boolean, at-most-one): indicates that property is an extended property
    • oslc:hidden (Boolean, at-most-one): a hint that indicates that property MAY be hidden when presented in a user interface
    • oslc:valueType (Resource, one-or-many) - may be any of the value types listed above in OSLC Defined Resources, in URI form:
      • Literal value-types
        • String - http://www.w3.org/2001/XMLSchema#string
        • MultiLangageString - http://open-service.net/xmlns/oslc-core-1.0#MultiLanguageString
        • *Integer - http://www.w3.org/2001/XMLSchema#integer
        • Decimal - http://www.w3.org/2001/XMLSchema#decimal
        • Float - http://www.w3.org/2001/XMLSchema#float
        • Double - http://www.w3.org/2001/XMLSchema#double
        • Boolean - http://www.w3.org/2001/XMLSchema#boolean
        • DateTime - http://www.w3.org/2001/XMLSchema#dateTime
        • URI - http://www.w3.org/2001/XMLSchema#anyURI
        • XMLLiteral - http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral
      • Resource value-types
        • Resource - http://open-service.net/xmlns/oslc-core/resource-types#Resource
        • Local Resource - http://open-service.net/xmlns/oslc-core/resource-types#LocalResource
        • Inline Resource - http://open-service.net/xmlns/oslc-core/resource-types#InlineResource
        • Local Inline Resource - http://open-service.net/xmlns/oslc-core/resource-types#LocalInlineResource
    • oslc:shape (Resource, zero-or-one) - if the value-type is a resource type, then Property MAY provide a shape value to indicate the Resource Shape that applies to the resource.
    • oslc:occurs (String, exactly-one) - may be "exactly-one", "at-most-one", "zero-or-many" or "one-or-many"
    • oslc:allowedValue (Any value-type, zero-or-more) - value allowed for property
    • oslc:allowedValues (Resource of type oslc:AllowedValues, zero-or-more) - resource with allowed values for a property
    • oslc:defaultValue (String, zero-or-one) - default value for property
    • oslc:maxSize (Number, zero-or-one) - for String properties only, specifies maximum characters allowed. If not set, then there is no maximum or maximum is specified elsewhere.
    • oslc:readOnly (Boolean, zero-or-one) - true if property is read-only. If not set or false, then property is not read-only.
    • oslc:isMemberProperty (Boolean, zero-or-one) - true if the property is a membership property (e.g. like rdfs:member). If not set or false, then the property is not a membership property. The set of all membership properties of a resource SHOULD be used as the default value for the oslc.from query parameter in member list pattern queries.
    • Other properties MAY be specified by OSLC Services


Service Provider Catalog and 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
  • Suggested Prefix: oslc
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Type URI: http://open-services.net/xmlns/oslc#ServiceProviderCatalog
  • Properties:
    • dc:title (String, at-most-one) - title of the service provider catalog
    • dc:contributor (Local Inline Resource of type oslc:Contributor, at-most-one): describes the software product that provides the implementation.
    • oslc:domain (Resource, one-or-many) - namespace URI of the OSLC domain specification that may be implemented by referenced services
    • oslc:serviceProvider (Resource of type oslc:ServiceProvider, one-or-many): describes a service offered by the service provider.
    • oslc:serviceProviderCatalog (Resource of type oslc:ServiceProviderCatalog, one-or-many): describes a service offered by the service provider.
    • oslc:oauthAuthorization (Local Inline Resource of type oslc:OAuthAuthorization): defines the three OAuth URIs required for a client to act as an OAuth consumer.
    • A Service Provider Catalog MAY provide other property values.

Resource: Service Provider

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

  • Name: ServiceProvider
  • Suggested Prefix: oslc
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Type URI: http://open-services.net/xmlns/oslc#ServiceProvider
  • Properties:
    • dc:title (String, at-most-one) - title of the service provider
    • dc:contributor (Local Inline Resource of type oslc:Contributor, at-most-one): describes the software product that provides the implementation.
    • oslc:service (Local Inline Resource of type oslc:Service, one-or-many): describes a service offered by the service provider.
    • oslc:namespaceDefinition (Local Inline Resource of type oslc:NamespaceDefinition): defines a namespace prefix for use in JSON representations and in forming OSLC Query Syntax strings.
    • oslc:oauthAuthorization (Local Inline Resource of type oslc:OAuthAuthorization): defines the three OAuth URIs required for a client to act as an OAuth consumer.
    • A Service Provider MAY provide other property values.

Resource: Service

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

  • Name: Service
  • Suggested Prefix: oslc
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Type URI: http://open-services.net/xmlns/oslc#Service
  • Properties:
    • oslc:domain (Resource, exactly-one) - namespace URI of the OSLC domain specification that is implemented by this service.
    • creationFactory (Local Inline Resource of type oslc:Factory, zero-or-many): enables clients to create new resources
    • queryCapability (Local Inline Resource of type oslc:QueryCapabiity, zero-or-many): enables clients query across a collection of resources
    • selectionDialog (Local Inline Resource of type oslc:Dialog, zero-or-many): enables clients to select a resource via UI
    • creationDialog (Local Inline Resource of type oslc:Dialog, zero-or-many): enables clients to create a resource via UI
    • A Service Resource MAY provide other property values.

Resource: Creation Factory

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

  • Name: CreationFactory
  • Suggested Prefix: oslc
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Type URI: http://open-services.net/xmlns/oslc#CreationFactory
  • Properties:
    • dc:title (String, exactly-one) - title string that could be used for display
    • oslc:label (String, at-most-one) - very short label for use in menu items
    • oslc:creation (Resource, exactly-one) - to create a new resource via the factory, post it to this URI
    • oslc:shape (Resource, exactly-one) - a Creation Factory MUST provide a Resource Shape that describe shape of the resource against which queries are executed.
    • A Creation Factory MAY provide other property values.

Resource: Query Capability

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

  • Name: QueryCapability
  • Suggested Prefix: oslc
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Type URI: http://open-services.net/xmlns/oslc#QueryCapability
  • Properties:
    • dc:title (String, exactly-one) - title string that could be used for display
    • oslc:label (String, at-most-one) - very short label for use in menu items
    • oslc:queryBase (Resource, exactly-one) - 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 query parameters 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:shape (Resource, zero-or-one) - the Query Capability SHOULD provide a Resource Shape that describes the query base URI.
    • A Query Capability MAY provide other property values.

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
  • Suggested Prefix: oslc
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Type URI: http://open-services.net/xmlns/oslc#Dialog
  • Properties:
    • dc:title (String, exactly-one): title string that could be used for dialog title
    • oslc:label (String, at-most-one): very short label for use in menu items
    • oslc:dialog (Resource, exactly-one): the URI of the dialog
    • oslc:hintWidth (String, at-most-one): valid values for these attributes is defined by the CSS 2 width attribute (reference: CSS2)
    • oslc:hintHeight (String, at-most-one): valid values for these attributes is defined by the CSS 2 height attribute (reference: CSS2)
    • There MAY be other property values.

Resource: Contributor

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

  • Name: Contributor
  • Suggested Prefix: oslc
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Type URI: http://open-services.net/xmlns/oslc#Contributor
  • Properties:
    • dc:title (String, exactly-one): title string that could be used for display
    • oslc:label (String, at-most-one): very short label for use in menu items
    • dc:identifier (String, exactly-one): A URN that uniquely identifies the implementation
    • oslc:icon (URL, exactly-one): URL to an icon file that represents the provider. This icon should be a favicon format and 16x16 pixels in size
    • A Contributor Resource MAY provide other property values.

Resource: Namespace Definition

Service Providers MUST provide a Namespace Definition for each namespace supported by the service. Each Namespace Definition defines a namespace prefix that clients MAY use in forming OSLC Query Syntax strings and that JSON Representations MUST use in all property names.

  • Name: NamespaceDefinition
  • Suggested Prefix: oslc
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Type URI: http://open-services.net/xmlns/oslc#NamespaceDefinition
  • Properties:
    • oslc:prefix (String, exactly-one): namespace prefix to be used for this namespace
    • oslc:namespaceURI (Resource, exactly-one): the 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
  • Suggested Prefix: oslc
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Type URI: http://open-services.net/xmlns/oslc#OAuthConfiguration
  • Properties:
    • oslc:oauthAccessTokenURI (Resource, exactly-one): URI for obtaining OAuth request token
    • oslc:authorizationURI (Resource, exactly-one): URI for obtaining OAuth authorization
    • oslc:oauthAccessTokenURI (Resource, exactly-one): 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 and following the rules set out in the OSLC Representation section below. 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. The RDF/XML representation of the query result begins with a node element whose rdf:about attribute value is equal to the base URI. Typically, the base URI is a container resource that may have a long list of members, e.g. the list of all defects in a bug tracking system. 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).

Resource: ResponseInfo

A ResponseInfo Resource describes information about the HTTP response body in which it appears. This specification defines its use for query result paging.

  • Name: !ResponseInfo
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Suggested Prefix: oslc
  • Type URI: http://open-services.net/xmlns/oslc#ResponseInfo
  • Properties:
    • dc:title (String, zero-or-one): a ResponseInfo Resource SHOULD include a meaningful and non-empty title.
    • dc:description (String, zero-or-one): a ResponseInfo Resource MAY include a meaningful and non-empty description.
    • rdf:type (Resource, exactly-one): a ResponseInfo Resource MUST include one rdf:type property with value of http://open-services.net/xmlns/oslc#ResponseInfo and MAY include other instances of the rdf:type property with other values.
    • oslc:nextPage (String, zero-or-one): link to the resource representing the next page of logical response of which this response is a physical page (see Query Resource Paging below)
    • Other properties MAY be specified by OSLC Services

Query Resource Paging

Frequently, a query result may be so large that a server may not be able to return the entire resource in one HTTP response. In these cases OSLC Services can use a mechanism called paging. The entire query result is the logical response of the query. The server MAY return the logical response as sequence of physical responses, referred to as pages.

In RDF terms, the pages SHOULD partition the logical response into disjoint subsets of triples. The union of the triples in all the pages MUST contain all the triples in the logical response, i.e. every triple that is part of the logical response MUST appear in some page. However, in practice it may be very difficult for the server to eliminate all duplication of triples, i.e. some triples MAY appear in more than one page. This duplication of triples is harmless since the semantics of RDF is that triples form a set, not a bag (aka multi-set). The union of the triples MAY only include additional non-significant triples, such as those used to describe paging, beyond those that are part of the logical response.

When a query URI is requested (via HTTP GET or POST), an OSLC Service MAY return the logical response as a sequence of physical response pages. Each page has a link to the next page, if any, in the sequence. The logical response is the union of all the pages in the sequence (after omitting the paging information).

A page is a partial resource representation, i.e. it is a representation that includes 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 resource that contains a resource-valued property oslc:nextPage that links to a resource that represents the next page of property values.

In RDF/XML representations, the OSLC ResponseInfo resource, if present, MUST be included as follows:

  • If the document root is rdf:RDF then the paging information MUST appear in a child node element of type oslc:ResponseInfo.
  • Otherwise, the document root is a node element for some subject resource, and the paging information MUST appear as the value of an oslc:responseInfo property whose value is an object node element of type oslc:ResponseInfo. The oslc:responseInfo property MUST appear exactly once.

The OSLC ResponseInfo resource, if present, SHOULD appear as either the first child element of an rdf:RDF document root element, or the first property of a subject node document root element so that the client is aware that another page is available as soon as possible. However, in some cases the server may be processing the response as a stream and not be aware that an additional page is needed. Therefore the OSLC ResponseInfo, if present, MAY appear later in the response.

In order to simplify client-side processing of the pages, each logical page SHOULD contain the complete content of one or more child elements of the physical RDF/XML document. Each child element that appears in the physical RDF/XML document SHOULD appear completely within exactly one logical page.

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.

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 OSLCCoreSpecDRAFTSplitQuery? document defines a standard set of OSLC query parameters that other OSLC domain specifications MAY use to query resources.


Delegated User Interface Dialogs

In theory, if each OSLC service offered a comprehensive HTTP interface, one that enabled clients to access and operate on every type of resource managed by the service, then OSLC could support every imaginable ALM and PLM integration. But in reality, OSLC specifications target specific integration scenarios and will never offer that type of comprehensive interface. That is why, in some cases, allowing one product to delegate to a user interface defined in another product is a more effective way to achieve integration than providing 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
  • Suggested Prefix: oslc
  • Type URI: http://open-services.net/xmlns/oslc#results
  • Properties:
    • rdf:resource (URI, exactly-one) URI of the resource selected or created
    • oslc:label (String, exactly-one) 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
  • Suggested Prefix: oslc
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Type URI: http://open-services.net/xmlns/oslc#Error
  • Properties
    • oslc:statusCode (Decimal, exactly-one): the HTTP status code reported with the error.
    • oslc:message (String, exactly-one): an informative message describing the error that occurred.
    • oslc:exendedMessage (Resource or Local Inline Resource of type oslc:ExtendedMessage)
    • Other properties MAY be specified by OSLC Service.

Resource: Extended Error

  • Name: ExendedError
  • Suggested Prefix: oslc
  • Namespace URI: http://open-services.net/xmlns/oslc#
  • Type URI: http://open-services.net/xmlns/oslc#ExtendedError
  • Properties
    • oslc:url (Resource, zero-or-one) a resource giving more information on the error SHOULD be of an HTML content-type.
    • oslc:rel (Resource, zero-or-one) if present and set to 'alternate' then indicates that work-around is provided, behavior for other values is undefined.
    • oslc:hintWidth (Decimal, zero-or-one): hint indicates pixel width of extended error window.
    • oslc:hintHeight (Decimal, zero-or-one) hint indicates pixel height of extended error window.
    • Other properties MAY 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.

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 how representations of OSLC Defined Resources are created. The rules in this section apply to all of the resources defined in this specification and can be used in other OSLC specifications.

To encourage interoperability across OSLC domains and implementations, OSLC requires that services provide an RDF/XML representation. Services can also choose to provide additional representations: HTML, Turtle, JSON or Atom.

Use standard content-types

Note that existing standard content-types are used, e.g. application/rdf+xml 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.

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.

RDF/XML Representations

An OSLC Service MUST provide and accept RDF/XML representations of all OSLC Defined Resources and according to the rules below (reference: RDF/XML Syntax).

When a client requests an OSLC Defined Resource and specifies via HTTP Accept header an application/xml, application/rdf+xml or does not specify a content-type then an OSLC Service SHOULD respond by returning an RDF/XML representation. OSLC Services SHOULD return RDF/XML representations using the content-type application/rdf+xml.

Rules for representing resources in RDF/XML

We define these rules and place constraints on how the RDF/XML is formed for the purposes of interoperability with XML parsing tools and readability. The rules are expressed as a set of instructions. Instead of using an <rdf:RDF> root and <rdf:Statements> elements, OSLC Defined Resources are represented as XML elements with QNames formed using the Resource's Prefixed Name.

Use these rules to form an RDF/XML representation of an OSLC Defined Resource.

  • 1.0 Open the XML root element using the Resource's QName
    • 1.1 Add to the XML element the rdf:about attribute set to the URI of the resource
  • 2.0 Represent the properties of the resource (using the property rules below)
  • 3.0 Close the XML root element

These are the property rules referred to above. OSLC property values are represented as XML elements with QNames formed using the Resource's QName namespace prefix and name.

  • 1.0 For each property value of the resource
    • 1.1 Open XML element using QName of property
    • 1.2 If property value is a Literal value-type
      • 1.2.1 Inside the XML element add the value as a string with proper escaping
      • 1.2.1 If property value is one value of a National Language String, then use the xml:lang attribute to indicate the language
    • 1.3 If property value is a Resource value-type
      • 1.3.1 Add to the XML element the rdf:resource attribute set to URI
    • 1.4 If property value is a Local Resource value type
      • 1.4.1 Add to the XML element the rdf:nodeID attribute set to local ID of the resource referred to
    • 1.5 If property value is an In-Line Resource value-type:
      • 1.5.1 Open XML element using QName of resource
      • 1.5.2 Add to the XML element the rdf:about attribute set to URI of resource
      • 1.5.3 Inside the XML element represent property values of the linked resource (using these same rules)
      • 1.5.4 Close the XML element
    • 1.6 Else if property value is a Local Inline Resource value-type:
      • 1.6.1 Open XML element using QName of the resource
      • 1.6.1 Add to the XML element to rdf:ID set to the local ID you wish to assign to the resource. Only needed when Local Resource needs to refer to this resource.
      • 1.6.3 Inside the XML element represent property values of the resource (using these same rules)
      • 1.6.4 Close the XML element
    • 1.7 Close XML element

JSON Representations

An OSLC Service MAY provide and accept JSON representations of some OSLC Defined Resources. OSLC Services that provide JSON presentations MUST respond to HTTP requests that request application/json with a JSON representation as specified below. OSLC Services that provide JSON presentations of OSLC Defined Resources MUST return them with content-type application/json.

Note that JSON representations MUST use the namespace prefix names that are defined by the Service Provider that provides them.

Rules for representing OSLC Defined Resources in JSON format

Use these rules to form an JSON representation of an OSLC Defined Resource.

  • 1.0 Create a JSON object with the following fields:
    • qname set to the QName of the resource
    • uri set to the URI of the resource
  • 2.0 For each namespace used in the JSON representation:
    • 2.1 Add a field =oslc:namespaceDefinition set to a JSON Object with these fields:
      • prefix set to the namespace prefix
      • namespaceURI set to the namespace’s URI
  • 3.0 Add to the JSON object fields to represent the property values of the resource using the property rules below)

These are the property rules referred to above. For each property:

  • 1.0 For each property of a resource
    • 1.1 Add field to resource's JSON object with name set to QName of property
      • 1.1.1 If there is only a single value of this property, then make field's value literal or JSON Object
      • 1.1.2 If there are multiple values of this property, then make field's value JSON Array
    • 12 If value-type is National Language String
      • 1.2.1 Set field's value to object with one field per language provided
      • 1.2.2 Set field's name to locale code, name must be valid xml:lang value
      • 1.2.3 Set field's value to string value for locale specified by field name
    • 1.3 Else if value-type is Literal
      • 1.3.1 Set field's value to string representation of property value
    • 1.4 Else if value-type is Resource
      • 1.4.1 Set field's value to JSON object with field:
        • resource set to URI of resource
    • 1.5 Else if value-type is Local Resource with fields:
      • 1.5.1 Set field's value to JSON object with field:
        • rdf:nodeId set to local ID of resource
    • 1.6 Else if value-type is Inline Resource
      • 1.6.1 Set field's value to JSON object with fields:
        • about set to URI of resource whose values are being inlined
        • Represent properties of inlined resource (using these same rules)
    • 1.7 Else if value-type is Local Inline Resource
      • 1.7.1 Set field's value to JSON object with fields:
        • rdf:id set to local ID you wish to assign to this resource. Only needed when Local Resource needs to refer to this resource.
        • Represent properties of inlined resource (using these same rules)

Turtle Representations

An OSLC Service MAY provide and understand Turtle representations of some OSLC Defined Resources and according to the rules below.

  • Returned when these content types requested: application/x-turtle
  • Returned as content-type: application/x-turtle

Rules for forming a Turtle representation

TBD

Atom Representations

An OSLC Service MAY provide and accept Atom Syndication Format representations of OSLC Defined Resources and according to the rules below (reference: Atom Format).

Rules for forming an Atom format OSLC Defined Resource representation

Note that there are special rules below for creating an OSLC Query Resource representation in Atom format.

When a client requests an Atom representation of an OSLC Defined Resource and specifies via HTTP Accept header content-type application/atom+xml or application/atom+xml;type=entry then an OSLC Service SHOULD respond with an Atom representation.

To represent an OSLC Defined Resource in Atom format we use an Atom <entry> element as document root, we map some OSLC properties to Atom elements and inside the Atom <content> element, we place an RDF/XML representation (as defined above) of the resource that we are representing. Atom representations MUST comply with the rules of Atom Syndication Format (reference: Atom format).

  • 1.0 Open an Atom <entry> element
    • 1.1 Add Atom <id> element. Atom requires a unique ID here and in the form of a URN, the resource URI MAY be used here.
    • 1.2 Add Atom <title> element. Atom requires a non-empty title value. A dc:title value MAY be used here.
    • 1.3 Add Atom <updated> element. Atom requires an updated date-time value. In cases where an updated-time value is difficult or expensive to compute, OSLC domain specifications might wish to declare this value to be insignificant.
    • 1.4 Add Atom <content> element. Atom representations MUST provide a content element that contains an RDF/XML of the resource being represented.
    • 1.5 Add Atom <author> element. Atom requires an author element.
  • 2.0 Close Atom <entry> element

Rules for forming an Atom format OSLC Query Resource representation

When a client requests an Atom representation of an OSLC Defined Resource and specifies via HTTP Accept header content-type application/atom+xml or then an OSLC Service SHOULD respond with an Atom representation as described below.

To represent an OSLC Query Resource in Atom format we use an Atom <feed> element as document root, add the required properties and then represent each resource returned in the query response as an Atom <entry> element.

  • 1.0 Open an Atom <feed> element
    • 1.1 To that element add as children the required Atom elements:
      • atom:id Must be a unique URN. The query resource URI may be used (i.e. same as oslc:ResponseInfo value for oslc:self)
      • atom:title With same value as the query's oslc:ResponseInfo value for dc:title
      • atom:updated Set to time that query result was generated
      • atom:author This element is not meaningful but Atom requires it, so provide only a dummy value.
    • 1.2. To that element add optional Atom elements that you wish to provide:
      • atom:summary Set to oslc:ResponseInfo value for dc:description
      • atom:link With rel="self" set to same value as the query's oslc:ResponseInfo value for oslc:self
      • atom:link With rel="next" set to same value as the query's oslc:ResponseInfo value for oslc:nextPage
    • 1.3 For each member property value returned by the query:
      • 1.3.1 Open an Atom <entry> element
      • 1.3.2 Add to that element the required Atom elements:
        • atom:id Must be a unique URN. The member value's URI may be used.
        • atom:title If the member value has a dc:title value, then use that. Otherwise provide a non-empty string with only a dummy value.
        • atom:updated If the member value has a dc:modified value then use that. Otherwise use same value used at feed level.
        • atom:author If the member value provides dc:creator values, then each should be represented as an atom:author element. Map either to or use both and together to form an = value seto to given name, comma and then family name.
      • 1.3.3 Add to the that element the atom:content element.
        • Set the atom:content element's src attribute to the URI of the member value
        • Set the atom:content element's type attribute to application/rdf+xml
        • Inside the content element, include a complete RDF/XML representation of the member value as specified by the query, i.e. may be a subset of the resource's values as specified by the query syntax string. Set the rdf:about attribute of the root element to the URI of the query base URI of the query.
      • 1.3.x Close the Atom </entry> element
  • 2.0 Close the Atom </feed> element

Appendix A: Common Properties

See separate page OSLC Core Spec DRAFT Common Properties

Appendix B: RDF/XML Representation examples

See separate page OSLC Core Spec DRAFT RDF XML Examples

Appendix C: JSON Representation examples

See separate page OSLC Core Spec DRAFT JSON Examples?

Appendix D: Atom Xml Representation examples

See separate page OSLC Core Spec DRAFT Atom Examples?

Appendix E: Turtle Representation examples

See separate page OSLC Core Spec DRAFT Turtle Examples?

Appendix F: References

These are the specifications referenced by the OSLC Core Specification.

Edit | Attach | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r3 - 07 May 2010 - 16:36:40 - ScottBosworth
 
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