Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #30 from c-martinez/readme
Browse files Browse the repository at this point in the history
Readme
  • Loading branch information
CunliangGeng authored Jun 3, 2020
2 parents fc185f1 + f4fb601 commit e7b1a17
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 78 deletions.
129 changes: 55 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,34 @@
[![Coverage Status](https://coveralls.io/repos/github/c-martinez/FAIRDataPoint/badge.svg?branch=dev)](https://coveralls.io/github/c-martinez/FAIRDataPoint?branch=dev)


### FAIR Data Point (FDP)
# FAIR Data Point (FDP)

Python implementation of FAIR Data Point.

FDP is a RESTful web service that enables data owners to describe and to expose their datasets (metadata) as well as data users to discover more information about available datasets according to the [FAIR Data Guiding Principles](http://www.force11.org/group/fairgroup/fairprinciples). In particular, FDP addresses the findability or discoverability of data by providing machine-readable descriptions (metadata) at four hierarchical levels:

*FDP->catalogs->datasets->distributions*

FDP software specification can be found [here](https://dtl-fair.atlassian.net/wiki/spaces/FDP/pages/6127622/FAIR+Data+Point+Software+Specification).
FDP software specification can be found [here](https://github.com/FAIRDataTeam/FAIRDataPoint-Spec/blob/master/spec.md)

FDP has been implemented in:
* [Python](https://github.com/NLeSC/ODEX-FAIRDataPoint/)
* [Python](https://github.com/NLeSC/FAIRDataPoint/)
* [Java](https://github.com/DTL-FAIRData/FAIRDataPoint)

## Installation
------------

To install fdp, do:
To install FDP, do

```bash
git clone https://github.com/NLeSC/ODEX-FAIRDataPoint.git
cd ODEX-FAIRDataPoint
git clone https://github.com/NLeSC/fairdatapoint.git
cd fairdatapoint
pip install .
```
TODO: register on pypi and change this to `pip install fairdatapoint`
TODO: update it when there is a release on pypi

## Running
```bash
fdp-run samples/plant_breeding_group.ttl
fdp-run localhost 8080
```

Then visit from your browser: http://localhost:8080/
Expand All @@ -40,104 +39,86 @@ Then visit from your browser: http://localhost:8080/
Run tests (including coverage) with:

```bash
python setup.py test
pip install .[tests]
pytest
```

TODO: Include a link to your project's full documentation here.

## Contributing

If you want to contribute to the development of FAIR Data Point,
have a look at the [contribution guidelines](CONTRIBUTING.rst).

## License

Copyright (c) 2019,

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

## Deploy with Docker
TODO: update docker deployment

`docker run -p 8080:8080 -d nlesc/odex-fairdatapoint`

## Deploy without Docker
TODO: update this section

Clone this repo.

Download the `docker-compose.prod.yml` from this repo, change the `HOSTNAME` in the file to a proper host, and then run the command
```
git clone https://github.com/NLeSC/ODEX-FAIRDataPoint.git
cd ODEX-FAIRDataPoint/fdp-api/python
docker-compose -f docker-compose.prod.yml up -d
```

Install FDP into ENV.
## Deploy without Docker

Before deploying FDP, it's necessary to first have a running SPARQL database.

```
python -m venv ENV
source /ENV/bin/activate
git clone https://github.com/NLeSC/fairdatapoint.git
cd fairdatapoint
pip install .
make install
# make clean # removes files from doc dir (except swagger.json)
# fdp-run <host> <port> --db=<sparql-endpoint>
fdp example.com 8080 --db='http://dbpedia.org/sparql'
```

Edit metadata in `config.ini`.
## Web API documentation

```
# in development
make serve-dev # with default HOST=127.0.0.1:8080
make test
# in production
make -e serve-prod HOST=example.com
```
FAIR Data Point (FDP) exposes the following endpoints (URL paths):

**Web API documentation**
| Endpoint | GET | POST | DELETE |
|--------------|:--------------:|:-----------------:|:--------------:|
| fdp | Output metadata triples | Remove existing triples for a specific ID, then create new triples with the request data | Not Allowed |
| catalog/ | Output all IDs | Remove existing triples for a specific ID, then create new triples with the request data | Remove all IDs |
| dataset/ | Output all IDs | Remove existing triples for a specific ID, then create new triples with the request data | Remove all IDs |
| distribution/ | Output all IDs | Remove existing triples for a specific ID, then create new triples with the request data | Remove all IDs |
| catalog/\<catalogID\> | Output metadata triples | Not Allowed | Remove the specific ID |
| dataset/\<datasetID\> | Output metadata triples | Not Allowed | Remove the specific ID |
| distribution/\<distributionID\> | Output metadata triples | Not Allowed | Remove the specific ID |

Base URL: `http://127.0.0.1:8080`

**Access endpoints to request metadata programmatically**
### Access endpoints to request metadata programmatically

FDP: `curl -iH 'Accept: text/turtle' [BASE URL]/fdp`

Catalog: `curl -iH 'Accept: text/turtle' [BASE URL]/catalog/catalog-01`
Catalog: `curl -iH 'Accept: text/turtle' [BASE URL]/catalog/catalog01`

Dataset: `curl -iH 'Accept: text/turtle' [BASE URL]/dataset/breedb`
Dataset: `curl -iH 'Accept: text/turtle' [BASE URL]/dataset/dataset01`

Distribution: `curl -iH 'Accept: text/turtle' [BASE URL]/distribution/breedb-sparql`
Distribution: `curl -iH 'Accept: text/turtle' [BASE URL]/distribution/dist01`

Note: FDP supports the following RDF serializations (MIME-types):
### FDP supports the following RDF serializations (MIME-types):
* Turtle: `text/turtle`
* N-Triples: `application/n-triples`
* N3: `text/n3`
* RDF/XML: `application/rdf+xml`
* JSON-LD: `application/ld+json`


## FAIR Data Point specification
## Contributing

If you want to contribute to the development of FAIR Data Point,
have a look at the [contribution guidelines](CONTRIBUTING.rst).

## License

FAIR Data Point (FDP) exposes the following endpoints (URL paths):
Copyright (c) 2019,

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

| Endpoints | Description |
| -- | -- |
| [ /, /doc, /doc/ ] | Redirects to the API documentation |
| /fdp | Returns FDP metadata |
| /catalog/{catalogID} | Returns catalog metadata (default: catalog-01) |
| /dataset/{datasetID} | Returns dataset metadata (default: breedb) |
| /distribution/{distributionID} | Returns distribution metadata (default: breedb-sparql) |

This services makes use of:
- [Data Catalog Vocabulary](http://www.w3.org/TR/vocab-dcat/)
- [Dublin Core Metadata Terms](http://dublincore.org/documents/dcmi-terms/)
- [DBpedia](http://dbpedia.org/resource/)
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

## Credits

Expand Down
17 changes: 17 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'
services:
fdp:
build: .
image: ""
command: fdp-run HOSTNAME 8080 --db http://db:8890/sparql
ports:
- "8080:8080"
depends_on:
- db
db:
image: "tenforce/virtuoso"
ports:
- "8890:8890"
- "1111:1111"
environment:
SPARQL_UPDATE: "true"
4 changes: 0 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
[metadata]
description-file = README.rst

[aliases]
# Define `python setup.py test`
test=pytest

[coverage:run]
branch = True
source = fdp
Expand Down

0 comments on commit e7b1a17

Please sign in to comment.