Data API

This page is designed to give developers a quick start guide to accessing and using the GBPN Linked Open Data (LOD). There are some short introductions included in case you're not familiar with the RDF data model, SPARQL and linked data.

Data model and format

Data model: 

The data model (and format) of the data is RDF (Resource Description Framework).
If you're not familiar with RDF you might want to check out this short introduction before you continue reading.

Our data is available in N3 and RDF/XML, two popular serialization formats of RDF.

Further links

Datasets

Datasets: 

The tables below shows a breakdown of the main resource types:

DataSet

URI: http://gbpn.org/mrv-data/DataSet

Type qb:DataSet Represents the collection of the observations, conforming to some common dimensional structure.
Properties dct:title The name of the dataset
rdfs:label The name of the dataset
dct:description A short description of the dataset
rdfs:comment A short description of the dataset
dct:publisher The publisher of the dataset
dct:subject Terms that describes the dataset
qb:stucture Indicates the structure to which this data set conforms
dct:license The license for the whole dataset
dct:attributeName The name of the license holder
rdfs:seeAlso Further information about the dataset

Organisation

URI: http://gbpn.org/mrv-data/Organization

Types org:Organization  
foaf:Agent  
Properties rdfs:label The Name of the Organisation
rdfs:seeAlso Further information about the organisation

Observation

URI example: http://gbpn.org/mrv-data/Observation/Observation-1

Type qb:Observation Represents one observation in a given dataset
Properties qb:dataSet Indicates the data set of which this observation is a part.
mrv-schema:year Dimension year
mrv-schema:region Dimension region
mrv-schema:climateZone Dimension climate zone
mrv-schema:urbanizationType Dimension urbanisation type
mrv-schema:publicBuildingsType Dimension public buildings type
mrv-schema:buildingType Dimension building type
mrv-schema:enduse Dimension end use
mrv-schema:scenario Dimension scenario
mrv-schema:buildingVintage Dimension building vintage
mrv-schema:thermalEnergyUse Observation value
sdmx-attribute:unitMeasure The unit of the observation value

Data structure definition

URI: http://gbpn.org/mrv-schema/DataStructureDefinition

Type gb:DataStructureDefinition  
Property qb:component Indicates a component specification which is included in the structure of the dataset.

Dimension component specification

URI example: http://gbpn.org/mrv-schema/RegionComponentSpecification

Type qb:ComponentSpecification  
Property qb:dimension Indicates a ComponentProperty expected on a DataSet which makes explicit that the component is a dimension.

Measure component specification

URI: http://gbpn.org/mrv-schema/ThermalEnergyUseComponentSpecification

Type qb:ComponentSpecification  
Property qb:measure Indicates a ComponentProperty expected on a DataSet which makes explicit that the component is a measure.

Attribute component specification

URI: http://gbpn.org/mrv-schema/UnitMeasureComponentSpecification

Type qb:ComponentSpecification  
Properties qb:attribute Indicates a ComponentProperty expected on a DataSet which makes explicit that the component is a attribute.
qb:componentRequired Indicates whether a component property is required or not
qb:componentAttachment Indicates the level at which the component property should be attached. In this case on qb:DataSet

Dimensions

URI example: http://gbpn.org/mrv-schema/region

Types qb:DimensionProperty  
qb:CodedProperty  
Properties rdfs:range The range of the dimension.
qb:codeList Gives the code list associated with a CodedProperty.

Dimension of year

URI: http://gbpn.org/mrv-schema/year

Type qb:DimensionProperty  
Properties rdfs:label Value of the year
rdfs:subPropertyOf sdmx-dimension:refPeriod
rdfs:range Interval of one year
qb:concept sdmx-concept:refPeriod

Measure

URI: http://gbpn.org/mrv-schema/thermalEnergyUse

Type qb:MeasureProperty  
Properties rdfs:label Name of  the measure
rdfs:subPropertyOf sdmx-measure:obsValue
rdfs:range A real number

Dimension definitions

URI example: http://gbpn.org/mrv-thes/region

Type skos:ConceptScheme  
Properties rdfs:label Name of the dimension
skos:hasTopConcept List of all instances of the dimension

Dimension instances

URI example: http://gbpn.org/mrv-thes/region/AFR

Type skos:Concept  
Properties skos:inScheme Is part of the dimension
skos:prefLabel Name of the instance

Range definitions

URI example: http://gbpn.org/mrv-schema/Region

Types rdf:type  
owl:Class  
Properties rdfs:subClassOf skos:Concept
rdfs:label Name of the range
rdfs:seeAlso Further information

Schemas

One of the key concepts of the semantic web is to re-use existing vocabularies, ontologies and schemas or to extend them to make data more compatible and connectable.

Therefore, we use popular RDF schemas for the instance attributes where applicable:

Prefix Name Description
gb Data Cube for describing the whole dataset
dct Dublin Core for generic metadata like title, description, etc.
org Core organization ontology for describing the organsization
foaf FOAF (friend of a friend) for describing the organsization
skos SKOS (Simple Knowledge Organisation System) for describing the dimensions
sdmx-attribute SDMX (Content Oriented Guidelines) for describing the unit measure
sdmx-dimension SDMX (Content Oriented Guidelines) for describing the year dimension
sdmx-concept SDMX (Content Oriented Guidelines) for describing the year dimension
sdmx-measure SDMX (Content Oriented Guidelines) for describing the measure

 

Data access

Data access: 

There are two possibilities to access the data:

  • As Linked Open Data
  • Via the public SPARQL endpoint

Linked Open Data

Linked Open Data is a way of publishing data so it can be accessed using a RESTful interface.

If you take the URI of any resource, append it either with .rdf or .n3 and perform an HTTP GET you will receive an RDF document containing all the data about that resource.

For example, if you take the URI of an observation:
http://gbpn.org/mrv-data/Observation/Observation-1

you get the HTML page by entering the URI into a web browser (with or without .htm at the end):
http://gbpn.org/mrv-data/Observation/Observation-1.htm

and you get the raw RDF data by putting .rdf at the end:
http://gbpn.org/mrv-data/Observation/Observation-1.rdf

Once you retrieved the RDF data, you want to access it in a comfortable way.
There are a couple of good libraries out there for parsing and processing RDF data in different programming languages:

Java

C#

PHP

C

Python

SPARQL Endpoint

SPARQL is the standardized query language and protocol for querying RDF databases. If you're not familiar with SPARQL, check out this introduction.

The SPARQL endpoint is available here:
http://virtuoso.gbpn.org/sparql

SPARQL query editor