Difference between revisions of "DescribeFrags"
From ARK
(→Optional) |
|||
Line 22: | Line 22: | ||
*'''passwd''' - password | *'''passwd''' - password | ||
+ | |||
+ | The method returns a JSON array unless otherwise specified: | ||
+ | |||
+ | *'''format''' - 'json' by default, but sending 'html' prints a human-readable array to screen | ||
===Example 1 - Describe all text fragments with their Aliases=== | ===Example 1 - Describe all text fragments with their Aliases=== |
Latest revision as of 15:50, 15 November 2013
This method is used to supply a list of available data fragments within the ARK instance. It will return a JSON array of all the different types for either a specified dataclass or all of the available classes within ARK and their relative ids and itemkeys.
Contents
Path
http://your.ark.instance/api.php?req=describeFrags
Arguments
Mandatory
- dataclass - this can be any of the main dataclasses, e.g. action,attribute, date, span, txt, number,file. If you want to return all of the possible data fragment types then set the argument to 'all'. Please note that xmi's do not have types and therefore cannot be described
Optional
- classtype - if you are describing attributes, you may want to see the possible attributes of a specific type. Set the classtype argument to the name or id of the desired attributetype.
- aliased - set this argument to 'true' if you want the human-readable aliases to be returned
If anonymous logins are not enabled a username and password will need to be supplied:
- handle - username
- passwd - password
The method returns a JSON array unless otherwise specified:
- format - 'json' by default, but sending 'html' prints a human-readable array to screen
Example 1 - Describe all text fragments with their Aliases
Example return (returned JSONified - displayed as an array here for ease of viewing):
Array ( [txt] => Array ( [0] => Array ( [dataclass] => txt [id] => 1 [txttype] => interp [aliases] => Array ( [0] => Array ( [0] => 81 [id] => 81 [1] => Interpretation [alias] => Interpretation [2] => en [language] => en ) ) ) [1] => Array ( [dataclass] => txt [id] => 2 [txttype] => short_desc [aliases] => Array ( [0] => Array ( [0] => 82 [id] => 82 [1] => Short Description [alias] => Short Description [2] => en [language] => en ) ) ) ) )
Example 2 - Describe all possible fragments with their Aliases
Example return (returned JSONified - displayed as an array here for ease of viewing):
Array ( [attribute] => Array ( [0] => Array ( [dataclass] => attribute [id] => 1 [attributetype] => recflag [aliases] => Array ( [0] => Array ( [0] => 53 [id] => 53 [1] => Record Status Flag [alias] => Record Status Flag [2] => en [language] => en ) ) ) [1] => Array ( [dataclass] => attribute [id] => 14 [attributetype] => direction [aliases] => Array ( [0] => Array ( [0] => 297 [id] => 297 [1] => Door Direction [alias] => Door Direction [2] => en [language] => en ) ) ) [2] => Array ( [dataclass] => attribute [id] => 15 [attributetype] => featurecat [aliases] => Array ( [0] => Array ( [0] => 319 [id] => 319 [1] => Type [alias] => Type [2] => en [language] => en ) ) ) ) [date] => Array ( [0] => Array ( [dataclass] => date [id] => 1 [datetype] => issuedon [aliases] => Array ( [0] => Array ( [0] => 55 [id] => 55 [1] => Issued on [alias] => Issued on [2] => en [language] => en ) ) ) [1] => Array ( [dataclass] => date [id] => 2 [datetype] => compiledon [aliases] => Array ( [0] => Array ( [0] => 56 [id] => 56 [1] => Compiled on [alias] => Compiled on [2] => en [language] => en ) ) ) ) )
Example 3 - Describe all possible attributes of type direction with their Aliases
Example return (returned JSONified - displayed as an array here for ease of viewing):
Array ( [direction] => Array ( [0] => Array ( [0] => 76 [id] => 76 [1] => n [attribute] => n [2] => 14 [attributetype] => 14 [3] => cor [module] => cor [4] => 1 [cre_by] => 1 [5] => 2012-06-02 12:17:26 [cre_on] => 2012-06-02 12:17:26 [aliases] => Array ( [0] => Array ( [0] => 298 [id] => 298 [1] => N [alias] => N [2] => en [language] => en ) ) ) [1] => Array ( [0] => 77 [id] => 77 [1] => ne [attribute] => ne [2] => 14 [attributetype] => 14 [3] => cor [module] => cor [4] => 1 [cre_by] => 1 [5] => 2012-06-02 12:17:45 [cre_on] => 2012-06-02 12:17:45 [aliases] => Array ( [0] => Array ( [0] => 299 [id] => 299 [1] => NE [alias] => NE [2] => en [language] => en ) ) ) [2] => Array ( [0] => 78 [id] => 78 [1] => e [attribute] => e [2] => 14 [attributetype] => 14 [3] => cor [module] => cor [4] => 1 [cre_by] => 1 [5] => 2012-06-02 12:17:55 [cre_on] => 2012-06-02 12:17:55 [aliases] => Array ( [0] => Array ( [0] => 300 [id] => 300 [1] => E [alias] => E [2] => en [language] => en ) ) ) [3] => Array ( [0] => 79 [id] => 79 [1] => se [attribute] => se [2] => 14 [attributetype] => 14 [3] => cor [module] => cor [4] => 1 [cre_by] => 1 [5] => 2012-06-02 12:18:07 [cre_on] => 2012-06-02 12:18:07 [aliases] => Array ( [0] => Array ( [0] => 301 [id] => 301 [1] => SE [alias] => SE [2] => en [language] => en ) ) ) ) )