Conceptually there are two response types exposed by BaseSpace, an
individual response and a collection response. The former, modeled by
Item S4 class, is used when querying an individual
item/instance within a resource. The later is used for listing the
items/instances available for a given resource and is modeled by the
Collection S4 class.
Itemclass models a simple unordered set of key/value pairs. There is a core set of keys, for which access methods are defined and which are inherited by any child class. In the following
$operator can be used to access the Item elements. When
xis an Item object this is equivalet to
@. But one can think at it as user level operator. Unlike
@the replace method is not implemented for
listobject, but it might be replace with an object at a future point.
Collectionclass models an ordered set of
Itemobjects and a set of predefined attributes. The interface provided by the
Itemclass is implemented by this class. However, since we deal with an ordered set of objects, the methods and the access methods, return a vector of the same length as the size of the collection. In the following
Collectionobject. All accesor implemented by the item class are implemented by Collection class. However here the return value is a vector. If
xhas 2 elements, then
Id(x)will be a vector with 2 elements. The same stands for the general accessor
listrepresentation of the object.
showClass("Item") showClass("Collection") showClass("Response")