Skip to content

Commit

Permalink
Add test data and mapping configs
Browse files Browse the repository at this point in the history
  • Loading branch information
genie9 committed Mar 25, 2022
1 parent 5c422fc commit 50d8ad6
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 2 deletions.
10 changes: 9 additions & 1 deletion metadata_backend/conf/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
and inserted here in projects Dockerfile.
"""

import json
import os
from distutils.util import strtobool
from pathlib import Path
from typing import Tuple
from typing import Dict, Tuple

import ujson
from motor.motor_asyncio import AsyncIOMotorClient
Expand Down Expand Up @@ -171,3 +172,10 @@ def create_db_client() -> AsyncIOMotorClient:
"publish_route": "/rpc/v2/datasets/publish_dataset",
"catalog_pid": "urn:nbn:fi:att:data-catalog-sd",
}

# TODO: update languages. More fields could be needed
metax_mappings: Dict = {"identifier_types": {}, "languages": {}}
with open("metadata_backend/helpers/metax/identifier_types.json", "r") as codes:
codes_list = json.load(codes)["codes"]
for code in codes_list:
metax_mappings["identifier_types"][code["codeValue"].lower()] = code["uri"]
77 changes: 76 additions & 1 deletion tests/test_files/doi/test_doi.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,81 @@
}
],
"contributorType": "Researcher"
},
{
"name": "Curator, Test",
"nameType": "Personal",
"givenName": "Test",
"familyName": "Curator",
"affiliation": [
{
"name": "affiliation place",
"schemeUri": "https://ror.org",
"affiliationIdentifier": "https://ror.org/test3",
"affiliationIdentifierScheme": "ROR"
}
],
"contributorType": "Data Curator"
},
{
"name": "Rights, Holder",
"nameType": "Personal",
"givenName": "Rights",
"familyName": "Holder",
"affiliation": [
{
"name": "affiliation place",
"schemeUri": "https://ror.org",
"affiliationIdentifier": "https://ror.org/test3",
"affiliationIdentifierScheme": "ROR"
}
],
"contributorType": "Rights Holder"
}
],
"dates": [
{
"date": "2020-10-10/2022-01-10",
"dateType": "Collected"
},
{
"date": "2020-10-10",
"dateType": "Issued"
},
{
"date": "2022-01-10",
"dateType": "Updated"
},
{
"date": "2022-01-10",
"dateType": "Available"
}
],
"geoLocations": [
{
"geoLocationPlace": "Helsinki"
},
{
"geoLocationPoint": {
"pointLongitude": "121.061",
"pointLatitude": "14.5786"
},
"geoLocationBox": {
"westBoundLongitude": "23.1994938494",
"eastBoundLongitude": "51.3195034857",
"southBoundLatitude": "32.6936430193",
"northBoundLatitude": "56.1691299506"
}
}
],
"language": "Assamese",
"sizes": [
"30000"
],
"alternateIdentifiers": [
{
"alternateIdentifier": "arXiv:9912.12345v2",
"alternateIdentifierType": "arXiv"
}
]
}
}

0 comments on commit 50d8ad6

Please sign in to comment.