Explain responses are means to advertise the search attributes of a given entity. At their simplest, they provide enough information to create an OpenSearch Description Document, but they can also include the supported CQL indexes, relations and modifiers available for a search client to perform more sophisticated queries.
Example:
http://connector.jangle.org/resources/search/description/
Methods allowed: GET, HEAD
Content-type required: application/json
JSON Schema:
{
"description":"A Jangle Explain Response",
"type":"object",
"properties":{
"type":{"type":"string","pattern":"/^explain$/"},
"request":{"type":"string","format":"uri"},
"shortname":{"type":"string","optional":true,"maxLength":16},
"description":{"type":"string","maxLength":1024},
"template":{"type":"string","format":"uri"},
"contact":{"type":"string","format":"email","optional":true},
"tags":{"type":"array","items":{"type":"string"},"optional":true},
"longname":{"type":"string","optional":true,"maxLength":48},
"image":{"type":"object","optional":true,"properties":{
"height":{"type":"integer","minimum":0,"optional":true},
"width":{"type":"integer","minimum":0,"optional":true},
"type":{"type":"string","optional":true},
"location":{"type":"string","format":"url"}}
},
"query":{"type":"object","optional":true,"properties":{
"example":{"type":"string","optional":true},
"context-sets",{"type":"array","items":{"type":"object","optional":true,"properties":{
"identifier":{"type":"string","format":"uri"},
"name":{"type":"string"},
"indexes":{type":"array","items":{"type":"string"}}
}
}
},
"developer":{"type":"string","optional":true,"maxLength":64},
"attribution":{"type":"string","optional":true,"maxLength":256},
"syndicationright":{"type":"string","enum":
["open","limited","private","closed"],"optional":true},
"adultcontent":{"type":"boolean","optional":true},
"language":{"type":["string","array"],"items":{"type":"string"},"optional":true},
"inputencoding":{"type":["string","array"],"items":{"type":"string"},"optional":true},
"outputencoding":{"type":["string","array"],"items":{"type":"string"},"optional":true}
}
}
An example JSON response:
{
"type":"explain",
"shortname":"Bibliographic records",
"longname":"Search Bibliographic records in OpenBiblio",
"request":"http:\/\/connector.jangle.org\/resources\/search\/description\/",
"description":"Bibliographic records search. Defaults to keyword anywhere.",
"template":
"http:\/\/connector.jangle.org\/resources\/search\/description\/?offset={startIndex?}&
count={count?}&query={searchTerms?}&format={jangle:format?}",
"tags": ["catalog", "library"],
"syndicationright":"open",
"query":{
"example":"dc.creator=thomas",
"context-sets":[
{
"name":"dc",
"identifier":"info:srw/cql-context-set/1/dc-v1.1",
"indexes":["title","creator","subject","publisher","format","identifier"]
},
{
"name":"rec",
"identifier":"info:srw/cql-context-set/2/rec-1.1",
"indexes":["identifier","collectionName","lastModificationDate","creationDate"]
},
{
"name":"cql",
"identifier":"info:srw/cql-context-set/1/cql-v1.2",
"indexes":["allRecords","allIndexes","anyIndexes","keywords"]
}
],
},
}
}
The definitions of each field are: