Difference between revisions of "The Database API v6"

From University Map Wiki
Jump to navigationJump to search
(Replaced content with "(This page is no longer in use - version 6 is now live and documented here).")
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Please read [[Terms and conditions, Copyright, Fair Use, etc.]] if you are going to use this API.
+
(This page is no longer in use - version 6 is now live and documented [[The_Database_API|here]]).
 
 
This page describes version 6 of the API. You can see a [[The_Database_API_v6_changes|summary of changes from version 5]]. Version 6 will be available some time in January 2013 after which version 5 will be withdrawn.
 
 
 
There is an experimental [[Python Database API interface]] if you want to work with this API from Python.
 
 
 
==Introduction==
 
 
 
The same information as provided by the [[The Map URL API]] is provided in machine readable form using URLs like this:
 
 
 
  <nowiki>http://map.cam.ac.uk/v6.json?</nowiki>q=''search''[&amp;partial=yes]
 
  <nowiki>http://map.cam.ac.uk/v6.json?</nowiki>bb=''boundingbox''
 
  <nowiki>http://map.cam.ac.uk/v6.json?</nowiki>ref=''ref''
 
  <nowiki>http://map.cam.ac.uk/v6.json?</nowiki>inst=''inst''
 
 
 
with the same interpretation as in [[The Map URL API]] (note that one=list is not relevant in the q= and bb= variants, and the simple&nbsp;<em>name </em>variant is not available to the API - just use <strong><nowiki>http://map.cam.ac.uk/v6.json?</nowiki>q=<em>name</em></strong>).
 
<p>
 
An additional option <strong>?limit=<em>limit</em></strong> is also available on the ?q and ?bb forms which limits the number of results returned to the number given. For example</p>
 
 
 
  <nowiki>http://map.cam.ac.uk/v6.json?</nowiki>q=saint&amp;limit=15
 
 
 
Values of query parameters, such as <strong>?q=</strong> are limited to 2,000 characters. For <strong>?inst=</strong> and <strong>?ref=</strong> queries, a maximum of 25 may be requested at once (separating the requested codes with '|').
 
 
 
<p>Also, there is another query type available to the database API not available when using a consumer URL. <strong>?alpha=<em>letter</em></strong> will provide an alphabetically ordered listing of the entire index for that letter. This is used as the basis for the directory page and other alphabetic listings. Please cache the results of this search so that it does not place an unwarranted load on the database. You can also filter by type, for example:</p>
 
 
 
  <nowiki>http://map.cam.ac.uk/v6.json?</nowiki>alpha=s&amp;filter=college
 
 
 
<p>The version 6 API also supports discovery and navigation around the reference hierarchy. See [[The Database API reference discovery]] for more details.</p>
 
 
 
<p>
 
The &#39;v6&#39; is a version number, allowing for potential backward compatibility if we change the spec at some point in the future. Only v6 is useful for now. v5 was deprecated in January 2013 and backward compatibility was not provided.</p>
 
<p>
 
The &#39;json&#39; part indicates the results are provided in JSON format. We may produce other formats in future, in which case URLs such as&nbsp;<strong><nowiki>http://map.cam.ac.uk/v6.xml?</nowiki>...</strong> would be introduced, but for the time being, only JSON is supported.</p>
 
<p>
 
The result is a JSON array:</p>
 
<p style="margin-left: 40px; ">
 
[ { &quot;type&quot;: <em>type0</em>, ... }, { &quot;type&quot;:&nbsp;<em>type1</em>, ...<em>&nbsp;</em>}, ... ]</p>
 
<p>
 
where each object in the array is an entity matching the request.&nbsp;If there are <strong>no results</strong>, an empty array is produced. If there is <strong>only one result</strong>, it is still provided as an array (of one object), not as just the object. Note also that requests by inst and ref may occasionally also yield more than one result. </p>
 
<p>
 
The content of the rest of each object depends on:</p>
 
<ul>
 
<li>
 
<em>type</em></li>
 
<li>
 
what information is available for each result</li>
 
<li>
 
whether the request was a search (q=... or <em>name</em>) or direct look up (ref or inst URLs)</li>
 
</ul>
 
<p>
 
<i>type</i>&nbsp;is one of:</p>
 
<p style="margin-left: 40px; ">
 
<strong>error<br />
 
institution<br />
 
site<br />
 
college</strong><br />
 
<strong>building<br />
 
entrance</strong><br />
 
<strong>nonuniversity</strong><br />
 
<strong>street</strong><br />
 
<strong>more</strong></p>
 
 
 
==Error reports==
 
 
 
<p>
 
If <em>type</em> is <strong>error</strong>, then the http request will also return an appropriate status code, typically 400 indicating the request is malformed (wrong combination of query parameters, for example) or 404 (api version or format not implemented for example). The consumer should also be prepared to handle other HTTP errors generated by the server which will not provide JSON data (500 for example). Apart from these, all correctly formed requests will generate status 200. Note that this includes requests with no results (which produce an empty array).</p>
 
<p>
 
Note also that if you mis-spell &#39;v6.json&#39; (for example, say you incorrectly use a capital V), then the URL may be interpreted as the end-user form M:/<em>name</em> so you would get a stream of HTML!</p>
 
 
 
<p>v5.json, the now deprecated API, will always produce an error like this (actually an HTTP 410 error).</p>
 
 
 
==Entity structure==
 
<p>
 
Contents of JSON objects representing entities found are as follows, by type.</p>
 
 
 
<p>In general, each request includes information about things linked to each result: the buildings for an institution, the entrances to a site and so on. This referencing only applies one level deep: those parts are excerpted: they do not themselves contain further entities to which they refer. If you need these, you would have to request the content by ref or inst from the parent. The fields omitted in the second level are indicated with an asterisk in the tables that follow.
 
 
 
===error===
 
 
 
<table class="wikitable">
 
<tr>
 
<td>
 
<strong>key</strong></td>
 
<td>
 
<strong>value</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
<strong>notes</strong></td>
 
</tr>
 
<tr>
 
<td>
 
type</td>
 
<td>
 
<strong>error</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
code</td>
 
<td>
 
the HTTP status code</td>
 
<td>
 
int</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
error</td>
 
<td>
 
text describing the error</td>
 
<td>
 
string</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
</table>
 
 
 
===more===
 
 
 
<table class="wikitable">
 
<tr>
 
<td>
 
<strong>key</strong></td>
 
<td>
 
<strong>value</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
<strong>notes</strong></td>
 
</tr>
 
<tr>
 
<td>
 
type</td>
 
<td>
 
<strong>more</strong></td>
 
<td>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
 
<td>
 
When the number of results is limited by <strong>?limit=<em>limit</em></strong>, the last element in the array of results may indicate "more", that there are more results that could be found but the limit was reached. Because certain results are redacted in some circumstances, note that the number of elements in the array may be fewer than limit+1 even if the limit is reached. "more" is not included if all the available results are returned. There isn't any way to page through the results: the search needs to be made more specific.</td>
 
</tr>
 
</table>
 
 
 
===institution===
 
 
 
<table class="wikitable">
 
<tr>
 
<td>
 
<strong>key</strong></td>
 
<td>
 
<strong>value</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
<strong>notes</strong></td>
 
</tr>
 
<tr>
 
<td>
 
type</td>
 
<td>
 
<strong>institution</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
inst</td>
 
<td>
 
the institution code of the entity</td>
 
<td>
 
string</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
role</td>
 
<td>
 
kind of institution</td>
 
<td>
 
string, one of:<br />
 
college<br />
 
academic<br />
 
admin<br />
 
nonacademic<br />
 
mrc<br />
 
library<br />
 
museum<br />
 
lecture</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
prefix</td>
 
<td>
 
the name prefix</td>
 
<td>
 
string</td>
 
<td>
 
for example, &#39;Department of&#39;, &#39;Centre for&#39;</td>
 
</tr>
 
<tr>
 
<td>
 
name</td>
 
<td>
 
the substantive part of the institution name</td>
 
<td>
 
string</td>
 
<td>
 
for example, &#39;Geography&#39;. This is the field to sort on for alphabetically ordered institutions</td>
 
</tr>
 
<tr>
 
<td>
 
suffix</td>
 
<td>
 
the name suffix</td>
 
<td>
 
string</td>
 
<td>
 
often an acronym or former name, which would often be presented in parentheses. For example, when name is &#39;Advanced Photonics and Electronics&#39;, prefix is &#39;Centre for &#39; and&nbsp;suffix would be &#39;CAPE&#39;. The whole might be presented as &#39;Advanced Photonics and Electronics (CAPE), Centre for&#39; or &#39;Centre for Advanced Photonics and Electronics (CAPE)&#39;</td>
 
</tr>
 
<tr>
 
<td>
 
parent*</td>
 
<td>
 
when the entity is subsidiary to another, this is the institution code of the parent institution</td>
 
<td>
 
entity</td>
 
<td>
 
for example the faculty of a department</td>
 
</tr>
 
<tr>
 
<td>
 
options</td>
 
<td>
 
arbitrary space separated tokens indicating arbitrary options</td>
 
<td>
 
string</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
sd</td>
 
<td>
 
the subdomain of the entity</td>
 
<td>
 
string</td>
 
<td>
 
e.g. &quot;lucy-cav&quot;</td>
 
</tr>
 
<tr>
 
<td>
 
info</td>
 
<td>
 
contact information (etc)</td>
 
<td>
 
array of objects (see below)</td>
 
<td>
 
<p>
 
for example:</p>
 
<p>
 
&nbsp;&nbsp;"info":&nbsp;[<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"founded",&nbsp;"founded":&nbsp;"1505"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"address",&nbsp;"address":&nbsp;[<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"street",&nbsp;"street":&nbsp;"St&nbsp;Andrew's&nbsp;Street"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"place",&nbsp;"place":&nbsp;"Cambridge"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"postcode",&nbsp;"postcode":&nbsp;"CB2&nbsp;3BU"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{"type":&nbsp;"location",&nbsp;"location":&nbsp;{<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"type":&nbsp;"college",&nbsp;"ref":&nbsp;"CHRISTS",&nbsp;"name":&nbsp;"Christ's&nbsp;College",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"lat":&nbsp;52.206145,&nbsp;"lon":&nbsp;0.122944,&nbsp;"primitive":&nbsp;"w",&nbsp;"id":&nbsp;147488000<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...<br/>
 
&nbsp;&nbsp;]</p>
 
 
<p>Note that all this contact information relates to the entity concerned. Subordinate entities will have their own contact information if relevant.</p>
 
</td>
 
</tr>
 
<tr>
 
<td>
 
sortasvia</td>
 
<td>
 
when result matched via an AKA field (see below) or from a role, the index of the info element which it matched against</td>
 
<td>
 
integer</td>
 
<td>
 
<td></td>
 
</tr>
 
</table>
 
 
 
===Fields common to all geographical objects===
 
 
 
The remainder are all geographical objects and share the following common fields:
 
 
 
<table class="wikitable">
 
<tr>
 
<td>
 
<strong>key</strong></td>
 
<td>
 
<strong>value</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
<strong>notes</strong></td>
 
</tr>
 
<tr>
 
<td>
 
type</td>
 
<td>
 
&nbsp;</td>
 
<td>
 
&nbsp;</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
ref</td>
 
<td>
 
the reference of the entity</td>
 
<td>
 
string</td>
 
<td>
 
e.g. &quot;H/FORVIE&quot;<br />
 
See [[The Database API reference discovery]] for a discussion of reference formats,
 
</td>
 
</tr>
 
<tr>
 
<td>
 
name</td>
 
<td>
 
the name of the entity (assuming it has one)</td>
 
<td>
 
string</td>
 
<td>
 
e.g. &quot;Forvie Site&quot;, &quot;Austin Building&quot;</td>
 
</tr>
 
<tr>
 
<td>
 
lat</td>
 
<td>
 
the latitude of a representative position of the entity</td>
 
<td>
 
float</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
lon</td>
 
<td>
 
the longitude of a representative position of the entity</td>
 
<td>
 
float</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
primitive</td>
 
<td>
 
whether the building was dericved from an OSM way (&quot;w&quot;) or node (&quot;n&quot;)</td>
 
<td>
 
string (either &quot;w&quot; or &quot;n&quot;)</td>
 
<td>
 
primitive and id can be used together to form a link to the OSM browser, as in http://osm.org/browse/way/1234567</td>
 
</tr>
 
<tr>
 
<td>
 
id</td>
 
<td>
 
the OSM id of the node from which the entrance was derived</td>
 
<td>
 
int</td>
 
<td>
 
sites, colleges and buildings are always areas (ways) in OSM<br />
 
&nbsp;</td>
 
</tr>
 
</table>
 
 
 
===site===
 
 
 
<table class="wikitable">
 
<tr>
 
<td>
 
<strong>key</strong></td>
 
<td>
 
<strong>value</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
<strong>notes</strong></td>
 
</tr>
 
<tr>
 
<td>
 
type</td>
 
<td>
 
<strong>site</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
parent*</td>
 
<td>
 
when the site is a sub-site, this is the main site</td>
 
<td>
 
site object</td>
 
<td>
 
for example object for &quot;Cambridge Biomedical Campus&quot; when name is &quot;Forvie Site&quot;</td>
 
</tr>
 
<tr>
 
<td>
 
entrances*</td>
 
<td>
 
to the site</td>
 
<td>
 
array of entrance objects</td>
 
<td>
 
see below</td>
 
</tr>
 
</table>
 
 
 
===college===
 
 
 
<table class="wikitable">
 
<tr>
 
<td>
 
<strong>key</strong></td>
 
<td>
 
<strong>value</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
<strong>notes</strong></td>
 
</tr>
 
<tr>
 
<td>
 
type</td>
 
<td>
 
<strong>college</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
This is the geographical entity for a college site or sub-site, not the institutional information which is an inst. This is very similar to&nbsp;<strong>site</strong>.</td>
 
</tr>
 
<tr>
 
<td>
 
parent*</td>
 
<td>
 
when the college item is a subsidiary site, the main site</td>
 
<td>
 
college object</td>
 
<td>
 
e.g. object for &quot;Magdalene College&quot; when site is ref MAGD/CRIPPS</td>
 
</tr>
 
<tr>
 
<td>
 
entrances*</td>
 
<td>
 
as for site</td>
 
<td>
 
array of entrance objects</td>
 
<td>
 
see below</td>
 
</tr>
 
<tr>
 
<td>
 
institution*</td>
 
<td>
 
the institution information associated with this college area</td>
 
<td>
 
institution object</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
</table>
 
 
 
===building===
 
 
 
<table class="wikitable">
 
<tr>
 
<td>
 
<strong>key</strong></td>
 
<td>
 
<strong>value</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
<strong>notes</strong></td>
 
</tr>
 
<tr>
 
<td>
 
type</td>
 
<td>
 
<strong>building</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
parent*</td>
 
<td>
 
site/college in which the building is situated</td>
 
<td>
 
site/college object</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
entrances*</td>
 
<td>
 
entrances of the building</td>
 
<td>
 
array of entrance objects</td>
 
<td>
 
see below</td>
 
</tr>
 
<tr>
 
<td>
 
occupants*</td>
 
<td>
 
occupants of the building</td>
 
<td>
 
array of institution objects</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
</table>
 
 
 
===entrance===
 
 
 
<table class="wikitable">
 
<tr>
 
<td>
 
<strong>key</strong></td>
 
<td>
 
<strong>value</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
<strong>notes</strong></td>
 
</tr>
 
<tr>
 
<td>
 
type</td>
 
<td>
 
<strong>entrance</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
entrances apply to sites and colleges as well as buildings. Note, entrances are always derived from OSM node entities.</td>
 
</tr>
 
<tr>
 
<td>
 
parents*</td>
 
<td>
 
buildings and/or sites/colleges to which this entrance gives access</td>
 
<td>
 
array of building/site/college objects</td>
 
<td>
 
note that a few entrances give access to university properties on either side; also occasionally an entrance to a building isn&#39;t actually part of the building footprint.</td>
 
</tr>
 
<tr>
 
<td>
 
occupants*</td>
 
<td>
 
  the institutions that gain access by this entrance</td>
 
<td>
 
array of institution objects</td>
 
<td>
 
OK, you don&#39;t exactly &quot;occupy&quot; an entrance, but consistent with buildings</td>
 
</tr>
 
<tr>
 
<td>
 
direction</td>
 
<td>
 
the direction of a normal to the parent building/site/college at an entrance, in degrees between -180 and 180&nbsp;measured anticlockwise from the east (positive x axis) pointing away from the building</td>
 
<td>
 
float</td>
 
<td>
 
the direction can be used to orient an overlaid arrow pointing to the entrance.</td>
 
</tr>
 
<tr>
 
<td>
 
user</td>
 
<td>
 
some or all of the letters &quot;fbvg&quot;</td>
 
<td>
 
string</td>
 
<td>
 
standing for &quot;foot&quot;, &quot;bicycle&quot;, &quot;vehicle&quot; and &quot;goods&quot; respectively, indicating the class or classes of users which can use the entrance.</td>
 
</tr>
 
<tr>
 
<td>
 
door</td>
 
<td>
 
&nbsp;</td>
 
<td>
 
boolean</td>
 
<td>
 
whether this entrance is the door to a building (true) or a gate to a site (false)</td>
 
</tr>
 
</table>
 
 
 
===nonuniversity===
 
 
 
 
 
<table class="wikitable">
 
<tr>
 
<td>
 
<strong>key</strong></td>
 
<td>
 
<strong>value</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
<strong>notes</strong></td>
 
</tr>
 
<tr>
 
<td>
 
type</td>
 
<td>
 
<b>nonuniversity</b></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
role</td>
 
<td>
 
what kind of thing this is</td>
 
<td>
 
string</td>
 
<td>
 
e.g. &quot;hotel&quot;</td>
 
</tr>
 
</table>
 
 
 
===street===
 
 
 
<table class="wikitable">
 
<tr>
 
<td>
 
<strong>key</strong></td>
 
<td>
 
<strong>value</strong></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
<strong>notes</strong></td>
 
</tr>
 
<tr>
 
<td>
 
type</td>
 
<td>
 
<b>street</b></td>
 
<td>
 
&nbsp;</td>
 
<td>
 
no additional fields other than the common ones</td>
 
</tr>
 
</table>
 
 
 
==Contact information==
 
 
 
Contact information for institutions and colleges is grouped into an array of items each of which may be repeated and qualified as necessary. For example, multiple phone numbers with descriptions of what each is for.&nbsp;Note that these all relate to the entity concerned. Subordinate entities will have their own contact information if relevant, so addresses, phone numbers etc. for child institutions should not be given as alternate addresses within the same info array.
 
 
 
<table class="wikitable">
 
<tr>
 
<td>
 
<strong>key</strong></td>
 
<td>
 
<strong>value</strong></td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
person</td>
 
<td>
 
string</td>
 
<td>
 
primary contact named individual, for example &quot;Prof. John Doe&quot;.</td>
 
</tr>
 
<tr>
 
<td>
 
description</td>
 
<td>
 
string</td>
 
<td>
 
A brief description of the function of the institution</td>
 
</tr>
 
<tr>
 
<td>
 
title</td>
 
<td>
 
string</td>
 
<td>
 
primary contact title, for example &quot;The Bursar&quot;, where useful for more personal addressing.</td>
 
</tr>
 
<tr>
 
<td>
 
address</td>
 
<td>
 
array of objects (see below)</td>
 
<td>
 
<p>
 
what the address is for, assumed to be the primary address if not described.</p>
 
</td>
 
</tr>
 
<tr>
 
<td>
 
phone</td>
 
<td>
 
string</td>
 
<td>
 
in the international form +44 1223 33nnnn</td>
 
</tr>
 
<tr>
 
<td>
 
fax</td>
 
<td>
 
string</td>
 
<td>
 
ditto</td>
 
</tr>
 
<tr>
 
<td>
 
email</td>
 
<td>
 
string</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
url</td>
 
<td>
 
string</td>
 
<td>
 
complete, including the http://</td>
 
</tr>
 
<tr>
 
<td>
 
founded</td>
 
<td>
 
int</td>
 
<td>
 
(colleges only) year of foundation</td>
 
</tr>
 
<tr>
 
<td>
 
logo</td>
 
<td>
 
string</td>
 
<td>
 
url of image which is used to brand the institution</td>
 
</tr>
 
<tr>
 
<td>
 
twitter</td>
 
<td>
 
string</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
facebook</td>
 
<td>
 
string</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
AKA</td>
 
<td>
 
string</td>
 
<td>
 
another name or search term by which the institution is known. Unlike other info fields, the value of this info item is (usually) added to the search index.
 
 
 
<p>This may be used in different ways according to the accompanying options. An "xm" option excludes the entry from the paper map (this might be a very old name, for example, which you want search results to hit, but not include in an up-to-date static map). "xw" excludes it from the web site searches and presentation, but includes it in the paper map and other alphabetic listings. "xd" excludes it from presentation (the user doesn't see it), but includes it in the index.</p>
 
 
 
<p>Additionally when a ?q returns a result via a match on an AKA, the top level structure contains 'viaaka', the index of the info element which it matched against. This is so that you can tell the user if you want to why their search matched when it doesn't appear to match the main entry name.</p></td>
 
</tr>
 
<tr>
 
<td>
 
subsection</td>
 
<td>
 
string</td>
 
<td>
 
indicates that all the entries that follow up to a subsection-end entry or another subsection entry or the end of the info array are grouped together. This would typically be used where an institution lists contact details for a well-defined part or function of the institution - for example, the phone, fax and email for the Box Office part of the ADC Theatre. A consumer would typically render the subsection string as a subheading of some kind and possibly indent its contents or separate them out in some suitable way. (note: this supersedes the version 5 method of grouping, where repeated roles indicated subsections, which was rather clumsy and prevented the individual elements having their own roles).</td>
 
</tr>
 
<tr>
 
<td>
 
subsection-end</td>
 
<td>
 
string (unused)</td>
 
<td>
 
explicitly terminates a group of subsection elements.</td>
 
</tr>
 
</table>
 
 
 
===Contact information qualifiers===
 
 
 
Each of these objects contains a type to identify the key, and may also contain other qualifying information, as follows:
 
 
 
<table class="wikitable">
 
<tr>
 
<td>
 
<strong>key</strong></td>
 
<td>
 
<strong>value</strong></td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
type</td>
 
<td>
 
one of the keys listed in the previous table</td>
 
<td>
 
</td>
 
</tr>
 
<tr>
 
<td>
 
role</td>
 
<td>
 
string</td>
 
<td>
 
description of what the contact information will be used for. If omitted, assumed to be the primary contact information of this type. For URLs this would typically be used for the link text rather than displaying the URL itself. For others it would serve as a caption.&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
options</td>
 
<td>
 
string</td>
 
<td>
 
arbitrary space separated string of options (meanings client dependent)</td>
 
</tr>
 
</table>
 
 
 
===Addresses===
 
 
 
Addresses are further subdivided so that they can be presented linearly, in &quot;label&quot; form or as a VCARD etc, by combining the elements with suitable punctuation and markup, and also cross-linked where appropriate - for example the <strong>street</strong>&nbsp;element could be linked with the URL <strong><nowiki>http://www.cam.ac.uk/</nowiki><em>streetname</em></strong> to jump to the map for the street name. These should be used in order when presenting an address.
 
 
 
Addresses may also be associated with geographical locations (sites, colleges and buildings) and their entrances. This supersedes the amorphous list of locations and entrances provided in version 5. An address may be
 
<ul>
 
<li>just a postal address for correspondence, in which no location or entrances will be included in the address data</li>
 
<li>a postal address with a corresponding location on the ground (possibly with entrances)</li>
 
<li>just a location (and possibly its entrances), where the intention is to show the location on a map, but to direct post to a central address in a second address element, or occasionally that a postal address is not available for the location.</li>
 
</ul>
 
 
 
Each element contains a <strong>type</strong> field whose value is one of the keys in the following table, and then a key/value pair according to the type, as follows:
 
 
 
<table class="wikitable">
 
<tr>
 
<td>
 
<strong>key</strong></td>
 
<td>
 
<strong>value</strong></td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
location</td>
 
<td>
 
int</td>
 
<td>
 
a number indicating that this address refers to the corresponding location in the list of locations. Not all addresses need refer to a location (e.g. a PO Box), and not all locations need have a corresponding address. But when they do, the correspondence may be used to disambiguate locations occupied by the institution. Numbering starts at 1, not zero!</td>
 
</tr>
 
<tr>
 
<td>
 
maildrop</td>
 
<td>
 
string</td>
 
<td>
 
for parts of an address such as a room number or a PO Box number</td>
 
</tr>
 
<tr>
 
<td>
 
building</td>
 
<td>
 
string</td>
 
<td>
 
name of building</td>
 
</tr>
 
<tr>
 
<td>
 
number</td>
 
<td>
 
string</td>
 
<td>
 
location on a street, e.g. &quot;42a&quot;</td>
 
</tr>
 
<tr>
 
<td>
 
site</td>
 
<td>
 
string</td>
 
<td>
 
e.g. &quot;Lords Bridge&quot;, &quot;New Museums Site&quot;</td>
 
</tr>
 
<tr>
 
<td>
 
street</td>
 
<td>
 
string</td>
 
<td>
 
e.g. &quot;Downing Place&quot;</td>
 
</tr>
 
<tr>
 
<td>
 
street2</td>
 
<td>
 
string</td>
 
<td>
 
occasionally a second street is part of the address</td>
 
</tr>
 
<tr>
 
<td>
 
smallplace</td>
 
<td>
 
string</td>
 
<td>
 
where place is a local village</td>
 
</tr>
 
<tr>
 
<td>
 
place</td>
 
<td>
 
string</td>
 
<td>
 
usually &quot;Cambridge&quot;</td>
 
</tr>
 
<tr>
 
<td>
 
county</td>
 
<td>
 
string</td>
 
<td>
 
rarely needed</td>
 
</tr>
 
<tr>
 
<td>
 
postcode</td>
 
<td>
 
string</td>
 
<td>
 
&nbsp;</td>
 
</tr>
 
<tr>
 
<td>
 
location</td>
 
<td>
 
location object</td>
 
<td>
 
see above. This is an excerpted location object. There will only be at most one location object per address.</td>
 
</tr>
 
<tr>
 
<td>
 
entrance</td>
 
<td>
 
entrance object</td>
 
<td>
 
see above. This is an excerpted entrance object. There may be multiple address elements per addreess, but there will never be an entrance object in an address if there is no location object preceding it for the same address. Conversely, location elements do not have any entrance elements.</td>
 
</tr>
 
</table>
 
 
 
Some examples:
 
<ul>
 
<li>
 
Hamilton Kerr Institute:<br />
 
[ {&quot;type&quot;: &quot;street&quot;, &quot;street&quot;: &quot;Mill Lane&quot;},<br/>&nbsp;{&quot;type&quot;: &quot;smallplace&quot;, &quot;smallplace&quot;: &quot;Whittlesford&quot;},<br/>&nbsp;{&quot;type&quot;: &quot;place&quot;, &quot;place&quot;: &quot;Cambridge&quot;},<br/>&nbsp;{&quot;type&quot;: &quot;postcode&quot;, &quot;postcode&quot;: &quot;CB22 4NE&quot;}&nbsp;]</li>
 
<li>
 
Division of Anaesthesia<br />
 
[<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"maildrop",&nbsp;"maildrop":&nbsp;"Box&nbsp;93"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"maildrop",&nbsp;"maildrop":&nbsp;"Level&nbsp;4"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"site",&nbsp;"site":&nbsp;"Addenbrooke's&nbsp;Hospital"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"street",&nbsp;"street":&nbsp;"Hills&nbsp;Road"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"place",&nbsp;"place":&nbsp;"Cambridge"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"postcode",&nbsp;"postcode":&nbsp;"CB2&nbsp;2QQ"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"location",&nbsp;"location":&nbsp;{<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"type":&nbsp;"building",&nbsp;"ref":&nbsp;"H132",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"lat":&nbsp;52.17525,&nbsp;"lon":&nbsp;0.141464,&nbsp;"id":&nbsp;1643255315&nbsp;}<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"entrance",&nbsp;"entrance":&nbsp;{<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"type":&nbsp;"entrance",&nbsp;"ref":&nbsp;"H131-A",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"name":&nbsp;"Addenbrooke's&nbsp;Hospital&nbsp;Main&nbsp;Entrance",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"lat":&nbsp;52.175206,&nbsp;"lon":&nbsp;0.140538,<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"direction":&nbsp;104,&nbsp;"user":&nbsp;"f",&nbsp;"primitive":&nbsp;"n",&nbsp;"id":&nbsp;1643254795,&nbsp;<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"entrance":&nbsp;"main",&nbsp;"door":&nbsp;true&nbsp;}<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"type":&nbsp;"entrance",&nbsp;"entrance":&nbsp;{<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"type":&nbsp;"entrance","ref":&nbsp;"H-A",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"lat":&nbsp;52.176241,&nbsp;"lon":&nbsp;0.144354,<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"direction":&nbsp;15,&nbsp;"user":&nbsp;"fbv",&nbsp;"primitive":&nbsp;"n",&nbsp;"id":&nbsp;664530277,<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"entrance":&nbsp;"main",&nbsp;"door":&nbsp;false<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},<br/>
 
&nbsp;&nbsp;...<br/>
 
]</li>
 
</ul>
 
 
 
Here is a complete example record (for the Department of Anglo-Saxon, Norse and Celtic). Remember that all result records will be presented in an array, even if there is only one of them.
 
 
 
&nbsp;&nbsp;{<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;"type":&nbsp;"institution",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;"inst":&nbsp;"asnc",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;"prefix":&nbsp;"Department&nbsp;of",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;"name":&nbsp;"Anglo-Saxon,&nbsp;Norse&nbsp;and&nbsp;Celtic",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;"sd":&nbsp;"asnc",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;"role":&nbsp;"academic",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;"info":&nbsp;[<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"address",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"address":&nbsp;[<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"number",&nbsp;"number":&nbsp;"9"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"street",&nbsp;"street":&nbsp;"West&nbsp;Road"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"place",&nbsp;"place":&nbsp;"Cambridge"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"postcode",&nbsp;"postcode":&nbsp;"CB3&nbsp;9DP"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"location",&nbsp;"location":&nbsp;{<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"type":&nbsp;"building",&nbsp;"ref":&nbsp;"S040",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"name":&nbsp;"Faculty&nbsp;of&nbsp;English",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"lat":&nbsp;52.20246,&nbsp;"lon":&nbsp;0.108541,&nbsp;"id":&nbsp;26378099&nbsp;}<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"entrance",&nbsp;"entrance":&nbsp;{<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"type":&nbsp;"entrance",&nbsp;"ref":&nbsp;"S040-A",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"lat":&nbsp;52.202422,&nbsp;"lon":&nbsp;0.108616,&nbsp;"direction":&nbsp;-169,<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"user":&nbsp;"f",&nbsp;"primitive":&nbsp;"n",&nbsp;"id":&nbsp;1487638771,<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"entrance":&nbsp;"main",&nbsp;"door":&nbsp;true&nbsp;}<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"entrance",&nbsp;"entrance":&nbsp;{<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"type":&nbsp;"entrance",&nbsp;"ref":&nbsp;"S-C",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"lat":&nbsp;52.202752,&nbsp;"lon":&nbsp;0.108839,&nbsp;"direction":&nbsp;94,<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"user":&nbsp;"fb",&nbsp;"primitive":&nbsp;"n",&nbsp;"id":&nbsp;961417125,<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"entrance":&nbsp;"main",&nbsp;"door":&nbsp;false<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"entrance",&nbsp;"entrance":&nbsp;{<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"type":&nbsp;"entrance",&nbsp;"ref":&nbsp;"S-E",<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"lat":&nbsp;52.202702,&nbsp;"lon":&nbsp;0.108056,&nbsp;"direction":&nbsp;94,<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"user":&nbsp;"fbv",&nbsp;"primitive":&nbsp;"n",&nbsp;"id":&nbsp;961417126,<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"entrance":&nbsp;"main",&nbsp;"door":&nbsp;false&nbsp;}<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"phone",&nbsp;"phone":&nbsp;"+44&nbsp;1223&nbsp;335079"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"fax",&nbsp;"fax":&nbsp;"+44&nbsp;1223&nbsp;335092"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"email",&nbsp;"email":&nbsp;"asnc@hermes.cam.ac.uk"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"url",&nbsp;"url":&nbsp;"http:\/\/www.asnc.cam.ac.uk\/"&nbsp;},<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"type":&nbsp;"url",&nbsp;"url":&nbsp;"http:\/\/www.asnc.cam.ac.uk\/people\/index.htm",&nbsp;"role":&nbsp;"Contacts"&nbsp;}<br/>
 
&nbsp;&nbsp;&nbsp;&nbsp;]<br/>
 
&nbsp;&nbsp;}<br/>
 
 
 
==Coordinates==
 
 
 
There are very few real-world coordinates in the database (it doesn't, for example, include building outlines). But this information is available from the OSM API by reference to the OSM id in the 'id' field of all geographic entities.
 
 
 
For building outlines, the OSM API supports:
 
 
 
  http://osm.org/api/0.6/way/<ID>
 
  http://osm.org/api/0.6/way/<ID>/full
 
  http://osm.org/api/0.6/way/<ID>/relations
 
 
 
Note however that a building doesn't have to be just a single closed way, since it can have have holes in the area. These are handled as OSM "[http://wiki.openstreetmap.org/wiki/Relation:multipolygon multipolygons]". In essence, there is an outer way plus a number of inner ways
 
 
 
For example, Churchill West Court (ref CHU016, http://map.cam.ac.uk/v6.json?ref=CHU016&debug=1). The Map API tells you it is a way with id 148247888 and you can plug it into the OSM API thus
 
 
 
  http://www.openstreetmap.org/api/0.6/way/148247888/full
 
 
 
returning
 
 
 
<pre><nowiki>
 
<osm version="0.6" generator="OpenStreetMap server">
 
<node id="1613469175" lat="52.2128314" lon="0.1013427" version="1" changeset="10553242" user="davidearl" uid="3582" visible="true" timestamp="2012-01-31T20:37:02Z"/>
 
<node id="1613469065" lat="52.2127198" lon="0.101803" version="1" changeset="10553242" user="davidearl" uid="3582" visible="true" timestamp="2012-01-31T20:36:58Z"/>
 
...
 
<nd ref="1613469175"/>
 
<nd ref="1613469065"/>
 
...
 
<tag k="amenity" v="university"/>
 
<tag k="building" v="yes"/>
 
<tag k="name" v="West Court"/>
 
<tag k="operator" v="Churchill College (University of Cambridge)"/>
 
<tag k="ref" v="CHU016"/>
 
</way>
 
</osm>
 
</nowiki></pre>
 
 
 
and http://www.openstreetmap.org/api/0.6/way/148247888/relations gets
 
 
 
<pre><nowiki>
 
<osm version="0.6" generator="OpenStreetMap server">
 
<relation id="1999559" visible="true" timestamp="2012-01-31T20:40:32Z" version="1" changeset="10553242" user="davidearl" uid="3582">
 
<member type="way" ref="148247888" role="outer"/>
 
<member type="way" ref="148248147" role="inner"/>
 
<tag k="type" v="multipolygon"/>
 
</relation>
 
</osm>
 
</nowiki></pre>
 
 
 
telling you it is a multipolygon outer, and giving the info to traverse to the inner as above.
 

Latest revision as of 15:37, 20 February 2013

(This page is no longer in use - version 6 is now live and documented here).