TOC 
Network Working GroupR. Desai
Internet-DraftP. Reddy
Expires: August 19, 2002Maharashtra Institute of
 Technology
 February 18, 2002

HTTP Extension for Information Meta View using WEBDAV -- IMV
internet-draft-imv-feb-2002

Status of this Memo

This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt.

The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html.

This Internet-Draft will expire on August 19, 2002.

Copyright Notice

Copyright (C) The Internet Society (2002). All Rights Reserved.

Abstract

This document specifies a set of methods, headers, and content-types ancillary to HTTP/1.1 for the creation and management of IMV meta and data entities, creation and management of meta and data attributes.



 TOC 

Table of Contents




 TOC 

1. Introduction

This memo describes how the HTTP extensions for WEBDAV defined in RFC2518 could be used for providing access to the proposed Information Meta View (IMV) system, a distributed web-based database. The reader is advised to refer to RFC2518 whenever reference to WebDAV (DAV) specific information is made.



 TOC 

2. Notation Convention

Since this document describes a set of extensions to the HTTP/1.1 protocol, the augmented BNF used herein to describe protocol elements is exactly the same as described sextion 2.1 of RFC2068. Since this augmented BNF uses the basic production rules provided in section 2.2 of RFC2068, these rules apply to this document as well.

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 RFC 2119.



 TOC 

3. Terminlogy

URI/URL
Uniform Resource Identifier and Uniform Resource Locator, respectively. These terms (and the distinction between them) are defined in RFC2396.
Entity:
An IMV entity represents a data object used for representation of nodes or relations that provide data or schema for the IMV structure. Each IMV entity is identified by a universally unique identifier (UUID).
System property:
A system defined property of an entity such as type, time of creation or value.
Attribute:
A key/value pair that can be added to an IMV entity to describe some user defined property of the entity.
MetaNode:
It is a type of IMV entity that represents the schema for a set nodes. Instances of this schema are referred to as DataNodes. Example: Hotel, Person, Movie.
DataNode:
It is a type of IMV entity that represents an instance of schema defined by a MetaNode. Example: An instance of MetaNode "Movie" could be "Lord of The Ring."
MetaRelation:
It is a type of IMV entity that describes the relationship between two MetaNodes. A MetaRelation is a schema defining the association between source and destination MetaNodes. Example: LocatedAt could be a MetaRelation between Hotel and Location.
DataRelation:
It is a type of IMV entity that represents and instnace of schema defined by a MetaNode. Example: An instance of MetaRelation "LocatedAt" could link "Hotel Le Meridean, Pune" with a node representing its "address in Pune."
MetaAttribute:
It is a type of attribute tagged to a MetaEntity (i.e. MetaNode or MetaRelation). A MetaAttribute describes the rules the govern the attributes of instances such as whether the attribute is mandatory, the data type used, etc.
DataAttribute:
It is a type of attribute tagged to a DataEntity (i.e. DataNode or DataRelation). A DataAttribute is an instance of a MetaAttribute defined by the schema of the corresponding DataEntity and contains a value and optional MIME attachment.



 TOC 

4. URL format

IMV-compliant URLs can be of the following types:

DATASTORE
http://someserver/path/to/imv/datasource_name
ENTITY
http://someserver/path/to/imv/datasource_name/Entity_UUID
ATTRIBUTE
http://someserver/path/to/imv/datasource_name/Entity_UUID/Attribute_name



 TOC 

5. Data Model for IMV

Information in IMV is organized into a user's data source in the form of entities and attributes. Entities could be either nodes, which represent an abstract data object or a relation, which joins two nodes that are inter-related. Both nodes and relations can be of two types -- meta entities, that represent schema and data entities, that represent instances. Hence we have the categories DataNode, MetaNode, DataRelation and MetaRelation.

Each IMV entity is identified by a universally unique identifier (UUID). These SHOULD be generated by the algorithm defined in the Internet Draft for generating UUIDs draft-leach-uuids-guids-01.

Each IMV entity can be associated with attributes which are descriptors of that entity. Attributes tagged to meta entities are known as MetaAttributes, whereas those tagged to data entities are known as DataAttributes. MetaAttributes of a meta entity describe the schema that governs the addition/removal of DataAttributes to the instances of that meta entity.

Apart from attributes, each IMV entity and attribute itself as a set of system properties that are defined by the system. Some of these system attributes are maintained completely by the system (eg. hitCount or timeModified), others are available to be set (eg. timeExpiry, value).

5.1 Basic system properties

These system properties are available for all types of entities and attributes.

5.2 Additional system properties for MetaNode

No additional system properties are defined.

5.3 Additional system properties for DataNode

5.4 Additional system properties for MetaRelation

5.5 Additional system properties for DataRelation

5.6 Additional system properties for MetaAttribute

5.7 Additional system properties for DataAttribute

No additional system properties are defined.



 TOC 

6. HTTP methods for IMV

The following new HTTP methods are defined by the WebDAV protocol specification in RFC2518. The new methods use XML as a request and response format. All DAV compliant clients and resources MUST use XML parsers that are compliant with REC-XML. All XML used in either requests or responses MUST be, at minimum, well formed. If a server receives ill-formed XML in a request it MUST reject the entire request with a 400 (Bad Request). If a client receives ill-formed XML in a response then it MUST NOT assume anything about the outcome of the executed method and SHOULD treat the server as malfunctioning.

6.1 PROPFIND

The PROPFIND method retrieves properties (system properties and attributes) defined on the entity or attribute identified by the Request-URI. All IMV entities and attributes MUST support the PROPFIND method and the propfind XML element along with all XML elements defined for use with that element.

A client may submit a propfind XML element in the body of the request method describing what information is being requested. It is possible to request particular property values, all property values, or a list of the names of the rentity's properties. A client may choose not to submit a request body. An empty PROPFIND request body MUST be treated as a request for the names and values of all properties.

All servers MUST support returning a response of content type text/xml or application/xml that contains a multistatus XML element that describes the results of the attempts to retrieve the various properties.

If there is an error retrieving a property then a proper error result MUST be included in the response. A request to retrieve the value of a property which does not exist is an error and MUST be noted, if the response uses a multistatus XML element, with a response XML element which contains a 404 (Not Found) status value.

The results of this method SHOULD NOT be cached.

6.1.1 Example - Retrieving named properties

>> Request

PROPFIND /imv/pavan/37922ac7-00ec-1000-9675-cc1c9f8389c7 HTTP/1.1
Host: socrates
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx

<?xml version="1.0" encoding="utf-8" ?>
<d:propfind xmlns:d="DAV:" xmlns:i="urn:schemas:imv">
   <d:prop>
       <i:type/>
       <i:value/>
       <i:accessRead/>
       <title/>
       <price_now/>
   </d:prop>
</d:propfind>


>> Response

HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset=utf-8
Date: Wed, 27 Feb 2002 17:37:48 GMT
Server: Apache Tomcat/4.0.1 (HTTP/1.1 Connector)

<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:I="urn:schemas:imv:">
   <D:response xmlns:m="http://socrates:8080/imv/pavan/378de34b-00ec-1000-974c-cc1c9f8389c7">
      <D:href>http://socrates:8080/imv/pavan/37922ac7-00ec-1000-9675-cc1c9f8389c7</D:href>
      <D:propstat>
         <D:prop>
            <I:type>DataNode</I:type>
            <I:value>2</I:value>
            <I:accessRead>0</I:accessRead>
            <m:title>Walk On</m:title>
         </D:prop>
         <D:stat>HTTP/1.1 200 OK</D:stat>
      </D:propstat>
      <D:propstat>
         <D:prop>
            <price_now />
         </D:prop>
         <D:stat>HTTP/1.1 404 Not Found</D:stat>
      </D:propstat>
   </D:response>
</D:multistatus>

6.1.2 Example - Retrieving all properties

>> Request

PROPFIND /imv/pavan/37922ac7-00ec-1000-9675-cc1c9f8389c7 HTTP/1.1
Host: socrates
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx

<?xml version="1.0" encoding="utf-8" ?>
<d:propfind xmlns:d="DAV:">
   <d:allprop/>
</d:propfind>


>> Response

HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset=utf-8
Date: Wed, 27 Feb 2002 17:39:22 GMT
Server: Apache Tomcat/4.0.1 (HTTP/1.1 Connector)

<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:I="urn:schemas:imv:">
   <D:response xmlns:m="http://socrates:8080/imv/pavan/378de34b-00ec-1000-974c-cc1c9f8389c7">
      <D:href>http://socrates:8080/imv/pavan/37922ac7-00ec-1000-9675-cc1c9f8389c7</D:href>
      <D:propstat>
         <D:prop>
            <I:accessVisible>0</I:accessVisible>
            <I:timeModified>Sun Feb 24 15:26:48 GMT+05:30 2002</I:timeModified>             
	    <I:hitCount>2</I:hitCount>
            <I:timeCreation>Sun Feb 24 15:26:48 GMT+05:30 2002</I:timeCreation>             
	    <I:accessWrite>99</I:accessWrite>
            <I:instanceOf>378de34b-00ec-1000-974c-cc1c9f8389c7</I:instanceOf>
            <I:accessRead>0</I:accessRead>
            <I:type>DataNode</I:type>
            <I:timeExpiry>Mon Feb 24 15:22:08 GMT+05:30 2003</I:timeExpiry>
            <I:value>2</I:value>
            <I:timeAccessed>Wed Feb 27 23:09:32 GMT+05:30 2002</I:timeAccessed>
            <m:title>Walk On</m:title>
            <m:label>Virgin Records</m:label>
            <m:artist>U2</m:artist>
         </D:prop>
         <D:stat>HTTP/1.1 200 OK</D:stat>
      </D:propstat>
   </D:response>
</D:multistatus>

6.1.3 Example - Retrieving properties names

>> Request

PROPFIND /imv/pavan/378de34b-00ec-1000-974c-cc1c9f8389c7 HTTP/1.1
Host: socrates
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx

<?xml version="1.0" encoding="utf-8" ?>
<d:propfind xmlns:d="DAV:">
   <d:propname/>
</d:propfind>


>> Response

HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset=utf-8
Date: Wed, 27 Feb 2002 17:41:29 GMT
Server: Apache Tomcat/4.0.1 (HTTP/1.1 Connector)

<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:I="urn:schemas:imv:">
   <D:response xmlns:m="http://socrates:8080/imv/pavan/378de34b-00ec-1000-974c-cc1c9f8389c7">
      <D:href>http://socrates:8080/imv/pavan/378de34b-00ec-1000-974c-cc1c9f8389c7</D:href>
      <D:propstat>
         <D:prop>
            <I:accessVisible />
            <I:timeModified />
            <I:hitCount />
            <I:timeCreation />
            <I:accessWrite />
            <I:accessRead />
            <I:type />
            <I:timeExpiry />
            <I:value />
            <I:timeAccessed />
            <m:title I:mandatory="false" />
            <m:label I:mandatory="false" />
            <m:artist I:mandatory="false" />
         </D:prop>
         <D:stat>HTTP/1.1 200 OK</D:stat>
      </D:propstat>
   </D:response>
</D:multistatus>

6.1.4 Example - Retrieving properties of attributes

>> Request

PROPFIND /imv/pavan/378de34b-00ec-1000-974c-cc1c9f8389c7/artist HTTP/1.1
Host: socrates
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx

<?xml version="1.0" encoding="utf-8" ?>
<d:propfind xmlns:d="DAV:">
   <d:propname/>
</d:propfind>


>> Response

HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset=utf-8
Date: Wed, 27 Feb 2002 17:43:57 GMT
Server: Apache Tomcat/4.0.1 (HTTP/1.1 Connector)

<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:I="urn:schemas:imv:">
   <D:response xmlns:m="http://socrates:8080/imv/pavan/378de34b-00ec-1000-974c-cc1c9f8389c7">
      <D:href>http://socrates:8080/imv/pavan/378de34b-00ec-1000-974c-cc1c9f8389c7/artist</D:href>
      <D:propstat>
         <D:prop>
            <I:accessVisible />
            <I:hitCount />
            <I:timeModified />
            <I:timeCreation />
            <I:accessWrite />
            <I:accessRead />
            <I:mandatory />
            <I:type />
            <I:timeExpiry />
            <I:value />
            <I:timeAccessed />
         </D:prop>
         <D:stat>HTTP/1.1 200 OK</D:stat>
      </D:propstat>
   </D:response>
</D:multistatus>

6.2 PUT

The PUT method is used to create a new Entity or to upload resource content to an attribute. There are three interpretations of the PUT method depending on the type of request URL.

6.2.1 PUT Request on ATTRIBUTE

A PUT performed on an ATTRIBUTE replaces the GET response of the ATTRIBUTE. The Content-Type header is stored as a property of the attribute and the body is saved to the server. The resource may be downloaded with a GET on the same ATTRIBUTE URL.

6.2.2 PUT Request on DATASOURCE

PUT creates a new entity in the datasource as specified by the request URL. The body of the PUT request contains a set xml element. This element contains the attributes and setable system property values of the entity. The consisteny of the entities has to be maintained by the PUT request. Therfore every request to create an entity must set the values of the system properties "type" and "value". In case of a data entity creation the value of the system property "instanceOf" must be given and the value be the UUID of the corresponding Meta entity. In case of a MetaRelation the values of the system properties "src" and "dest" must be set and MUST point to MetaNode entities. Similarly with DataRelation the values of the system properties "src" and "dest" MUST be set and must point to DataNode entities which are instances of the MetaNodes specified in the MetaRelation's system properties "src" and "dest" respectively.

When creating instances of meta entities, all mandatory meta attributes must have their corresponding data attributes created in the data entity. If a value is not specified for the data attribute, it is copied from the default value specified in the meta attribute

If the server recives a PUT request which does not satisfy the above requirements then the server MUST respond with a 417 EXPECTATION FAILED error code.

6.2.3 PUT Request on ENTITY

If the request URL contains ENTITY UUID, then the server MUST create a new imported entity. Imported entities MUST be specified with an "importSource" system property that contains the URL of the orginal entity. All other constraints remain the same.

6.2.4 Response

If an ATTRIBUTE type request is successful, a 201 Created response is sent. If request fails to meet the consistency, a 417 Expectation Failed error is returned. Otherwise a 207 Multistatus is sent.

6.2.5 Status Codes for use with 207 (Multi-Status)

The following are examples of response codes one would expect to be used in a 207 (Multi-Status) response for this method. Note, however, that unless explicitly prohibited any 2/3/4/5xx series response code may be used in a 207 (Multi-Status) response.

201 (Created) - The command succeeded i.e. properties have been set.

403 (Forbidden) - The client, for reasons the server chooses not to specify, cannot alter one of the properties e.g. non-settable system properties

6.2.6 Example - Creation of MetaNode

>> Request

PUT /imv/rushi HTTP/1.1
Content-Type: text/xml; charset="utf-8"
Content-Length: 250

<set>
 <prop>
   <type>MetaNode</type>
   <value>Song</value>
   <title mandatory="true"/>
   <artist/>
   <label>Unknown</label>
 </prop>
</set>


>> Response

HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset=utf-8
Date: Wed, 27 Feb 2002 17:48:03 GMT
Server: Apache Tomcat/4.0.1 (HTTP/1.1 Connector)

<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:I="urn:schemas:imv:">
   <D:response xmlns:m="http://localhost:8080/imv/rushi/48b4c1df-00ec-1000-915e-cc1c9f8389c7">
      <D:href>http://localhost:8080/imv/rushi/48b4c1df-00ec-1000-915e-cc1c9f8389c7</D:href>
      <D:propstat>
         <D:prop>
            <I:accessVisible>0</I:accessVisible>
            <I:hitCount>0</I:hitCount>
            <I:timeModified>Wed Feb 27 23:18:07 GMT+05:30 2002</I:timeModified>
            <I:timeCreation>Wed Feb 27 23:18:07 GMT+05:30 2002</I:timeCreation>
            <I:accessWrite>99</I:accessWrite>
            <I:accessRead>0</I:accessRead>
            <I:type>MetaNode</I:type>
            <I:timeExpiry>Thu Feb 27 23:18:07 GMT+05:30 2003</I:timeExpiry>
            <I:value>Song</I:value>
            <I:timeAccessed>Wed Feb 27 23:18:07 GMT+05:30 2002</I:timeAccessed>
            <m:title I:mandatory="true" />
            <m:label I:mandatory="false">Unknown</m:label>
            <m:artist I:mandatory="false" />
         </D:prop>
         <D:stat>HTTP/1.1 200 OK</D:stat>
      </D:propstat>
   </D:response>
</D:multistatus>

6.2.7 Example - Creation of DataNode

>> Request

PUT /imv/rushi HTTP/1.1
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx

<set>
 <prop>
   <type>DataNode</type>
   <value>1</value>
   <instanceOf>48b4c1df-00ec-1000-915e-cc1c9f8389c7</instanceOf>
   <artist>Out of sync</artist>
   <label>Promiscious records</label>
 </prop>
</set>


>> Response

HTTP/1.1 417 Expectation Failed
Content-Type: text/html
Date: Fri, 22 Feb 2002 12:03:16 GMT
Server: Apache Tomcat/4.0.1 (HTTP/1.1 Connector)

...

The system failed to create a new instance of a song because the mandatory attribute title was not specified.

6.2.8 Example - Creating a DataNode

>> Request

PUT /imv/rushi HTTP/1.1
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx

<set>
 <prop>
   <type>DataNode</type>
   <value>1</value>
   <instanceOf>48b4c1df-00ec-1000-915e-cc1c9f8389c7</instanceOf>
   <title>Hi hi hi!</title>
   <artist>Out of sync</artist>
   <label/>
   <price>-50</price>
 </prop>
</set>


>> Response

HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset=utf-8
Date: Wed, 27 Feb 2002 17:50:57 GMT
Server: Apache Tomcat/4.0.1 (HTTP/1.1 Connector)
 
<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:I="urn:schemas:imv:">
   <D:response xmlns:m="http://localhost:8080/imv/rushi/48b4c1df-00ec-1000-915e-cc1c9f8389c7">
      <D:href>http://localhost:8080/imv/rushi/48b75da2-00ec-1000-afb9-cc1c9f8389c7</D:href>
      <D:propstat>
         <D:prop>
            <I:accessVisible>0</I:accessVisible>
            <I:hitCount>0</I:hitCount>
            <I:timeModified>Wed Feb 27 23:20:58 GMT+05:30 2002</I:timeModified>
            <I:timeCreation>Wed Feb 27 23:20:58 GMT+05:30 2002</I:timeCreation>
            <I:instanceOf>48b4c1df-00ec-1000-915e-cc1c9f8389c7</I:instanceOf>
            <I:accessWrite>99</I:accessWrite>
            <I:accessRead>0</I:accessRead>
            <I:type>DataNode</I:type>
            <I:timeExpiry>Thu Feb 27 23:18:07 GMT+05:30 2003</I:timeExpiry>
            <I:value>1</I:value>
            <I:timeAccessed>Wed Feb 27 23:20:58 GMT+05:30 2002</I:timeAccessed>
            <m:title>Hi hi hi!</m:title>
            <m:label />
            <m:artist>Out of sync</m:artist>
         </D:prop>
         <D:stat>HTTP/1.1 200 OK</D:stat>
      </D:propstat>
      <D:propstat>
         <D:prop>
            <price />
         </D:prop>
         <D:stat>HTTP/1.1 403 Forbidden</D:stat>
      </D:propstat>
   </D:response>
</D:multistatus>

Here, creation of DataNode was successful. Value of DataAttribute label was set to the default value specified in the MetaAttribute. The attribute 'price' which does not exist in the MetaNode is sent back with a 403 Forbidden status.

6.3 PROPPATCH

The PROPPATCH method processes instructions specified in the request body to set (settable) system properties and attributes and/or remove attributes defined on the entity identified by the Request-URI.

All entities MUST support the PROPPATCH method and MUST process instructions that are specified using the propertyupdate, set, and remove XML elements of the DAV schema. Execution of the directives in this method is, of course, subject to access control and schema consistency constraints.

The request message body of a PROPPATCH method MUST contain the propertyupdate XML element. Instruction processing MUST occur in the order instructions are received (i.e., from top to bottom).

To set system properties of the value of an attribute, PROPPATCH can be used either on the entity or on the attribute URL. Refer to below examples.

6.3.1 Status Codes for use with 207 (Multi-Status)

The following are examples of response codes one would expect to be used in a 207 (Multi-Status) response for this method. Note, however, that unless explicitly prohibited any 2/3/4/5xx series response code may be used in a 207 (Multi-Status) response.

200 (OK) - The command succeeded. As there can be a mixture of sets and removes in a body, a 201 (Created) seems inappropriate.

403 (Forbidden) - The client, for reasons the server chooses not to specify, cannot alter one of the properties.

409 (Conflict) - The client has provided a value whose semantics are not appropriate for the property. This includes trying to remove mandatory attributes.

6.3.2 Example - proppatching a MetaNode

>> Request

PROPPATCH /imv/rushi/48b4c1df-00ec-1000-915e-cc1c9f8389c7 HTTP/1.1
Content-Type: text/xml
Content-Length: xxx

<propertyupdate>
  <set>
    <prop>
      <value>MP3 Song</value>
      <artist mandatory="true" />
      <size>0</size>
      <recordlabel/>
    </prop>
  </set>
  <remove>
    <prop>
      <label/>
    </prop>
  </remove>
</propertyupdate>


>> Response

HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset=utf-8
Date: Wed, 27 Feb 2002 17:56:13 GMT
Server: Apache Tomcat/4.0.1 (HTTP/1.1 Connector)
 
<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:I="urn:schemas:imv:">
   <D:response xmlns:m="http://localhost:8080/imv/rushi/48b4c1df-00ec-1000-915e-cc1c9f8389c7">
      <D:href>http://localhost:8080/imv/rushi/48b4c1df-00ec-1000-915e-cc1c9f8389c7</D:href>
      <D:propstat>
         <D:prop>
            <I:value>MP3 Song</I:value>
            <m:artist I:mandatory="true" />
            <m:size>0</m:size>
            <m:recordlabel />
         </D:prop>
         <D:stat>HTTP/1.1 200 OK</D:stat>
      </D:propstat>
   </D:response>
</D:multistatus>

We have added two MetaAttributes "size" and "recordlabel" and changed system property "value." We have also removed the MetaAttribute "label." Removing a MetaAttribute SHOULD NOT remove DataAttributes of the this MetaNode's instances (DataNodes).

6.3.3 Example - proppatching an Attribute

>> Request

PROPPATCH /imv/rushi/48b4c1df-00ec-1000-915e-cc1c9f8389c7/artist HTTP/1.1
Content-Type: text/xml
Content-Length: xxx

<propertyupdate>
  <set>
    <prop>
      <value>Unknown artist</value>
      <mandatory>false</mandatory>
      <accessRead>20</accessRead>
    </prop>
  </set>
</propertyupdate>


>> Response

HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset=utf-8
Date: Wed, 27 Feb 2002 17:58:18 GMT
Server: Apache Tomcat/4.0.1 (HTTP/1.1 Connector)
 
<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:I="urn:schemas:imv:">
   <D:response xmlns:m="http://localhost:8080/imv/rushi/48b4c1df-00ec-1000-915e-cc1c9f8389c7">
      <D:href>http://localhost:8080/imv/rushi/48b4c1df-00ec-1000-915e-cc1c9f8389c7/artist</D:href>
      <D:propstat>
         <D:prop>
            <I:value>Unknown artist</I:value>
            <I:accessRead>20</I:accessRead>
            <I:mandatory>false</I:mandatory>
         </D:prop>
         <D:stat>HTTP/1.1 200 OK</D:stat>
      </D:propstat>
   </D:response>
</D:multistatus>

We can make modifications to the "artist" attribute of the MetaNode in the previous example by using the ATTRIBUTE URL directly.

6.3.4 Example - proppatching a DataNode

>> Request

PROPPATCH /imv/rushi/48b75da2-00ec-1000-afb9-cc1c9f8389c7 HTTP/1.1
Content-Type: text/xml
Content-Length: xxx

<propertyupdate>
  <set>
    <prop>
      <hitCount>17123</hitCount>
      <title>Flop</title>
      <recordlabel>Sony Music</recordlabel>
    </prop>
  </set>
  <remove>
    <prop>
       <artist/>
       <label/>
    </prop>
  </remove>
</propertyupdate>


>> Response

HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset=utf-8
Date: Wed, 27 Feb 2002 18:00:38 GMT
Server: Apache Tomcat/4.0.1 (HTTP/1.1 Connector)
 
<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:I="urn:schemas:imv:">
   <D:response xmlns:m="http://localhost:8080/imv/rushi/48b4c1df-00ec-1000-915e-cc1c9f8389c7">
      <D:href>http://localhost:8080/imv/rushi/48b75da2-00ec-1000-afb9-cc1c9f8389c7</D:href>
      <D:propstat>
         <D:prop>
            <m:title>Flop</m:title>
            <m:recordlabel>Sony Music</m:recordlabel>
         </D:prop>
         <D:stat>HTTP/1.1 200 OK</D:stat>
      </D:propstat>
      <D:propstat>
         <D:prop>
            <I:hitCount />
         </D:prop>
         <D:stat>HTTP/1.1 403 Forbidden</D:stat>
      </D:propstat>
   </D:response>
</D:multistatus>

We are unable to remove "artist" because it is a mandatory attribute now. We cannot set system property hitCount because it is not settable.

6.4 GET

The GET method is not meaningful on ENTITY and DATASOURCE URLs, though the implementors may wish to use them for giving HTML descriptions of the entities and datasources.

The GET method when used with an attribute will retrieve any uploaded resource. If no resource has been uploaded previously, the method will provide a 204 No Content response. Otherwise it will respond with 200 OK and provide the resource as a MIME type with the Content-Type and optionally Content-Length in the HTTP header. The body will contain the actual content of the resource.

6.5 DELETE

The DELETE method is meaningful only on ENTITY URLs. Deletion of attributes can be done only through PROPPATCH. Delete will remove the entity from the datasource and return either "204 No Content" on success or "404 Not Found" or "403 Forbidden" on failure. Deletions are not cascaded, so deleting a MetaNode does not delete its DataNodes or MetaRelations. Explicit deletions of instances are required.

6.6 SEARCH

The SEARCH method conforms to DASL's basicsearch XML schema and is used for selecting a set of DataEntity instances of a given MetaEntity. See internet-draft-(TODO: find out) for information about DASL's proposed search mechanism for DAV. Current version of the IMV system should support at least SEARCH on two scopes -- single MetaNodes and single MetaRelations.

The search arbiter is the datasource and all SEARCH methods are valid only for DATASOURCE URLs. The datasource defines the search space, further restricted by the scope on which we are selecting data instances. The behaviour is described below

6.6.1 SEARCH on MetaNode

It should be possible to retrieve all instances of a MetaNode within a datasource (i.e. not outside the scope of the datasource, eg, imported instances). The select XML element allows specification of system properties and attributes of the DataEntities requested. The scope element should only the href of the MetaNode. The where clause contains the filter expression tree. Valid operators are eq (equals), ne (not equals), gt (greater than), lt (less than), ge (greater than or equals), le (less than or equals). Comparisons are made on strings. Later versions should support other data-types. Each binary operation takes two elements to be compared which maybe props or literals.

6.6.2 SEARCH on MetaRelation

A search on MetaRelation allows the retrieval of instances (DataRelations) of the MetaRelation. The syntax is very similar to the search on MetaNode, except that apart from allowing reference to the DataRelation's system properties and attributes, it also allows reference to the properties of the srcNode and destNode attached by the DataRelation. Distinction is made by using appropriate namespaces to distinguish prop names of the DataRelation from those of the srcNode and destNode.

6.6.3 Example Searching on MetaRelation

SEARCH /imv/pavan HTTP/1.1
Content-Type: text/xml
Content-Length: 700

<searchrequest>
  <basicsearch xmlns:m="http://localhost:8080/imv/pavan/379802de-00ec-1000-ab9b-cc1c9f8389c7"
               xmlns:msrc="http://localhost:8080/imv/pavan/379802de-00ec-1000-ab9b-cc1c9f8389c7#src"
               xmlns:mdest="http://localhost:8080/imv/pavan/379802de-00ec-1000-ab9b-cc1c9f8389c7#dest"
	       >
    <select>
	<msrc:title/>
	<msrc:artist/>
	<mdest:username/>
	<m:rating/>
    </select>
    <from>
        <scope>
	  <href>379802de-00ec-1000-ab9b-cc1c9f8389c7</href>
        </scope>
    </from>
    <where>
        <ge>
	  <prop><m:rating/></prop>
	  <literal>4</literal>
	</ge>
    </where>
  </basicsearch>
</searchrequest>


>>> Response

HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset=utf-8
Date: Sun, 24 Feb 2002 10:20:40 GMT
Server: Apache Tomcat/4.0.1 (HTTP/1.1 Connector)

<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:I="urn:schemas:imv:">
   <D:response xmlns:m="http://localhost:8080/imv/pavan/379802de-00ec-1000-ab9b-cc1c9f8389c7" xmlns:msrc="http://localhost:8080/imv/pavan/379802de-00ec-1000-ab9b-cc1c9f8389c7#src" xmlns:mdest="http://localhost:8080/imv/pavan/379802de-00ec-1000-ab9b-cc1c9f8389c7#dest">
      <D:href>http://localhost:8080/imv/pavan/37a0d42d-00ec-1000-a771-cc1c9f8389c7</D:href>
      <D:propstat>
         <D:prop>
            <m:rating>5</m:rating>
            <msrc:title>Beautiful day</msrc:title>
            <msrc:artist>U2</msrc:artist>
            <mdest:username>maverick</mdest:username>
         </D:prop>
         <D:stat>HTTP/1.1 200 OK</D:stat>
      </D:propstat>
   </D:response>
   <D:response xmlns:m="http://localhost:8080/imv/pavan/379802de-00ec-1000-ab9b-cc1c9f8389c7" xmlns:msrc="http://localhost:8080/imv/pavan/379802de-00ec-1000-ab9b-cc1c9f8389c7#src" xmlns:mdest="http://localhost:8080/imv/pavan/379802de-00ec-1000-ab9b-cc1c9f8389c7#dest">
      <D:href>http://localhost:8080/imv/pavan/37a1f3c7-00ec-1000-919e-cc1c9f8389c7</D:href>
      <D:propstat>
         <D:prop>
            <m:rating>4</m:rating>
            <msrc:title>Video</msrc:title>
            <msrc:artist>India Arie</msrc:artist>
            <mdest:username>Santosh</mdest:username>
         </D:prop>
         <D:stat>HTTP/1.1 200 OK</D:stat>
      </D:propstat>
   </D:response>
   <D:response xmlns:m="http://localhost:8080/imv/pavan/379802de-00ec-1000-ab9b-cc1c9f8389c7" xmlns:msrc="http://localhost:8080/imv/pavan/379802de-00ec-1000-ab9b-cc1c9f8389c7#src" xmlns:mdest="http://localhost:8080/imv/pavan/379802de-00ec-1000-ab9b-cc1c9f8389c7#dest">
      <D:href>http://localhost:8080/imv/pavan/37a231fc-00ec-1000-c46c-cc1c9f8389c7</D:href>
      <D:propstat>
         <D:prop>
            <m:rating>4</m:rating>
            <msrc:title>Video</msrc:title>
            <msrc:artist>India Arie</msrc:artist>
            <mdest:username>hyporg</mdest:username>
         </D:prop>
         <D:stat>HTTP/1.1 200 OK</D:stat>
      </D:propstat>
   </D:response>
</D:multistatus>



 TOC 

7. Authentication

Three types of users can login to the system -- owner, friend and guest. The owner can access his data source with an administrative password and regular HTTP authentication will follow. Guests are anonymous users (i.e. users that do not provide any password and hence have the most restricted access). Friends are people who are known to the owner of the datasource and whose entry has been made in the datasource's address book (also stored in IMV format using system defined schema).

IMV could use a public/private key mechanism to authenticate friends. The address book contains an 4-tuple (username, datasource URL, public key, access level) of each friend. The friend attempts to login with HTTP authentication providing username and datasource URL as password. The server will start a session and randomly generate a token and present it back to the user agent (browser). The browser will sign the token with the friend's private key and send it back to the server. The server will decode the token to check authenticity and allow the friend in with the predefined access level. This access level is maintained throughout the entire session.

The owner has an access level of 0 (highest) and guest has an access level of 99 (lowest)

This system is dependent on the assumption that all friends have valid address book entries in a user's datasource before they are allowed access.



 TOC 

8. Access Control

Access to entities is given to the the user as per his/her access level. Each entity has three basic access control properties:

accessRead

accessWrite

accessVisible

All three properties have different significance depending on the type of entity.In each case access is permitted to the user if his/her access level is lower than or equal to the respective property value.

8.1 Access control for MetaEntities

In case of MetaEntities accessRead permission allows the user to propfind on the MetaEntity and search for instances of the MetaEntity. AcessWrite permission allows the user to create instances of the MetaEntity. The MetaEntity is visible to the user only if he has the required accessVisible permission i.e if he/she tries to access without appropriate permission, a not found error is encountered. The right of editing an MetaEntity lies solely with owner of the entity.

8.2 Access control for DataEntities

In case of DataEntities accessRead permission allows the user to propfind the properties of the DataEntity. AcessWrite permission allows to set or change properties of the DataEntity. The DataEntity is visible to the user only if he has the required accessVisible permission i.e if he/she tries to access without appropriate permission, a not found error is encountered.

8.3 Access control for MetaAttributes

In case of MetaAttributes accessRead permission allows the user to propfind on the MetaAttribute. AcessWrite permission is undefined. The MetaAttribute is visible to the user only if he has the required accessVisible permission i.e if he/she tries to access without appropriate permission, a not found error is encountered. The right of editing an MetaAttribute lies solely with owner of the entity.

8.4 Access control for DataAttributes

In case of DataAttributes accessRead permission allows the user to propfind the properties of the DataAttribute. AcessWrite permission allows to set or change properties of the DataEntity. The DataAttribute is visible to the user only if he has the required accessVisible permission i.e if he/she tries to access without appropriate permission, a not found error is encountered.

Access control is hierarchial. To access an attribute, the user must have appropriate access permission from the entity to which it belongs. For example, to modify the value of a DataAttribute, the user must have accessWrite permission to the DataAttribute and accessWrite to the DataEntity.



 TOC 

Authors' Addresses

  Rushi Desai
  Maharashtra Institute of Technology
  850/6A Shivajinagar
  Pune, MH 411004
  India
Phone:  +91 20 565 9001
EMail:  rushi@mail.com
URI:  http://rushi.port5.com
  
  Pavan Kumar Reddy
  Maharashtra Institute of Technology
  Flat no. 3, Chetana Residency, Kalyani Nagar
  Pune, MH 411006
  India
Phone:  +91 20 668 5452
EMail:  reddypavan@hotmail.com
URI: 


 TOC 

Full Copyright Statement

Acknowledgement