-
Notifications
You must be signed in to change notification settings - Fork 6
Provider: CouchDB
dcat-ap-viewer can utilize Apache CouchDB as one of the data stores. As of now, the Apache CouchDB can be seen as a cache to SPARQL endpoint. No search or filter capabilities of Apache CouchDB are used. Most of the data are stored under their IRI (datasets, distributions) or under predefined static keys (codelists, publishers, ...).
The couchdb provider allows dcat-ap-viewer to use Apache CouchDB as a data source.
The example bellow configure CouchDB provider to use Apache CouchDB running on localhost. If a user make API request without specifying language a default cs
language is used.
- type: couchdb
url: http://127.0.0.1:5984
default-language: cs
- url - URL of Apache CouchDB endpoint with the name of the core included.
- default-language - Default language to use when user request does not specify any.
- v2-dataset-item
- v2-distribution-item
- v2-keyword-list
- v2-label-item
- v2-init-data
- v2-catalog-list
choudb provider utilize several databases: datasets, distributions, labels, and static. Each database is responsible for providing data to some implemented methods. Purpose and content of each database are described in the following sections.
This database holds information about datasets. A document ID must be equal to the dataset IRI. The content of the document must contain object jsonld with JSON-LD representation of the dataset.
This database provides data for v2-dataset-item method.
Similar to datasets this database provide data for distributions.
This database provides data for v2-distribution-item method.
dcat-ap-viewer use represents entities using their IRI, this includes publishers, formats, etc. However, IRIs are not human friendly. Thus dcat-ap-viewer try to use entities labels instead. This database is responsible for holding labels for the entity labels. Whenever the dcat-ap-viewer encounter an entity without a label it tries to search for label in this database.
Structure of the database is the same as datasets database. As of now, there is no distinction based on language and each entity should thus contain labels for all languages available in dcat-ap-viewer.
This database provides data for v2-label-item method.
Document content example:
{
"_id": "http://eurovoc.europa.eu/1",
"jsonld": [
{
"@id": "http://eurovoc.europa.eu/1",
"@type": [
"http://www.w3.org/2004/02/skos/core#Concept"
],
"http://www.w3.org/2004/02/skos/core#prefLabel": [
{
"@language": "de",
"@value": "Aarhus (Amt)"
}
]
}
]
}
This database is used to store pre-computed views and cache data. Unlike all aforementioned databases, the document's ID has predefined meaning.
dcat-ap-viewer need entity labels to display entities to the user. These can be fetched for example from labels database. Although this approach is functional it may lead to high number of requests as each request can fetch data for only one entity. This excessive traffic would take place, especially after the initial load dcat-ap-viewer page. This issue can be addressed using this initial_data_cache
document as this document is fetched before any other request is made. It is thus advised to store common labels in this document. Same as labels database, labels in all supported languages should be provided. The content of this document must contain object jsonld with JSON-LD.
This document provides data for v2-init-data method.
Content example:
{
"_id": "initial_data_cache",
"jsonld": [
{
"@id": "http://eurovoc.europa.eu/173",
"http://www.w3.org/2004/02/skos/core#prefLabel": [
{
"@value": "kontrola rozpočtu",
"@language": "cs"
},
{
"@value": "budgetary control",
"@language": "en"
}
]
}
]
}
This document contains data for the catalog list view. The content of this document must contain object jsonld with JSON-LD. The JSON-LD should contain information about catalogues.
This document provides data for v2-catalog-list method.
Content example:
{
"_id": "local_catalogs",
"jsonld": [
{
"@id": "https://data.gov.cz/zdroj/lokální-katalogy/248554061",
"@type": "https://data.gov.cz/slovník/nkod/CkanApiLkod",
"http://purl.org/dc/terms/publisher": {
"@id": "https://data.gov.cz/zdroj/ovm/00000000"
},
"http://purl.org/dc/terms/title": {
"@language": "cs",
"@value": "Otevřená data instituce"
},
"http://www.w3.org/ns/dcat#contactPoint": {
"http://xmlns.com/foaf/0.1/email": "[email protected]",
"http://xmlns.com/foaf/0.1/name": "Pepa Novak"
},
"http://www.w3.org/ns/dcat#endpointURL": {
"@id": "https://www.example.com/opendata/package_list"
}
}
]
}
Unlike any other document, the name of this document contains language. The reason is that we need to distinguish between labels from different languages. The document name may thus be keywords_by_publishers_cs
or keywords_by_publishers_en
for cs
or en
respectively.
Data in this document are used for the keywords list view. The content of this document must contain object jsonld with JSON-LD.
This document provides data for v2-keyword-list method.
Content example:
{
"_id": "keywords_by_publishers_cs",
"jsonld": [
{
"@type": [
"urn:Keyword"
],
"http://www.w3.org/2004/02/skos/core#prefLabel": {
"@language": "cs",
"@value": "křižovatky"
},
"urn:usedByPublishersCount": 1
}
]
}