Menu

Tree [3fd44c] master /
 History

HTTPS access


File Date Author Commit
 README 2014-08-18 Felix Hilgerdenaar Felix Hilgerdenaar [23e283] Initial commit
 collection.example.com.conf 2016-05-12 Dominik Röpert Dominik Röpert [161b07] Added rdf terms to be compatible with CETAF Spe...
 rdf-template.inc.php 2017-02-13 Dominik Röpert Dominik Röpert [3fd44c] fix some attribute spelling issues
 rdf.php 2016-05-12 Dominik Röpert Dominik Röpert [161b07] Added rdf terms to be compatible with CETAF Spe...
 redirection-404.inc.php 2014-08-18 Felix Hilgerdenaar Felix Hilgerdenaar [23e283] Initial commit
 redirection.php 2016-05-12 Dominik Röpert Dominik Röpert [161b07] Added rdf terms to be compatible with CETAF Spe...
 sitemap.php 2016-05-12 Dominik Röpert Dominik Röpert [161b07] Added rdf terms to be compatible with CETAF Spe...

Read Me

-----------------
----- NOTES -----
-----------------

These PHP scripts provide stable identifier redirection for a herbarium
collection according to the advices of the W3C (http://www.w3.org/TR/cooluris/).

An URI is used as a name for a real object, so a client can request an object by
that URI over HTTP to receive the a new URI refering to the metadata about that
object. The following lines explain the communication for short by example:

client request:
  GET http://collection.example.com/object/ID
  Accept:application/rdf+xml
server response:
  303 See Other
  Location: http://collection.example.com/data/rdf/ID
client request:
  GET http://collection.example.com/data/rdf/ID
  Accept:application/rdf+xml
server response:
  200 OK
  ...

Using nginx as web server an incomming request has to be handled by this server.
According to the URI (/data/rdf/ID, /data/page/ID, /object/ID, ...) the web
server calls the correct PHP script which handles the request:

redirection.php: redirection to other URIs
rdf.php: deliver metadata as RDF document

Note that there is no PHP script generating an HTML representation of the
metadata, which is fetched from an MSSQL server from a single table named
'rdf_view' (see section "Database Table Fields" for some details).

Unfortunately the regular expressions used to validate the ID and some URIs for
redirection are hardcoded into the PHP code. In addition there is no central
configuration file.


Addtitional comments
--------------------

dependencies:
  The PHP library 'conneg' (version 2.0.4) is used for content negotiation.
  (HTTP header fields: Accept, Content-Type)
  source: http://ptlis.net/source/php/content-negotiation/#downloads

RDF mapping:
  dwc:Collector replaced by dwc:recordedBy
    http://rs.tdwg.org/dwc/2009-12-07/terms/history/index.htm#Collector-2003-06-13

usage of redirection.php and rdf.php:
  Every request on a URI like /data/rdf/.*
  is passed to rdf.php or redirection.php (no .php appears in the URI).
  See nginx configuration file for details (collection.example.com.conf).

examples commands for a request:
   $ curl -iH "Accept:application/rdf+xml" http://collection.example.com/object/B100000003
   $ curl -iH "Accept:text/html" http://collection.example.com/object/B100000003


Database Table Fields
---------------------
The following fields are used by the PHP scripts:

  HerbariumID
  RdfUri
  ObjectUri
  Title
  TitleDescription
  Collector
  CollectionDate
  ObjectURI
  modified
  BaseOfRecords
  InstitutionCode
  CollectionCode
  CatalogNumber
  ScientificName
  Family
  Genus
  SpecificEpithet
  HigherGeography
  Country
  Locality
  CollectionDate
  Collector
  Image


File Overview (additional comments)
-----------------------------------

rdf.php:
  returns HTTP status code 404 if barcode doesn't exists
  returns 406 in case of wrong content-type: ex. "Accept: text/html"

rdf-template.inc.php:
  very simple template based on RDF data generated by Edinburgh's webservice

redirection.php:
  returns HTTP status code 404 if barcode doesn't exists in DB

redirection-404.inc.php:
  simple 404 error page (barcode not found)

sitemap.php:
  generates a catalog/sitemap of database records
  CMD: $ php sitemap.php > index-test.xml
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.