CHAOS concepts¶
Objects¶
Each media reference in CHAOS is called an Object. Objects have a number of fields (also called properties). The two most important properties are Files and Metadatas.
- Files is a list of files (media URLs) associated with the object
- Metadatas is a list of metadata (XML strings) associated with the object
An overview can be seen in the figure below.
Object properties | |
---|---|
Property name | Description |
GUID | Unique ID of the object (a GUID) |
ObjectTypeID | The type of the object |
Metadatas | A list of metadata objects (Metadata) |
Files | A list of file objects (FileInfo) |
ObjectRelations | A list of objects related to this object |
Files¶
A file consists of a filename, a URL and some type specifications. The URL can be used as-is, meaning that you don’t have to concatenate the URL and the filename.
A file has several different format specifiers. In order of most general to most specific they are:
- FormatType is the type of the media: an image, a video, sound etc.
- FormatCategory specifies in what context the media should be used. For example it could specify Image Thumbnail or Image Original so that a page showing many images should use the thumbnail (Image Thumbnail) whereas a page dedicated to that specific image should use the original (Image Original).
- Format and FormatID are very specific: for example Image JPEG 200x200.
Note
This hierarchy is still under discussion and is subject to change. Furthermore no current CHAOS database lives up to this standard and thus you should ask or check your data to find how these format specifications have been used in your particular database.
File properties | |
---|---|
Property name | Description |
URL | Location of the file |
Filename | The filename of the particular file |
FormatType | Image, Video, Sound, Document |
FormatCategory | Image Thumbnail, Image Original, Movie Clip, Movie Original etc. |
Format | Image JPEG 320x480, Movie AVI 378x210 etc. |
Metadata¶
The metadata is typically some form of description of the object, but could also be data related to the object such as tags or geodata. Every metadata XML-document conforms to a specific XML-schema called the MetadataSchema identified by its GUID. The MetadataSchema can be looked up in the CHAOS database and read out similar to getting an object from the database.
Things such the title and description of an object is typically stored in the metadata.
An object can have multiple Metadata conforming to the same MetadataSchema. Let’s say for example that the schema dictates that the Metadata is a description and title of the object. What you would typically have is then the title and description in multiple languages. The LanguageCode of the Metadata tells you the language of the specific entry such that you can grab the appropriate Metadata for your users. Another case of multiple Metadata with the same MetadataSchemaGUID could be tag metadata where each metadata xml-string is a tag.
Metadata properties | |
---|---|
Property name | Description |
GUID | GUID of the Metadata |
MetadataSchemaGUID | The GUID of the XML schema describing the MetadataXML XML document. |
MetadataXML | The metadata as an XML document |
LanguageCode | Language code indicating the language of the metadata. |
LanguageCode should generally be two-letter IETF language tags (the primary language subtag).
Object retrieval and search¶
The CHAOS database is indexed in a Apache Solr index, and searching but also retrieving objects in general is done through this index.
To search the index you specify some query string and send it to CHAOS which sends it on to Solr. The Solr query syntax is based on the Lucene query syntax. It is in general not necessarry to know the query syntax – there are built-in utility functions in the Portal.Client libraries and in CHAOS to handle most common use cases.
Retrieving a single object can be done by “searching” on the GUID field: GUID:object_guid and multiple objects can be retrieved by combining guid searches: GUID:object1_guid OR GUID:object2_guid.
Here we search for
GUID:00000000-0000-0000-0000-00004e040016
which becomes
GUID%3A00000000-0000-0000-0000-00004e040016
inside the URL.
So the full CHAOS request URL becomes:
http://api.chaos-systems.com/v5/Object/Get?
query=(GUID%3A00000000-0000-0000-0000-00004e040016)&
accessPointGUID=7A06C4FF-D15A-48D9-A908-088F9796AF28&
pageIndex=0&
pageSize=1&
includeFiles=true
With added linebreaks for readability. (You can’t copy this directly into the address bar because of the linebreaks, but here’s a link)