URI policy test

URI types in Euskadi.eus

Euskadi.eus has normalized several URI types all them following the pattern:


Spanish NTI-like URIs

NTI stands for "Norma Técnica de Interoperabilidad" (Interop Technical Norm):


  • {Sector}: one of the sectors provided by the NTI (e.g. environment).
  • {Domain}: the realm to which the resource belongs, defined by Open Data Euskadi (e.g. air-quality).
  • {ClassName}: the name of the class to which this resource belongs.
  • {Identifier}: a unique identifier, generated from the original data.

Example: http://id.euskadi.eus/public-sector/government/GovernmentalAdministrativeRegion/euskadi

ELI: European Legislation Identifier

Legislation resources can roughly be defined in three levels:

  • Legislation Resource: /eli/{jurisdiction}/{type}/{year}/{month}/{day}/{naturalidentifier}
  • Version: /{version}/{pointintime}/{language}
  • Format: {format}


  • {jurisdiction}: the territory
  • {type}: the legislation type (e.g.; law)
  • {year}/{month}/{day}: yyyy/mm/dd
  • {naturalIdentifier}
  • {version}
  • {pointintime}
  • {language}: i.e. "eus" for basque, "spa" for spanish

so URIs can be like:

  • Legislation resouce: http://id.euskadi.eus/eli/{jurisdiction}/{type}/{year}/{month}/{day}/{naturalidentifier}
  • Version: http://id.euskadi.eus/eli/{jurisdiction}/{type}/{year}/{month}/{day}/{naturalidentifier}/{version}/{pointintime}/{language}/
  • Format: http://id.euskadi.eus/eli/{jurisdiction}/{type}/{year}/{month}/{day}/{naturalidentifier}/{version}/{pointintime}/{language}/{format}



DataSet distribution:


Named graph:


Content negotiation: resource URIs and their representation

In general, a distinction is made between [resource URIs] and their [representation]:

  • A [resource URI] uniquely designates a resource and it's allways like: http://id.euskadi.eus/{resource}
  • A [representation URL] is an URL for a one of the multiple resource's representation, be it RDF, HTML, JSON, etc.

A [resource]'s [representation] can be accessed by two means:

  • Using the [resource URI] + content negotiation, that's http://id.euskadi.eus/{resource} + content negotication
  • Using the [resource]'s [representation URL]: usually http://data.euskadi.eus/{resource} + content negotiation or http://doc.euskadi.eus/{resource} if the requested content type is HTML

How each of the above URIs is handled is explained bellow. The [URI]s can be grouped in:

  • [resources] that CAN have a WEB [representation] (i.e.: can have an associated web page):
    • Spanish NTI-like URIs
    • ELI: European Legislation Identifier
    • Datasets
  • [resources] that DO NOT have a WEB [representation]:
    • Dataset distributions
    • Graphs
  • Other URIs

The URI is handled differently whether the requested MIME is HTML or RDF (or turtle, or whatever):

  • If the requested MIME is HTML, the URI can belong to a [resource] that has an associated web page. In order to guess if the [resource] has an associated web page, the system (the uri handler) queries the [triple-store] to check the main-entity-of-page attribute:
    • If main-entity-of-page exists, a CLIENT REDIR to {mainEntityOfPage} is issued.
    • If main-entity-of-page DOES NOT exists, it's an entity that DOES NOT have an associated web page so the [triple-store] data is "painted" in HTML format by ELDA (a module that 'paints' an HTML representation of [triple-store] data): a CLIENT REDIR to http://doc.euskadi.eus/{resource} is issued.
  • If the requested MIME is RDF, the URI is for a [triple-store] data so a CLIENT REDIR to http://data.euskadi.eus/{resource} is issued.

         |                                                  +--------------------------+
         +                                                  | http://idsite/{resource} |
     Resource                                               +-------------+------------+
       URIs                                                               |
         +                             Is main entity                     |
         |                           +---+ of page? +-----+MIME=HTML+-----+-----+MIME=RDF+--------+
         |                           |                                                            |
         |              +------------+-------------+                                              |
         |              |                          |                                              |
         |              |                          |                                              |
         |              |                          |                                              |
     +---------------------------------------------------+[***** CLIENT REDIR ****]+----------------------------------+
         |              |                          |                                              |
                        |                          |                                              |
         |   +----------v--------------+ +---------v---------------+                 +------------v-------------+
         |   |http://docsite/{resource}| |http://website/{resource}|                 |http://datasite/{resource}|
         +   +----------+--------------+ +---------+---------------+                 +------------+-------------+
                        |                          |                                              |
   Representation       |                          |                                              |
       URLs             |                          |                                              |
         +       +------v-------+        +---------v--------+                            +--------v--------+
         |       |              |        |                  |                            |                 |
         |       |     ELDA     |        |        Web       |                            |   Triple+Store  |
         |       |              |        |                  |                            |                 |
         v       +--------------+        +------------------+                            +-----------------+


  • {idsite} = http://id.euskadi.eus
  • {docsite} = http://doc.euskadi.eus
  • {datasite} = http://data.euskadi.eus
  • {website} = http://www.euskadie.eus


URL: http://id.euskadi.eus/public-sector/government/GovernmentalAdministrativeRegion/euskadi
Accept header: html
Expected result: since the [resource] has an associated [web page] (www.euskadi.eus), a CLIENT-REDIR to www.euskadi.eus is issued
CURL: curl -X GET http://id.euskadi.eus/id/public-sector/government/GovernmentalAdministrativeRegion/euskadi \ 
		-H 'accept: application/xhtml+xml' \
Result: euskadi.eus web page


URL: http://id.euskadi.eus/eli/es-pv/l/1979/03/20/(0)/dof
Accept header: html
Expected result: since the [resource] DOES NOT hava an associated [web page] the only option is to render the [triple-store] data as HTML using [ELDA] so a CLIENT-REDIR to http://doc.euskadi.eus/eli/es-pv/l/1979/03/20/(0)/dof is issued.
CURL: curl -X GET http://id.euskadi.eus/eli/es-pv/l/1979/03/20/(0)/dof \ 
		-H 'accept: application/xhtml+xml' \
Result: an [ELDA]-generated web page for the [resource].


URL: http://id.euskadi.eus/public-sector/government/GovernmentalAdministrativeRegion/euskadi
Accept header: rdf
Expected result: a CLIENT-REDIR to the [triple-store] data is issued: http://data.euskadi.eus/public-sector/government/GovernmentalAdministrativeRegion/euskadi and the RDF data is returned.
CURL: curl -X GET http://id.euskadi.eus/public-sector/government/GovernmentalAdministrativeRegion/euskadi \ 
		-H 'accept: application/rdf+xml' \
Result: the [resource] in RDF format.


URL: http://id.euskadi.eus/eli/es-pv/l/1979/03/20/(0)/dof
Accept header: rdf
Expected result: a CLIENT-REDIR to the [triple-store] date is issued: http://data.euskadi.eus/eli/es-pv/l/1979/03/20/(0)/dof
CURL: curl -X GET http://id.euskadi.eus/eli/es-pv/l/1979/03/20/(0)/dof \ 
		-H 'accept: application/rdf+xml' \
Result: the [resource] in RDF format.