[occi-wg] Syntax for attributes on links
Richard Davies
richard.davies at elastichosts.com
Wed May 6 11:32:40 CDT 2009
Following up the topic of attributes on links after the discussion on our
call:
The original example was:
> <link href="urn:uuid:4cc8cf62-69a4-4650-9e8c-7d4c516884df"
> rel="http://purl.org/occi/storage#device" title="Hard Drive"/>
And as I said before, we also need a device identifier at which to connect
the storage, making it something like:
> <link type="ide:0:0" href="urn:uuid:4cc8cf62-69a4-4650-9e8c-7d4c516884df"
> rel="http://purl.org/occi/storage#device" title="Hard Drive"/>
which mapped to JSON as:
> "link":[
> {
> "type":"ide:0:0"
> "rel":"http://purl.org/occi/storage#device",
> "href":"urn:uuid:4cc8cf62-69a4-4650-9e8c-7d4c516884df",
> "title":"Hard Drive"
> }
> ]
I still believe that the "link" here is a figment of conversion from the
Atom XML format. To write this in something more like native JSON, I'd go
with:
"ide:0:0": {
"href":"urn:uuid:4cc8cf62-69a4-4650-9e8c-7d4c516884df",
"title":"Hard Drive"
}
since the device identifier is unique for the VM, and clearly specifies this
as a place where storage is being attached.
In text format, I'd flatten this data structure as:
ide:0:0|href|4cc8cf62-69a4-4650-9e8c-7d4c516884df
ide:0:0|title|Hard Drive
or even just:
ide:0:0|4cc8cf62-69a4-4650-9e8c-7d4c516884df
ide:0:0|title|Hard Drive
Rather than the original:
link|ide:0:0|http://purl.org/occi/storage#device|Hard Drive|urn:uuid:4cc8cf62-69a4-4650-9e8c-7d4c516884df
This is rather cleaner in terms of not having to know what all the possible
attributes might be, and where they appear in the |-deliminated list.
Cheers,
Richard.
More information about the occi-wg
mailing list