Shared vocabularies as partial responses

32 views
Skip to first unread message

Xavier Badosa

unread,
Jan 25, 2012, 3:20:44 PM1/25/12
to json...@googlegroups.com
Because JSON-stat must accept partial responses, the categories used in a dimension can be considered a JSON-stat partial response too (with no data).

In this fragment of dimension "sex" of a previous example, I have added the optional element uri:

... 
  "dimension" : 
  {
"sex" :
{
"label" : "Sex",
"category" : {
"index" : {
"M" : 0,
"F"  : 1,
"T"  : 2
} ,
"label" : {
"M" : "Male",
"F"  : "Female",
"T"  : "Total"
}
}
} ,
... 

A valid partial (data) response could include inside category only the uri element:

...
  "dimension" : 
  {
"sex" :
{
"label" : "Sex",
"category" : {
}
} ,
... 

The content of the uri element should be a request for a valid partial (categories) response. The request

could returned this JSON-stat (categories) partial response:

{

"index" : {

"M" : 0,
"F"  : 1,
"T"  : 2
} ,
"label" : {
"M" : "Male",
"F"  : "Female",
"T"  : "Total"
}
}
}

This schema allows responses with more than one classification (each with its own URI, that is, each should be able to be requested individually). The uri element in this response is the actual request (the one that returned this response): in this case it's redundant because only one classification was requested.

Of course, more metadata can enrich this basic schema (updated, general label or description, family vocabulary, standard name...), as it is the case for the rest of the JSON-stat elements described so far.

Big classifications shouldn't be retrieved with the data every time new data are available: JSON-stat categories responses should provide enough information for caching purposes (like, if available, expiration, probably not only in the response header).

Here is the same example

X.
Reply all
Reply to author
Forward
0 new messages