Skip to content
This repository has been archived by the owner on Mar 14, 2021. It is now read-only.

REST API: Schema information

Stefano Cossu edited this page Jul 20, 2017 · 5 revisions

DRAFT—Not implemented

NOTE: These requests yield rarely changing data and should be cached for 24h or longer in production clients.

Discover all asset sub-types

Request

GET <API endpoint root>/schema/aictype:Asset/subtypes

Response Parameters

  • uri (string): Asset type identifier (URI)
  • label (string): Asset type label
  • acceptMimeTypes (list of strings): Accepted mime types for the asset type

####Example response

{
	"results": [
		{
			"uri": "http://definitions.artic.edu/ontology/type#StillImage",
			"label": "Image",
			"acceptMimeTypes": [
				"image/jpeg",
				"image/bmp",
				"image/tiff"
			]
		},
		{
			"uri": "http://definitions.artic.edu/ontology/type#Text",
			"label": "Text",
			"acceptMimeTypes": [
				"text/plain",
				"application/rtf",
				"application/msword"
			]
		}
	]
}

Discover all properties and parameters for a specific asset type

This applies to Assets, Comments, Tags and any other types that need to be discovered by clients.

Request

GET <API endpoint root>/schema/<resource type URI>/properties

Response parameters

  • uri (string): Resource identifier
  • label (string): Property label
  • searchable (bool): Property is a searchable term
  • viewable (bool): Property is available in Manager or Editor
  • category (string): Property category: can be used to group properties for a more organized uix view (@TODO stub - defaults to "Basic Info")
  • editable (bool): Property is editable (opposite of read-only). This can inform the UI appearance (e.g. a read-only text field is greyed out)
  • dataType (string, XSD URI - if it is a LAKE resource, "xsd:anyURI" is used): Data type (text, numeric…) (See http://books.xmlschemata.org/relaxng/relax-CHP-19.html). This informs the GUI about which type of widget to display.
  • resourceType (string): RDF type of individuals accepted for resource (if the property is a LAKE resource - ignore for literals or out-of-repo URIs)
  • minCardinality (non-negative int): Minimum occurrence of property - 0 means optional, >0 means mandatory
  • maxCardinality (positive int): Maximum occurrence of property - 1 is single-valued, >1 is multi-valued, unset is unbound
  • controlledValues (object): Lookup list directives. This JSON object presents the following properties:
    • type (string): "list" or "authority". Lists are usually restricted do few elements easily displayable in a drop-down list; authorities are controlled values taken from an arbitrary number of resources and are more suitable for an autocomplete text field.
    • editable (bool): Whether values can be added or removed from list. UI should present different options accordingly.
    • deptRestricted(list of strings): Departments allowed to view this property. If the list is empty, all departments can see it (@TODO stub - default to empty list).
    • items: A list of objects representing all the possible choices for a list. If type is "authority", this is ignored and choices should be queried among repository resources with RDF type specified by the resourceType value.
  • fullTextSearchable (bool): Property is available for full text search (@TODO stub - defaults to true)

####Example response

{
	"results": [
		{
			"uri": "http://definitions.artic.edu/ontology#legacyUid",
			"label": "Legacy Number",
			"searchable": true,
			"viewable": true,
			"category": "Basic Info",
			"editable": false,
			"dataType": "http://www.w3.org/2001/XMLSchema#string",
			"minCardinality": 0,
			"maxCardinality": 1,
			"fullTextSearchable": true
		},
		{
			"uri": "http://definitions.artic.edu/ontology#imageType",
			"label": "Image Type",
			"searchable": true,
			"viewable": true,
			"category": "Basic Info",
			"editable": true,
			"dataType": "http://www.w3.org/2001/XMLSchema#string",
			"minCardinality": 0,
			"controlledValues": {
				"type" : "list", 
				"editable" : true,
				"items" : [
					{
						"label" : "Photo Documentation", 
						"value" : "https://lake.artic.edu/listItem1"
					},
					{
						"label" : "From Glass Negative", 
						"value" : "https://lake.artic.edu/listItem2"
					},
					{
						"label" : "Provisional", 
						"value" : "https://lake.artic.edu/listItem3"
					}
				]
			},
			"fullTextSearchable": true
		},
		{
			"uri": "http://definitions.artic.edu/ontology#hasTag",
			"label": "Tags",
			"searchable": true,
			"viewable": true,
			"category": "Basic Info",
			"editable": true,
			"dataType": "http://www.w3.org/2001/XMLSchema#anyURI",
			"resourceType" : "http://definitions.artic.edu/ontology/type#Tag",
			"controlledValues": {
				"type" : "authority", 
				"editable" : false
			},
			"fullTextSearchable": true,
		},
		{
			"uri": "http://definitions.artic.edu/ontology#hasComment",
			"label": "Comments",
			"searchable": true,
			"viewable": true,
			"category": "Basic Info",
			"editable": true,
			"dataType": "http://www.w3.org/2001/XMLSchema#anyURI",
			"resourceType" : "http://definitions.artic.edu/ontology/type#Comment",
			"controlledValues": {
				"type" : "authority", 
				"editable" : true
			},
			"fullTextSearchable": true
		}
	]
}