Document a convention for using Links to define tags on Collections.
authorTim Pierce <twp@curoverse.com>
Fri, 3 Jan 2014 20:32:37 +0000 (15:32 -0500)
committerTim Pierce <twp@curoverse.com>
Fri, 3 Jan 2014 20:32:37 +0000 (15:32 -0500)
doc/api/schema/Link.textile

index ed8271dafdaa043db3d96f3f93616b88fe98c356..6156414301a6517282ff31218939f81a48759d53 100644 (file)
@@ -8,12 +8,21 @@ navorder: 12
 
 h1. Link
 
-Links encode connections between Arvados objects, and from objects to primitives.  Each metadata object has a tail (subject), class, name, properties, and head (object or value).
+**Links** describe relationships between Arvados objects, and from
+objects to primitives.
 
-table(table table-bordered table-condensed).
-|tail (object)| _class, name_ 
-&rarr;
- _properties{}_ |head (object)|
+Links are directional: each metadata object has a tail (subject),
+class, name, properties, and head (object or value).  A Link may
+describe a relationship between two objects in an Arvados database:
+e.g. a _permission_ link between a User and a Group defines the
+permissions that User has to read or modify the Group.  Other Links
+simply represent metadata for a single object, e.g. the _identifier_
+Link, in which the _name_ property represents a human-readable
+identifier for the object at the link's head.
+
+For links that don't make sense to share between API clients, a
+_link_class_ that begins with @client@ (like @client.my_app_id@ or
+@client.my_app_id.anythinghere@) should be used.
 
 h2. Methods
 
@@ -39,20 +48,49 @@ h2. Link classes
 
 Some classes are pre-defined by convention and have standard meanings attached to names.
 
+h3. provenance
+
 table(table table-bordered table-condensed).
-|_. link_class|_. tail_type&rarr;head_type|_. name&rarr;head_uuid {properties}|_. Notes|
-|provenance|&rarr;Collection  |provided &rarr; _collection uuid_
+|_. tail_type&rarr;head_type|_. name&rarr;head_uuid {properties}|_. Notes|
+|&rarr;Collection  |provided &rarr; _collection uuid_
 {url&rarr;http://example.com/foo.tgz, retrieved_at&rarr;1352616640.000}||
-|provenance|Job&rarr;Collection     |provided &rarr; _collection uuid_||
-|provenance|Specimen&rarr;Collection|provided &rarr; _collection uuid_||
-|provenance|Human&rarr;Specimen     |provided &rarr; _specimen uuid_||
-|provenance|Human&rarr;Collection   |provided &rarr; _collection uuid_||
-|human_trait|Human&rarr;Trait  |measured &rarr; _trait uuid_ {value&rarr;1.83, unit&rarr;metre, measured_at&rarr;1352616640.000}||
-|identifier|&rarr;Human        |hu123456 &rarr; _human uuid_||
-|permission|User&rarr;Group  |can_manage &rarr; _group uuid_|Writable only by a user who can_manage this group|
-|permission|User&rarr;Group  |can_read &rarr; _group uuid_  |Writable only by a user who can_manage this group.
+|Job&rarr;Collection     |provided &rarr; _collection uuid_||
+|Specimen&rarr;Collection|provided &rarr; _collection uuid_||
+|Human&rarr;Specimen     |provided &rarr; _specimen uuid_||
+|Human&rarr;Collection   |provided &rarr; _collection uuid_||
+
+h3. permission
+
+table(table table-bordered table-condensed).
+|_. tail_type&rarr;head_type|_. name&rarr;head_uuid {properties}|_. Notes|
+|User&rarr;Group  |can_manage &rarr; _group uuid_|Writable only by a user who can_manage this group|
+|User&rarr;Group  |can_read &rarr; _group uuid_  |Writable only by a user who can_manage this group.
 Gives permission to read any object owned by this group.|
-|resources|User&rarr;Collection|wants &rarr; _collection uuid_    |Determines whether data can be deleted|
-|resources|User&rarr;Job       |wants &rarr; _job uuid_    |Determines whether a job can be cancelled|
 
-For links that don't make sense to share between API clients, a link class like @client.my_app_id@ or @client.my_app_id.anythinghere@ should be used.
+h3. resources
+
+table(table table-bordered table-condensed).
+|_. tail_type&rarr;head_type|_. name&rarr;head_uuid {properties}|_. Notes|
+|User&rarr;Collection|wants &rarr; _collection uuid_    |Determines whether data can be deleted|
+|User&rarr;Job       |wants &rarr; _job uuid_    |Determines whether a job can be cancelled|
+
+h3. tag
+
+A **tag** link is a keyword string that identifies a group of collections.  A collection may be assigned multiple tags, and a tag will typically include many collections.
+
+table(table table-bordered table-condensed).
+|_. tail_type&rarr;head_type|_. name&rarr;head_uuid {properties}|_. Notes|
+|&rarr;Collection           | _tag name_ &rarr; _collection uuid_||
+
+h3. human_trait
+
+table(table table-bordered table-condensed).
+|_. tail_type&rarr;head_type|_. name&rarr;head_uuid {properties}|_. Notes|
+|Human&rarr;Trait  |measured &rarr; _trait uuid_ {value&rarr;1.83, unit&rarr;metre, measured_at&rarr;1352616640.000}||
+
+h3. identifier
+
+table(table table-bordered table-condensed).
+|_. tail_type&rarr;head_type|_. name&rarr;head_uuid {properties}|_. Notes|
+|&rarr;Human        |hu123456 &rarr; _human uuid_||
+