Resource Properties Additional Service

This service allows a client to retrieve the indexed properties for a resource, both as a complete set and also selectively. The facility lets a client retrieve selective information about a resource, and provides an alternative to retrieving the entire resource.

Motivation

The resource properties service provides an API for clients to access the properties of a resource that are either maintained by the server or have been extracted and stored by an indexer.

Specification

Properties resources use URIs of the following forms:

  • {resource-uri}?properties
  • {resource-uri}?properties={properties-pattern}
Method URL Comments
GET/HEAD {resource-uri}?properties Executes the simple query, as defined below.
POST {resource-uri}?properties Not permitted - returns 405 (Method not allowed).
PUT {resource-uri}?properties Not permitted - returns 405 (Method not allowed).
DELETE {resource-uri}?properties Not permitted - returns 405 (Method not allowed).

GET returns the same status code as a GET on the base resource would have. The response Content-Type MUST be "application/xml". The response body MUST be a Properties document contains a property element for each of the indexed properties matched by the request. The resource attribute of the properties element MUST be the URI of the base resource. The response body MUST be accompanied by accurate ETag and Last-Modified headers.

HEAD is supported with the same rules as GET.

A properties-pattern has the form:

  • {k}[','{k}]* where each k is a property name - k is either the name of a server-provided property (other than "resource-modified-since") or an extracted property key. Property keys extracted from XML documents are URIs of the form {namespace}#{element} where namespace is the XML namespace URI and element is the name of an element type in that namespace, or the single '*' character. Note that the '#' is one of the characters that must be percent encoded (%23).

Any simple or collection resource can be queried for properties. The simple form (?properties) retrieves all indexed properties of the specified resource, and includes all server-provided properties other than "resource-modified-since". The longer form lists the subset of properties to be retrieved. It is not considered an error to list properties that are not indexed properties of the particular resource. These are ignored, and have no corresponding element in the response.

When a revision resource is queried for properties, the properties returned are those that the resource had at the time the revision was the current revision. In particular, the "resource-uri" property identifies the storage resource (and not the revision resource).

Example Properties resource URIs

  • /jazz/resources/A?properties
    retrieve all properties of the resource "/jazz/resources/A"
  • /jazz/resources/A?properties=http://dublincore.org/documents/dcmi-terms/contributor
    retrieve the last modifying user property of "/jazz/resources/A"
  • /jazz/resources/A?properties=http://music.example.org/schema%23title
    retrieve the "title" property of /jazz/projects/main/A. The property is in the XML namespace http://music.example.org/schema
  • /jazz/resources/A?properties=http://music.example.org/schema%23*
    retrieve all XML namespace http://music.example.org/schema properties of /jazz/resources/A
  • /jazz/resources/A?properties=http://dublincore.org/documents/dcmi-terms/modified,
    http://dublincore.org/documents/dcmi-terms/contributor

    retrieve the last modified date and last modifying user server properties of "/jazz/resources/A"

The response is an RDF Description document; the "about" attribute identifies the specified storage or revision resource. There is a property element giving the key, value, and value datatype for each property retrieved. If the resource carries multiple instances of the same indexed property, there will be a property element for each occurrence.

Example Properties document

When reviewing the RDF you can identify the system properties listed in Query Specification.

<rdf:Description 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dc="http://dublincore.org/documents/dcmi-terms/"
  xmlns:ns="http://example.org/xmlns/music#"
  rdf:about="/jazz/resources/musicdb/albums/album-1">
  <dc:contributor rdf:resource="/jazz/users/zoe"/>
  <dc:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">
      2008-03-02T00:00:00
  </dc:modified>
  <dc:format>application/xml</dc:format>
  <rdf:type rdf:resource="http://example.org/xmlns/music#album"/>
  <ns:name>A Matter of Life and Death</ns:name>
  <ns:releasedYear rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">
    2006
  </ns:releasedYear>
  <ns:artist rdf:resource="/jazz/resources/musicdb/artists/artist-1"/>
  <ns:genre>Rock</ns:genre>
  <ns:genre>Heavy Metal</ns:genre>
  <ns:disk>
    <rdf:Description>
      <ns:is rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1</ns:is>
      <ns:of rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1</ns:of>
    </rdf:Description>
  </ns:disk>
</rdf:Description>

Examples