Features, May 2018
The base URI for our resources is
The base URI for our ontology resources is
Resources can be derefenced over HTTP.
Developers are likely to navigate to the base URI of ontology resources (as opposed to the ontology URI) intending to find an OWL document, so we 302 (Found) redirect it to an ontology query endpoint which returns an OWL graph based on this SPARQL query.
We reply 404 (Not Found) to well-formed unknown resource URIs and 400 (Bad Request) to anything else.
The dereference API is implemented purely with XML based declarative policies in Azure API Management (similar to Amazon API Gateway).
Its sole dependency is an endpoint on our query API that determines whether a resource exists using a SPARQL ASK query.
The main consumer of our data service at the moment is Parliament’s new website. It does so via an API which consists of endpoints corresponding to parametrized SPARQL queries.
One might consider these SQL “views” or “stored procedures”.
View the source of pages on beta.parliament.uk to find alternate links pointing to the query API endpoints serving them.
This API is formally described by an OpenAPI document (formerly Swagger).
The query API is implemented as a ASP.NET Web API application (similar to a Spring REST service in Java), running on an Azure App Service (similar to Amazon Elastic Beanstalk). It depends on our SPARQL endpoint.
The query API (as do the others) relies heavily on an open source .NET RDF library: dotnetrdf.
Some of us have contributed to the project with bug reports and pull requests: Improper implementation of default SPARQL prefixes, unexpected datetime coercion in JSON-LD parser, a new SKOS API feature, incorrect implementation of lists in RDF/XML.
Michael and Robert have written extensively about the philosophy behind this approach, fixing search by fixing browse.
The search API exposes a standard OpenSearch interface which facilitates browser and operating system integration.
A comprehensive list of 1000+ search hints (labels extracted from search result URLs by regular expressions) has been compiled but shelved.
The OData API is implemented as as ASP.NET Web API application running in an Azure App Service. It translates OData queries into SPARQL queries (using a mapping layer based on our ontology) and runs them natively agains our SPARQL endpoint.
Jianhan’s blog post gives an overview and technical details about the OData API.
Some sample calls:
- List houses of Parliament
- Count committies
- Get a person by Id
- Show a specific property (projection)
- Navigate to a collection property
- Expand a collection property inline
- Get House details and find the name of the first two committies (ordered by name) in the House of Commons
The image app embeds XMP metadata from the triple-store into the generated images (some of it can be viewed online).
XMP is RDF. Statements include location, license (Dublin Core, CC BY), attribution (IPTC) and linking to the subject of the photo (“This is an Image of something that is a Person”).
An XMP sidecar file endpoint is also available which shows the actual RDF/XML representing the image metadata.
Additional (non-technical) information about the portraits project is available on the blog.
There’s a cool project calculating the average face of a member of Parliament using these images.
The platform is hosted on Microsoft Azure (a cloud hosting service similar to Amazon Web Services).
The APIs applications are ASP.NET Web API applications running on Azure App Services.
All of our infrastructure is code written by the development team. There is no external support or administration. Computing resources are deployed by VSTS (similar to Jenkins and TeamCity). All of our code is integrated continuously (CI) and most of it is deployed continuously (CD).
The architecture for the platform was independently accredited to meet the National Cyber Security Centre’s 14 Cloud Security Principles.
- One class from the ontology visualized in 2D, 3D and in OWL (WebVOWL)
- The ontology resource (2D, 3D, OWL)
- Ontology reconstructed from instance data (2D, 3D, OWL)
- Viewer friendly ontology (2D, 3D, OWL)
- One instance (2D, 3D, OWL)
- One instance with schema (2D, 3D, OWL)
- A shaped query (2D, 3D, OWL)
- A shaped query with schema (2D, 3D, OWL)
- Performance testing our graph database
- Domain model
- Team Twitter account
- Part of Parliament’s controlled vocabulary as a tag hierarchy with D3
- Parliamentary Digital Service blog
Some things we know about constituencies
- All of them, current ones
- Details by id (XML, JSON, Turtle, 2D, 3D, OWL)
Additional area data as well-known text.
- Find by postcode, ONS code (GSS code), name or initial
- What constituency is 51°29'46.1"N 0°07'32.6"W in and and who represents it for which party? (SPARQL)
- Given constituency with the members who represented it inlined
- Chronological list of historical constituencies whose name begins with berwick
- Name of a constituency whose ONS code is E14000554
Directed by Samu Lang