3. Querying OxPoints

The data is stored in an RDF datastore and can be accessed by means of pre-defined query URLs or by constructing more complex queries using SPARQL.

The OxPoints service is located at http://oxpoints.oucs.ox.ac.uk/; all queries should be performed relative to this URL.

Queries are constructed from a path (e.g. /occupies/oucs:oucs/), an optional format extension (e.g. .kml) and an optional set of query parameters (e.g. ?date=1999).

3.1. Query paths

Query paths take one of the following forms:
Returns all the data held within OxPoints.
The canonical URI for an resource controlled by OxPoints. Returns a description of that resource.
Retrieves all entities with the type given by TypeName
Identifier may be an OxPoints ID or one of oucs:code, olis:code, obn:code, finance:code. Multiple identifiers may be separated with a pipe or vertical bar (|).
Returns all x such that x relation Identifier is true. Identifier is as described above.
Returns all x such that Identifier relation x is true. Identifier is as described above.

Relations can be any of most of the predicates used in OxPoints. For example, /title/Keble+College returns all entities called "Keble College". /oucs:linc/occupies returns all places occupied by Lincoln College.

3.2. Query parameters

We've already met the date= parameter. Other parameters are:
Filters results to exclude those that have the given predicate defined.
Extends the filter to take into account indirect properties. For example the location of a room would be inferred to be the same as its containing building.
Adds a function call around the returned data for when one is utilising JSONP with the .js format extension.
Declares the recursion depth when outputting as .json or .js.

3.3. Format extensions

OxPoints can provide data in a number of formats:
  • .xml - RDF/XML (default if format not specified)
  • .n3 - Notation3
  • .nt - N-Triples (a simplified RDF serialization syntax)
  • .json - JavaScript Object Notation
  • .js - Same as .json but adding a callback given by jsCallback (which defaults to "oxpoints")
  • .gpx - GPX waypoints
  • .tomtom - Data suitable for loading into TomTom satellite navigation devices
  • .kml - KML (suitable for use with Google Maps and Google Earth)
  • .txt - Simplified plain text
  • .csv - Comma-separated values

RDF/XML, Notation3 and N-Triples are standard RDF serializations. These and the JSON and JavaScript serializations provide all the available data, whereas the remainder are simplified, omitting various fields.

3.4. Examples

All information about the unit with OUCS code 'kebl' (Keble College), in JSON format
All information about the unit with finance code 'EN' (the Computing Services), in RDF/XML format
All information about the unit with OLIS code 'BOD' (the Bodleian Library), in RDF/XML format
All information about the Holder Building (number 154)
All departments in KML - can be viewed in Google Maps
Exeter, Jesus and Lincoln Colleges, selected using their OUCS codes.
All libraries and museums in Notation3 format.
Everything occupied by either Engineering Science or Biochemistry in Notation3 format.

Up: Contents Previous: 2. What data are stored in OxPoints? Next: 4. SPARQL endpoint