add api/Links
authorTom Clegg <tom@clinicalfuture.com>
Wed, 10 Apr 2013 20:30:01 +0000 (13:30 -0700)
committerTom Clegg <tom@clinicalfuture.com>
Wed, 10 Apr 2013 20:30:01 +0000 (13:30 -0700)
doc/api/Links.textile [new file with mode: 0644]

diff --git a/doc/api/Links.textile b/doc/api/Links.textile
new file mode 100644 (file)
index 0000000..c9ff43b
--- /dev/null
@@ -0,0 +1,53 @@
+---
+layout: default
+navsection: api
+title: API Reference
+navorder: 10
+---
+
+h1. Links
+
+Links encode connections between Orvos objects, and from objects to primitives.  Each metadata object has a tail (subject), class, name, properties, and head (object or value).
+
+table(table table-bordered table-condensed).
+|tail (object)| _class, name_ 
+&rarr;
+ _properties{}_ |head (object)|
+
+h2. Methods
+
+See [[API REST Methods|REST methods for working with Orvos resources]]
+
+API endpoint base: @https://xyzzy.orvosapi.com/orvos/v1/links@
+
+h2. Resource
+
+Each link has, in addition to the usual [[API Resources|attributes of Orvos resources]]:
+
+table(table table-bordered table-condensed).
+|*Attribute*|*Type*|*Description*|
+|tail_uuid|string|Object UUID at the tail (start, source, origin) of this link|
+|tail_kind|string|Object kind at the tail (start, source, origin) of this link|
+|link_class|string|Class (see below)|
+|name|string|Link type (see below)|
+|head_uuid|string|Object UUID at the head (end, destination, target) of this link|
+|head_kind|string|Object kind at the head (end, destination, target) of this link|
+|properties{}|list|Additional information, expressed as a key&rarr;value hash. Key: string. Value: string, number, array, or hash.|
+
+h2. Link classes
+
+Some classes are pre-defined by convention and have standard meanings attached to names.
+
+table(table table-bordered table-condensed).
+|*link_class*|*tail_type&rarr;head_type*|*name&rarr;head_uuid {properties}*|*Notes*|
+|data_origin|Collection&rarr;string  |retrieved_by &rarr; _user uuid_ {url&rarr;http://example.com/foo.tgz, retrieved_at&rarr;1352616640.000}||
+|data_origin|Collection&rarr;Job     |output_of &rarr; _job uuid_||
+|data_origin|Collection&rarr;Specimen|derived_from &rarr; 4ly9q-2g125-fbzfbavpo4gwpw0||
+|human_trait|Human&rarr;Trait  |measured &rarr; _trait uuid_ {value&rarr;1.83, unit&rarr;metre, measured_at&rarr;1352616640.000}||
+|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.
+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.