Skip to content

Latest commit

 

History

History
 
 

api

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

The GeoDCAT-AP API (GeoDCAT-API)

This API is a proof-of-concept of the implementation of GeoDCAT-AP in an OGC CSW (Catalog Service for the Web), re-using the standard CSW interface, and supporting in addition HTTP content negotiation.

More precisely, GeoDCAT-API uses the standard CSW parameters outputSchema and outputFormat to determine, respectively, (a) the GeoDCAT-AP profile to be used (core or extended), and (b) the RDF serialisation to be returned.

The document containing the ISO 19139 records to be transformed is specified by a GeoDCAT-API-specific parameter src, which is not part of the CSW interface.

The API uses the GeoDCAT-AP XSLT to transform ISO 19139 records into GeoDCAT-AP. As such, the API works both on static files including the records, and on the CSW output of a GetRecords or GetRecordById request.

A working demo of GeoDCAT-API is available at:

http://geodcat-ap.semic.eu/api/

API specification

Supported HTTP methods

The current version of GeoDCAT-API supports only the HTTP GET method. As a consequence, it can be used only on CSWs supporting GET requests.

API parameters

Request

Parameter Description Possible values Default value Notes
ouputSchema The GeoDCAT-AP profile to be used for the transformation core(DCAT-AP) core

If this parameter is omitted, the API uses the "core" profile as default.

The "core" profile is labelled "DCAT-AP", since it returns just the metadata elements supported in DCAT-AP.

NB: The current values of this parameter are provisional, and they are meant to be replaced by the official namespace URIs of DCAT-AP and GeoDCAT-AP, when available.

extended(GeoDCAT-AP)
outputFormat The RDF serialisation to be returned application/rdf+xml(RDF/XML) N/A If this parameter is omitted, the returned RDF serialisation is determined via HTTP content negotiation
text/turtle(Turtle)
text/n3(Notation 3)
application/n-triples(N-Triples)
application/ld+json(JSON-LD)
text/html(HTML+RDFa)
src The URL of the resource containing the ISO 19139 records to be tranformed A URL N/A

Response

Besides the resulting RDF serialisation of the source ISO 19139 records, the API returns a set of HTTP Link headers, and the corresponding HTML LINK elements in the HTML+RDFa serialisation.

Relation type Type Title Target URI
derivedfrom application/xml ISO 19139 The URL of the source document, containing the ISO 19139 records.
profile The media type of the document returned by the API. DCAT-AP core
GeoDCAT-AP extended
self The media type of the document returned by the API. The name of the returned RDF serialisation. The URL of the document returned by the API.
alternate The media types of the alternative RDF serialisations supported by the API. The name of the relevant RDF serialisation. The URL of the document, encoded with the relevant RDF serialisation, as would be returned by the API.

Implementation details

GeoDCAT-API is implemented in PHP5, and runs on top of an Apache 2 HTTP server.

The EasyRDF and the ML/JSON-LD PHP libraries are used to generate the supported RDF serialisations. The HTML+RDFa serialisation is generated by using the DCAT-AP in HTML+RDFa XSLT.

Installation instructions

GeoDCAT-API has been tested on both Linux and Windows, with Apache 2 and PHP 5.3.2 (or later) installed and running.

NB: GeoDCAT-API makes use of the PHP XSL extension.

The repository includes all what is necessary, with the exception of EasyRDF and ML/JSON-LD, that must be installed separately by using Composer.

More precisely:

You will now be able to run the API from a Web folder.

Docker setup

Prerequisite

  • Docker (Or Docker Desktop for docker-compose)

Setup - docker-compose (Requires Docker Desktop)

  1. Navigate into api folder in your terminal.
  2. Run docker-compose up.
  3. Open the browser and navigate to http://localhost.

Setup - dockerfile

  1. Navigate into api folder in your terminal.
  2. Build a docker image with the following command docker build ..
  3. Start a container with the built image with the following command docker run -p 80:80 IMAGE_ID
    • You can find the IMAGE_ID by running docker images.
  4. Open the browser and navigate to http://localhost.