The Metadata Catalog provides access to project and product(dataset) metadata. While the metadata may be presented to the user in multple formats, the catalog utilizes the mdJSON format as a datastore. mdJSON records are parsed to provide information about projects and products. HTML and XML metadata may be produced from the mdJSON using the ADIwg mdTranslator. The mdTools application provides an interface for exploring mdJSON and related tools.
- PHP >=5.5.9
- Composer
- SQLite3 (for default config)
- PostgreSQL >=9.4
- Webserver (for production)
The following steps assume you have PostgreSQL 9.4+ installed, and a database and user account created for use with the catalog. See the PostgreSQL download page for installation info.
The Ubuntu community wiki has info on creating databases and users. If you're on Windows try the Bitnami WAPP Stack for an all-in-one install. There's also one for Linux.
From the command line:
- Clone the repo
git clone https://github.com/arcticlcc/metadata-catalog.git
cd metadata-catalog
- Install Composer, if needed. You can install in the project root, or in a location on your path (i.e. $HOME/bin)
- Run
composer install
orcomposer.phar install
- Edit the following files in the config directory:
- Rename or copy the db.example.yml to
db.yml
. Add your PostgreSQL connection info to thepsql
entry. - Rename or copy the whitelist.example.yml to
whitelist.yml
. - Rename or copy the aws.example.yml to
aws.yml
.
- Rename or copy the db.example.yml to
- Create the schema in your database:
bin/console doctrine:schema:create
- Type
bin/console assetic:dump
to build the development environment - Type
composer run
and point your browser to http://localhost:8888 - You should have an empty catalog!
- Import some sample data:
bin/console metadata:import:dbal
The Catalog application is backed by a simple RESTful API. The API interface is described below using the following notation:
- ... : the web root for the catalog
- {required} : a required string
- [optional] : an optional string
- option1 | option2 : pipe(|) separated list of valid values
Returns the homepage(HTML-only)
Returns an array of entities in the desired format
- entity = [project | product]
- format = [json]
Returns the entity homepage displaying a list of entities
- entity = [project | product]
- Note: a request to .../{entity}/ will redirect to .../{entity}/view
Returns a single entity corresponding to the supplied uuid, in the desired format
- entity = [project | product]
- uuid = a valid UUID
- format = [json | xml | html]
Returns a web page for a single entity
- entity = [project | product]
- uuid = a valid UUID
- Note: a request to .../{entity}/{uuid}/ will redirect to .../{entity}/{uuid}/view
Returns an array of related entities in the desired format
- entity1 = [project | product]
- id = a valid UUID for entity1
- entity2 = [project | product]
- format = [json]
- short = boolean [false | true]: if true, will return an array of citations for entity2
Returns a single entity corresponding to the supplied uuid, in the desired format
- uuid = a valid UUID
- format = [json | xml | html]
Returns the entity homepage corresponding to the supplied uuid
- uuid = a valid UUID
Triggers a sync event.
- type = one of:
- [s3] POST body must be a valid AWS S3 SNS Event notification