Closed skodapetr closed 3 years ago
The post JSON object should contain field formData
with JSON-LD representation of the dataset.
We need to be able to keep dataset/distribution IRIs. Should there be a need to specify a distribution IRI anoter issue should be created.
@skodapetr Can you provide a sample curl request, or the envisioned workflow? I tried the following with no success:
curl --location --request POST 'https://dev.nkod.opendata.cz/formul%C3%A1%C5%99/' \
--header 'Content-Type: application/json' \
--data-raw '{
"formData": {
"@type": [
"http://www.w3.org/ns/dcat#Dataset",
"https://data.gov.cz/slovník/nkod/typ-datové-sady-dle-zdroje/Formulář"
],
"http://purl.org/dc/terms/title": {
"@language": "cs",
"@value": "Turistické cíle"
},
"http://purl.org/dc/terms/description": {
"@language": "cs",
"@value": "Tato datová sada obsahuje turistické cíle dle Otevřené formální normy turistické cíle (https://ofn.gov.cz/turistické-cíle/)."
},
"http://www.w3.org/ns/dcat#keyword": [
{
"@language": "cs",
"@value": "Turismus"
},
{
"@language": "cs",
"@value": "Cestování"
},
{
"@language": "cs",
"@value": "Turistický cíl"
},
{
"@language": "cs",
"@value": "Volný čas"
}
],
"http://www.w3.org/ns/dcat#distribution": [
{
"@type": [
"http://www.w3.org/ns/dcat#Distribution"
],
"http://www.w3.org/ns/dcat#downloadURL": {
"@id": "http://nesmysl.cz"
},
"http://www.w3.org/ns/dcat#mediaType": {
"@id": "http://www.iana.org/assignments/media-types/application/ld+json"
},
"http://purl.org/dc/terms/format": {
"@id": "http://publications.europa.eu/resource/authority/file-type/JSON_LD"
},
"https://data.gov.cz/slovník/podmínky-užití/specifikace": {
"@type": "https://data.gov.cz/slovník/podmínky-užití/Specifikace",
"https://data.gov.cz/slovník/podmínky-užití/autorské-dílo": {
"@id": "https://data.gov.cz/podmínky-užití/neobsahuje-autorská-díla/"
},
"https://data.gov.cz/slovník/podmínky-užití/databáze-jako-autorské-dílo": {
"@id": "https://data.gov.cz/podmínky-užití/není-autorskoprávně-chráněnou-databází/"
},
"https://data.gov.cz/slovník/podmínky-užití/databáze-chráněná-zvláštními-právy": {
"@id": "https://data.gov.cz/podmínky-užití/není-chráněna-zvláštním-právem-pořizovatele-databáze/"
},
"https://data.gov.cz/slovník/podmínky-užití/osobní-údaje": {
"@id": "https://data.gov.cz/podmínky-užití/neobsahuje-osobní-údaje/"
}
},
"http://purl.org/dc/terms/conformsTo": {
"@id": "https://ofn.gov.cz/turistické-cíle/2020-07-01/schémata/turistické-cíle.json"
}
}
],
"http://purl.org/dc/terms/accrualPeriodicity": {
"@id": "http://publications.europa.eu/resource/authority/frequency/MONTHLY"
},
"http://purl.org/dc/terms/spatial": {
"@id": "https://linked.cuzk.cz/resource/ruian/stat/1"
},
"http://www.w3.org/ns/dcat#theme": [
{
"@id": "http://publications.europa.eu/resource/authority/data-theme/EDUC"
}
]
}
}'
Almost there, you just need to add name of the form at the end. The reason is that you may post data for edit/delete catalog. So from yey balling just add "registrace-lokálního-katalogu" (encoded) to the path. Still I will prepare and provide the example.
@skodapetr that is what I tried at first https://dev.nkod.opendata.cz/formul%C3%A1%C5%99/registrace-datov%C3%A9-sady
still with no success...
@skodapetr still getting the same
We should be able to pre-fill the dataset edit/delete dialog with data provided by POST request to the server.
The server (NodeJS) must be able to accept POST request with the data and respond with HTML as to the GET request with the difference that the HTML code must contain the data from the POST request.
This issue is based on: https://github.com/opendata-mvcr/lkod/issues/2