diff --git a/.gitignore b/.gitignore index 6e986faa52f717a8f6a62672ce221d53c786e9fd..4d8e82ce4150c4d699a9a34e0a1058311b2dd138 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ target/ !**/src/main/**/target/ !**/src/test/**/target/ -.invenio/ +.jupyter/ # Environment .env diff --git a/.invenio/dev.py b/.invenio/dev.py deleted file mode 100755 index 84fb4ef641ad314abee29149f3226c36b3e201cc..0000000000000000000000000000000000000000 --- a/.invenio/dev.py +++ /dev/null @@ -1,121 +0,0 @@ -import re -import requests as rq - -host = "https://test.researchdata.tuwien.ac.at" -file = "./resources/audio.wav" -token = "kJTJMtRKzmA0S92A9Jks7Y1OQbtRWElzgUrldXehDbeXESxIGQ0BQ6JFEFyg" - -headers = { - "Authorization": "Bearer " + token -} -filename = re.findall("([a-zA-z0-9_-]+\\.wav)", file)[0] - -response = rq.post(host + "/api/records", json={ - "access": { - "record": "public", - "files": "public", - "embargo": None - }, - "files": { - "enabled": True, - "default_preview": None - }, - "metadata": { - "creators": [{ - "affiliations": [ - { - "name": "University of Ljubljana" - } - ], - "person_or_org": { - "type": "personal", - "name": "M. Marolt", - "identifiers": [ - { - "scheme": "orcid", - "identifier": "0000-0002-0619-8789" - } - ], - "given_name": "Matija", - "family_name": "Marolt" - } - }, { - "affiliations": [ - { - "name": "University of Ljubljana" - } - ], - "person_or_org": { - "type": "personal", - "name": "C. Bohak", - "identifiers": [ - { - "scheme": "orcid", - "identifier": "0000-0002-9015-2897" - } - ], - "given_name": "Ciril", - "family_name": "Bohak" - } - }, { - "affiliations": [ - { - "name": "University of Ljubljana" - } - ], - "person_or_org": { - "type": "personal", - "name": "A. Kavčič", - "given_name": "Alenka", - "family_name": "Kavčič" - } - }, { - "affiliations": [ - { - "name": "University of Ljubljana" - } - ], - "person_or_org": { - "type": "personal", - "name": "M. Pesek", - "identifiers": [ - { - "scheme": "orcid", - "identifier": "0000-0001-9101-0471" - } - ], - "given_name": "Matevž", - "family_name": "Pesek" - } - }], - "title": "The SeFiRe field recording dataset", - "resource_type": { - "id": "sound" - }, - "publication_date": "2019-01-28" - } -}, headers=headers).json() -print(response) -record_id = response["id"] - -# announce -response = rq.post(host + "/api/records/" + record_id + "/draft/files", json=[{ - "key": filename -}], headers=headers).json() -print(response) - -# upload -with open(file, mode='rb') as f: - response = rq.put(host + "/api/records/" + record_id + "/draft/files/" + filename + "/content", data=f.read(), - headers=headers).json() -print(response) - -# commit -response = rq.post(host + "/api/records/" + record_id + "/draft/files/" + filename + "/commit", headers=headers).json() -print(response) -print() - -# publish -response = rq.post(host + "/api/records/" + record_id + "/draft/actions/publish", headers=headers).json() -print(response) -print() \ No newline at end of file diff --git a/.invenio/.gitignore b/.jupyter/.gitignore similarity index 100% rename from .invenio/.gitignore rename to .jupyter/.gitignore diff --git a/.invenio/api_authentication/__init__.py b/.jupyter/api_authentication/__init__.py similarity index 100% rename from .invenio/api_authentication/__init__.py rename to .jupyter/api_authentication/__init__.py diff --git a/.invenio/api_authentication/api/__init__.py b/.jupyter/api_authentication/api/__init__.py similarity index 100% rename from .invenio/api_authentication/api/__init__.py rename to .jupyter/api_authentication/api/__init__.py diff --git a/.invenio/api_authentication/api/authentication_endpoint_api.py b/.jupyter/api_authentication/api/authentication_endpoint_api.py similarity index 100% rename from .invenio/api_authentication/api/authentication_endpoint_api.py rename to .jupyter/api_authentication/api/authentication_endpoint_api.py diff --git a/.invenio/api_authentication/api/user_endpoint_api.py b/.jupyter/api_authentication/api/user_endpoint_api.py similarity index 100% rename from .invenio/api_authentication/api/user_endpoint_api.py rename to .jupyter/api_authentication/api/user_endpoint_api.py diff --git a/.invenio/api_authentication/api_client.py b/.jupyter/api_authentication/api_client.py similarity index 100% rename from .invenio/api_authentication/api_client.py rename to .jupyter/api_authentication/api_client.py diff --git a/.invenio/api_authentication/configuration.py b/.jupyter/api_authentication/configuration.py similarity index 100% rename from .invenio/api_authentication/configuration.py rename to .jupyter/api_authentication/configuration.py diff --git a/.invenio/api_authentication/models/__init__.py b/.jupyter/api_authentication/models/__init__.py similarity index 100% rename from .invenio/api_authentication/models/__init__.py rename to .jupyter/api_authentication/models/__init__.py diff --git a/.invenio/api_authentication/models/api_error_dto.py b/.jupyter/api_authentication/models/api_error_dto.py similarity index 100% rename from .invenio/api_authentication/models/api_error_dto.py rename to .jupyter/api_authentication/models/api_error_dto.py diff --git a/.invenio/api_authentication/models/column_dto.py b/.jupyter/api_authentication/models/column_dto.py similarity index 99% rename from .invenio/api_authentication/models/column_dto.py rename to .jupyter/api_authentication/models/column_dto.py index 6ea13633fe006d3ccab55d7525dfda777bf9a2a3..a10ab13755e5a2dc8f96502ed7e6d70f4b1d727a 100644 --- a/.invenio/api_authentication/models/column_dto.py +++ b/.jupyter/api_authentication/models/column_dto.py @@ -238,8 +238,6 @@ class ColumnDto(object): :param date_format: The date_format of this ColumnDto. # noqa: E501 :type: ImageDateDto """ - if date_format is None: - raise ValueError("Invalid value for `date_format`, must not be `None`") # noqa: E501 self._date_format = date_format diff --git a/.invenio/api_authentication/models/concept_dto.py b/.jupyter/api_authentication/models/concept_dto.py similarity index 100% rename from .invenio/api_authentication/models/concept_dto.py rename to .jupyter/api_authentication/models/concept_dto.py diff --git a/.invenio/api_authentication/models/container_dto.py b/.jupyter/api_authentication/models/container_dto.py similarity index 100% rename from .invenio/api_authentication/models/container_dto.py rename to .jupyter/api_authentication/models/container_dto.py diff --git a/.invenio/api_authentication/models/database_dto.py b/.jupyter/api_authentication/models/database_dto.py similarity index 100% rename from .invenio/api_authentication/models/database_dto.py rename to .jupyter/api_authentication/models/database_dto.py diff --git a/.invenio/api_authentication/models/granted_authority_dto.py b/.jupyter/api_authentication/models/granted_authority_dto.py similarity index 100% rename from .invenio/api_authentication/models/granted_authority_dto.py rename to .jupyter/api_authentication/models/granted_authority_dto.py diff --git a/.invenio/api_authentication/models/image_date_dto.py b/.jupyter/api_authentication/models/image_date_dto.py similarity index 100% rename from .invenio/api_authentication/models/image_date_dto.py rename to .jupyter/api_authentication/models/image_date_dto.py diff --git a/.invenio/api_authentication/models/image_dto.py b/.jupyter/api_authentication/models/image_dto.py similarity index 100% rename from .invenio/api_authentication/models/image_dto.py rename to .jupyter/api_authentication/models/image_dto.py diff --git a/.invenio/api_authentication/models/image_env_item_dto.py b/.jupyter/api_authentication/models/image_env_item_dto.py similarity index 100% rename from .invenio/api_authentication/models/image_env_item_dto.py rename to .jupyter/api_authentication/models/image_env_item_dto.py diff --git a/.invenio/api_authentication/models/jwt_response_dto.py b/.jupyter/api_authentication/models/jwt_response_dto.py similarity index 100% rename from .invenio/api_authentication/models/jwt_response_dto.py rename to .jupyter/api_authentication/models/jwt_response_dto.py diff --git a/.invenio/api_authentication/models/login_request_dto.py b/.jupyter/api_authentication/models/login_request_dto.py similarity index 100% rename from .invenio/api_authentication/models/login_request_dto.py rename to .jupyter/api_authentication/models/login_request_dto.py diff --git a/.invenio/api_authentication/models/signup_request_dto.py b/.jupyter/api_authentication/models/signup_request_dto.py similarity index 100% rename from .invenio/api_authentication/models/signup_request_dto.py rename to .jupyter/api_authentication/models/signup_request_dto.py diff --git a/.invenio/api_authentication/models/table_dto.py b/.jupyter/api_authentication/models/table_dto.py similarity index 100% rename from .invenio/api_authentication/models/table_dto.py rename to .jupyter/api_authentication/models/table_dto.py diff --git a/.invenio/api_authentication/models/user_dto.py b/.jupyter/api_authentication/models/user_dto.py similarity index 100% rename from .invenio/api_authentication/models/user_dto.py rename to .jupyter/api_authentication/models/user_dto.py diff --git a/.invenio/api_authentication/rest.py b/.jupyter/api_authentication/rest.py similarity index 100% rename from .invenio/api_authentication/rest.py rename to .jupyter/api_authentication/rest.py diff --git a/.rabbitmq/api_broker/BrokerServiceClient.py b/.jupyter/api_broker/BrokerServiceClient.py similarity index 100% rename from .rabbitmq/api_broker/BrokerServiceClient.py rename to .jupyter/api_broker/BrokerServiceClient.py diff --git a/.invenio/api_container/__init__.py b/.jupyter/api_container/__init__.py similarity index 100% rename from .invenio/api_container/__init__.py rename to .jupyter/api_container/__init__.py diff --git a/.invenio/api_container/api/__init__.py b/.jupyter/api_container/api/__init__.py similarity index 100% rename from .invenio/api_container/api/__init__.py rename to .jupyter/api_container/api/__init__.py diff --git a/.invenio/api_container/api/container_endpoint_api.py b/.jupyter/api_container/api/container_endpoint_api.py similarity index 100% rename from .invenio/api_container/api/container_endpoint_api.py rename to .jupyter/api_container/api/container_endpoint_api.py diff --git a/.invenio/api_container/api/image_endpoint_api.py b/.jupyter/api_container/api/image_endpoint_api.py similarity index 100% rename from .invenio/api_container/api/image_endpoint_api.py rename to .jupyter/api_container/api/image_endpoint_api.py diff --git a/.invenio/api_container/api_client.py b/.jupyter/api_container/api_client.py similarity index 100% rename from .invenio/api_container/api_client.py rename to .jupyter/api_container/api_client.py diff --git a/.invenio/api_container/configuration.py b/.jupyter/api_container/configuration.py similarity index 100% rename from .invenio/api_container/configuration.py rename to .jupyter/api_container/configuration.py diff --git a/.invenio/api_container/models/__init__.py b/.jupyter/api_container/models/__init__.py similarity index 100% rename from .invenio/api_container/models/__init__.py rename to .jupyter/api_container/models/__init__.py diff --git a/.invenio/api_container/models/api_error_dto.py b/.jupyter/api_container/models/api_error_dto.py similarity index 100% rename from .invenio/api_container/models/api_error_dto.py rename to .jupyter/api_container/models/api_error_dto.py diff --git a/.invenio/api_container/models/column_dto.py b/.jupyter/api_container/models/column_dto.py similarity index 99% rename from .invenio/api_container/models/column_dto.py rename to .jupyter/api_container/models/column_dto.py index 4cbe190a7f80efbeff02e8ccbbd501883f65480e..6bfa26fa1dd337b68320215f13f592d8dbea20f4 100644 --- a/.invenio/api_container/models/column_dto.py +++ b/.jupyter/api_container/models/column_dto.py @@ -238,8 +238,6 @@ class ColumnDto(object): :param date_format: The date_format of this ColumnDto. # noqa: E501 :type: ImageDateDto """ - if date_format is None: - raise ValueError("Invalid value for `date_format`, must not be `None`") # noqa: E501 self._date_format = date_format diff --git a/.invenio/api_container/models/concept_dto.py b/.jupyter/api_container/models/concept_dto.py similarity index 100% rename from .invenio/api_container/models/concept_dto.py rename to .jupyter/api_container/models/concept_dto.py diff --git a/.invenio/api_container/models/container_brief_dto.py b/.jupyter/api_container/models/container_brief_dto.py similarity index 100% rename from .invenio/api_container/models/container_brief_dto.py rename to .jupyter/api_container/models/container_brief_dto.py diff --git a/.invenio/api_container/models/container_change_dto.py b/.jupyter/api_container/models/container_change_dto.py similarity index 100% rename from .invenio/api_container/models/container_change_dto.py rename to .jupyter/api_container/models/container_change_dto.py diff --git a/.invenio/api_container/models/container_create_request_dto.py b/.jupyter/api_container/models/container_create_request_dto.py similarity index 100% rename from .invenio/api_container/models/container_create_request_dto.py rename to .jupyter/api_container/models/container_create_request_dto.py diff --git a/.invenio/api_container/models/container_dto.py b/.jupyter/api_container/models/container_dto.py similarity index 100% rename from .invenio/api_container/models/container_dto.py rename to .jupyter/api_container/models/container_dto.py diff --git a/.invenio/api_container/models/database_dto.py b/.jupyter/api_container/models/database_dto.py similarity index 100% rename from .invenio/api_container/models/database_dto.py rename to .jupyter/api_container/models/database_dto.py diff --git a/.invenio/api_container/models/granted_authority_dto.py b/.jupyter/api_container/models/granted_authority_dto.py similarity index 100% rename from .invenio/api_container/models/granted_authority_dto.py rename to .jupyter/api_container/models/granted_authority_dto.py diff --git a/.invenio/api_container/models/image_brief_dto.py b/.jupyter/api_container/models/image_brief_dto.py similarity index 100% rename from .invenio/api_container/models/image_brief_dto.py rename to .jupyter/api_container/models/image_brief_dto.py diff --git a/.invenio/api_container/models/image_change_dto.py b/.jupyter/api_container/models/image_change_dto.py similarity index 100% rename from .invenio/api_container/models/image_change_dto.py rename to .jupyter/api_container/models/image_change_dto.py diff --git a/.invenio/api_container/models/image_create_dto.py b/.jupyter/api_container/models/image_create_dto.py similarity index 100% rename from .invenio/api_container/models/image_create_dto.py rename to .jupyter/api_container/models/image_create_dto.py diff --git a/.invenio/api_container/models/image_date_dto.py b/.jupyter/api_container/models/image_date_dto.py similarity index 100% rename from .invenio/api_container/models/image_date_dto.py rename to .jupyter/api_container/models/image_date_dto.py diff --git a/.invenio/api_container/models/image_dto.py b/.jupyter/api_container/models/image_dto.py similarity index 100% rename from .invenio/api_container/models/image_dto.py rename to .jupyter/api_container/models/image_dto.py diff --git a/.invenio/api_container/models/image_env_item_dto.py b/.jupyter/api_container/models/image_env_item_dto.py similarity index 100% rename from .invenio/api_container/models/image_env_item_dto.py rename to .jupyter/api_container/models/image_env_item_dto.py diff --git a/.invenio/api_container/models/table_dto.py b/.jupyter/api_container/models/table_dto.py similarity index 100% rename from .invenio/api_container/models/table_dto.py rename to .jupyter/api_container/models/table_dto.py diff --git a/.invenio/api_container/models/user_dto.py b/.jupyter/api_container/models/user_dto.py similarity index 100% rename from .invenio/api_container/models/user_dto.py rename to .jupyter/api_container/models/user_dto.py diff --git a/.invenio/api_container/rest.py b/.jupyter/api_container/rest.py similarity index 100% rename from .invenio/api_container/rest.py rename to .jupyter/api_container/rest.py diff --git a/.invenio/api_database/__init__.py b/.jupyter/api_database/__init__.py similarity index 100% rename from .invenio/api_database/__init__.py rename to .jupyter/api_database/__init__.py diff --git a/.invenio/api_database/api/__init__.py b/.jupyter/api_database/api/__init__.py similarity index 100% rename from .invenio/api_database/api/__init__.py rename to .jupyter/api_database/api/__init__.py diff --git a/.invenio/api_database/api/container_database_endpoint_api.py b/.jupyter/api_database/api/container_database_endpoint_api.py similarity index 100% rename from .invenio/api_database/api/container_database_endpoint_api.py rename to .jupyter/api_database/api/container_database_endpoint_api.py diff --git a/.invenio/api_database/api_client.py b/.jupyter/api_database/api_client.py similarity index 100% rename from .invenio/api_database/api_client.py rename to .jupyter/api_database/api_client.py diff --git a/.invenio/api_database/configuration.py b/.jupyter/api_database/configuration.py similarity index 100% rename from .invenio/api_database/configuration.py rename to .jupyter/api_database/configuration.py diff --git a/.invenio/api_database/models/__init__.py b/.jupyter/api_database/models/__init__.py similarity index 100% rename from .invenio/api_database/models/__init__.py rename to .jupyter/api_database/models/__init__.py diff --git a/.invenio/api_database/models/api_error_dto.py b/.jupyter/api_database/models/api_error_dto.py similarity index 100% rename from .invenio/api_database/models/api_error_dto.py rename to .jupyter/api_database/models/api_error_dto.py diff --git a/.invenio/api_database/models/column_dto.py b/.jupyter/api_database/models/column_dto.py similarity index 99% rename from .invenio/api_database/models/column_dto.py rename to .jupyter/api_database/models/column_dto.py index 90919b28cedcf4d6b1a2701f5ad087e252068404..9177989e7dd3f8d7e72f4cf9d3bd3c7d8daf4ca3 100644 --- a/.invenio/api_database/models/column_dto.py +++ b/.jupyter/api_database/models/column_dto.py @@ -238,8 +238,6 @@ class ColumnDto(object): :param date_format: The date_format of this ColumnDto. # noqa: E501 :type: ImageDateDto """ - if date_format is None: - raise ValueError("Invalid value for `date_format`, must not be `None`") # noqa: E501 self._date_format = date_format diff --git a/.invenio/api_database/models/concept_dto.py b/.jupyter/api_database/models/concept_dto.py similarity index 100% rename from .invenio/api_database/models/concept_dto.py rename to .jupyter/api_database/models/concept_dto.py diff --git a/.invenio/api_database/models/container_dto.py b/.jupyter/api_database/models/container_dto.py similarity index 100% rename from .invenio/api_database/models/container_dto.py rename to .jupyter/api_database/models/container_dto.py diff --git a/.invenio/api_database/models/database_brief_dto.py b/.jupyter/api_database/models/database_brief_dto.py similarity index 100% rename from .invenio/api_database/models/database_brief_dto.py rename to .jupyter/api_database/models/database_brief_dto.py diff --git a/.invenio/api_database/models/database_create_dto.py b/.jupyter/api_database/models/database_create_dto.py similarity index 100% rename from .invenio/api_database/models/database_create_dto.py rename to .jupyter/api_database/models/database_create_dto.py diff --git a/.invenio/api_database/models/database_dto.py b/.jupyter/api_database/models/database_dto.py similarity index 100% rename from .invenio/api_database/models/database_dto.py rename to .jupyter/api_database/models/database_dto.py diff --git a/.invenio/api_database/models/database_modify_dto.py b/.jupyter/api_database/models/database_modify_dto.py similarity index 100% rename from .invenio/api_database/models/database_modify_dto.py rename to .jupyter/api_database/models/database_modify_dto.py diff --git a/.invenio/api_database/models/granted_authority_dto.py b/.jupyter/api_database/models/granted_authority_dto.py similarity index 100% rename from .invenio/api_database/models/granted_authority_dto.py rename to .jupyter/api_database/models/granted_authority_dto.py diff --git a/.invenio/api_database/models/image_date_dto.py b/.jupyter/api_database/models/image_date_dto.py similarity index 100% rename from .invenio/api_database/models/image_date_dto.py rename to .jupyter/api_database/models/image_date_dto.py diff --git a/.invenio/api_database/models/image_dto.py b/.jupyter/api_database/models/image_dto.py similarity index 100% rename from .invenio/api_database/models/image_dto.py rename to .jupyter/api_database/models/image_dto.py diff --git a/.invenio/api_database/models/image_env_item_dto.py b/.jupyter/api_database/models/image_env_item_dto.py similarity index 100% rename from .invenio/api_database/models/image_env_item_dto.py rename to .jupyter/api_database/models/image_env_item_dto.py diff --git a/.invenio/api_database/models/table_dto.py b/.jupyter/api_database/models/table_dto.py similarity index 100% rename from .invenio/api_database/models/table_dto.py rename to .jupyter/api_database/models/table_dto.py diff --git a/.invenio/api_database/models/user_dto.py b/.jupyter/api_database/models/user_dto.py similarity index 100% rename from .invenio/api_database/models/user_dto.py rename to .jupyter/api_database/models/user_dto.py diff --git a/.invenio/api_database/rest.py b/.jupyter/api_database/rest.py similarity index 100% rename from .invenio/api_database/rest.py rename to .jupyter/api_database/rest.py diff --git a/.invenio/api_document/__init__.py b/.jupyter/api_document/__init__.py similarity index 100% rename from .invenio/api_document/__init__.py rename to .jupyter/api_document/__init__.py diff --git a/.invenio/api_document/api/__init__.py b/.jupyter/api_document/api/__init__.py similarity index 100% rename from .invenio/api_document/api/__init__.py rename to .jupyter/api_document/api/__init__.py diff --git a/.invenio/api_document/api/document_endpoint_api.py b/.jupyter/api_document/api/document_endpoint_api.py similarity index 100% rename from .invenio/api_document/api/document_endpoint_api.py rename to .jupyter/api_document/api/document_endpoint_api.py diff --git a/.invenio/api_document/api/file_endpoint_api.py b/.jupyter/api_document/api/file_endpoint_api.py similarity index 100% rename from .invenio/api_document/api/file_endpoint_api.py rename to .jupyter/api_document/api/file_endpoint_api.py diff --git a/.invenio/api_document/api_client.py b/.jupyter/api_document/api_client.py similarity index 100% rename from .invenio/api_document/api_client.py rename to .jupyter/api_document/api_client.py diff --git a/.invenio/api_document/configuration.py b/.jupyter/api_document/configuration.py similarity index 100% rename from .invenio/api_document/configuration.py rename to .jupyter/api_document/configuration.py diff --git a/.invenio/api_document/models/__init__.py b/.jupyter/api_document/models/__init__.py similarity index 100% rename from .invenio/api_document/models/__init__.py rename to .jupyter/api_document/models/__init__.py diff --git a/.invenio/api_document/models/access_options_dto.py b/.jupyter/api_document/models/access_options_dto.py similarity index 100% rename from .invenio/api_document/models/access_options_dto.py rename to .jupyter/api_document/models/access_options_dto.py diff --git a/.invenio/api_document/models/affiliation_dto.py b/.jupyter/api_document/models/affiliation_dto.py similarity index 100% rename from .invenio/api_document/models/affiliation_dto.py rename to .jupyter/api_document/models/affiliation_dto.py diff --git a/.invenio/api_document/models/api_error_dto.py b/.jupyter/api_document/models/api_error_dto.py similarity index 100% rename from .invenio/api_document/models/api_error_dto.py rename to .jupyter/api_document/models/api_error_dto.py diff --git a/.invenio/api_document/models/create_draft_dto.py b/.jupyter/api_document/models/create_draft_dto.py similarity index 100% rename from .invenio/api_document/models/create_draft_dto.py rename to .jupyter/api_document/models/create_draft_dto.py diff --git a/.invenio/api_document/models/creator_dto.py b/.jupyter/api_document/models/creator_dto.py similarity index 100% rename from .invenio/api_document/models/creator_dto.py rename to .jupyter/api_document/models/creator_dto.py diff --git a/.invenio/api_document/models/doi_dto.py b/.jupyter/api_document/models/doi_dto.py similarity index 100% rename from .invenio/api_document/models/doi_dto.py rename to .jupyter/api_document/models/doi_dto.py diff --git a/.invenio/api_document/models/draft_dto.py b/.jupyter/api_document/models/draft_dto.py similarity index 100% rename from .invenio/api_document/models/draft_dto.py rename to .jupyter/api_document/models/draft_dto.py diff --git a/.invenio/api_document/models/draft_versions_dto.py b/.jupyter/api_document/models/draft_versions_dto.py similarity index 100% rename from .invenio/api_document/models/draft_versions_dto.py rename to .jupyter/api_document/models/draft_versions_dto.py diff --git a/.invenio/api_document/models/embargo_dto.py b/.jupyter/api_document/models/embargo_dto.py similarity index 100% rename from .invenio/api_document/models/embargo_dto.py rename to .jupyter/api_document/models/embargo_dto.py diff --git a/.invenio/api_document/models/entry_dto.py b/.jupyter/api_document/models/entry_dto.py similarity index 100% rename from .invenio/api_document/models/entry_dto.py rename to .jupyter/api_document/models/entry_dto.py diff --git a/.invenio/api_document/models/file_announce_dto.py b/.jupyter/api_document/models/file_announce_dto.py similarity index 100% rename from .invenio/api_document/models/file_announce_dto.py rename to .jupyter/api_document/models/file_announce_dto.py diff --git a/.invenio/api_document/models/file_dto.py b/.jupyter/api_document/models/file_dto.py similarity index 100% rename from .invenio/api_document/models/file_dto.py rename to .jupyter/api_document/models/file_dto.py diff --git a/.invenio/api_document/models/file_entry_dto.py b/.jupyter/api_document/models/file_entry_dto.py similarity index 100% rename from .invenio/api_document/models/file_entry_dto.py rename to .jupyter/api_document/models/file_entry_dto.py diff --git a/.invenio/api_document/models/file_key_dto.py b/.jupyter/api_document/models/file_key_dto.py similarity index 100% rename from .invenio/api_document/models/file_key_dto.py rename to .jupyter/api_document/models/file_key_dto.py diff --git a/.invenio/api_document/models/file_start_dto.py b/.jupyter/api_document/models/file_start_dto.py similarity index 100% rename from .invenio/api_document/models/file_start_dto.py rename to .jupyter/api_document/models/file_start_dto.py diff --git a/.invenio/api_document/models/files_options_dto.py b/.jupyter/api_document/models/files_options_dto.py similarity index 100% rename from .invenio/api_document/models/files_options_dto.py rename to .jupyter/api_document/models/files_options_dto.py diff --git a/.invenio/api_document/models/id_file_body.py b/.jupyter/api_document/models/id_file_body.py similarity index 100% rename from .invenio/api_document/models/id_file_body.py rename to .jupyter/api_document/models/id_file_body.py diff --git a/.invenio/api_document/models/identifier_dto.py b/.jupyter/api_document/models/identifier_dto.py similarity index 100% rename from .invenio/api_document/models/identifier_dto.py rename to .jupyter/api_document/models/identifier_dto.py diff --git a/.invenio/api_document/models/import_dto.py b/.jupyter/api_document/models/import_dto.py similarity index 100% rename from .invenio/api_document/models/import_dto.py rename to .jupyter/api_document/models/import_dto.py diff --git a/.invenio/api_document/models/links_dto.py b/.jupyter/api_document/models/links_dto.py similarity index 100% rename from .invenio/api_document/models/links_dto.py rename to .jupyter/api_document/models/links_dto.py diff --git a/.invenio/api_document/models/metadata_dto.py b/.jupyter/api_document/models/metadata_dto.py similarity index 100% rename from .invenio/api_document/models/metadata_dto.py rename to .jupyter/api_document/models/metadata_dto.py diff --git a/.invenio/api_document/models/persistent_identifiers_dto.py b/.jupyter/api_document/models/persistent_identifiers_dto.py similarity index 100% rename from .invenio/api_document/models/persistent_identifiers_dto.py rename to .jupyter/api_document/models/persistent_identifiers_dto.py diff --git a/.invenio/api_document/models/person_or_organization_dto.py b/.jupyter/api_document/models/person_or_organization_dto.py similarity index 100% rename from .invenio/api_document/models/person_or_organization_dto.py rename to .jupyter/api_document/models/person_or_organization_dto.py diff --git a/.invenio/api_document/models/record_dto.py b/.jupyter/api_document/models/record_dto.py similarity index 100% rename from .invenio/api_document/models/record_dto.py rename to .jupyter/api_document/models/record_dto.py diff --git a/.invenio/api_document/models/resource_type_dto.py b/.jupyter/api_document/models/resource_type_dto.py similarity index 100% rename from .invenio/api_document/models/resource_type_dto.py rename to .jupyter/api_document/models/resource_type_dto.py diff --git a/.invenio/api_document/rest.py b/.jupyter/api_document/rest.py similarity index 100% rename from .invenio/api_document/rest.py rename to .jupyter/api_document/rest.py diff --git a/.invenio/api_identifier/__init__.py b/.jupyter/api_identifier/__init__.py similarity index 100% rename from .invenio/api_identifier/__init__.py rename to .jupyter/api_identifier/__init__.py diff --git a/.invenio/api_identifier/api/__init__.py b/.jupyter/api_identifier/api/__init__.py similarity index 100% rename from .invenio/api_identifier/api/__init__.py rename to .jupyter/api_identifier/api/__init__.py diff --git a/.invenio/api_identifier/api/identifier_endpoint_api.py b/.jupyter/api_identifier/api/identifier_endpoint_api.py similarity index 100% rename from .invenio/api_identifier/api/identifier_endpoint_api.py rename to .jupyter/api_identifier/api/identifier_endpoint_api.py diff --git a/.invenio/api_identifier/api/persistence_endpoint_api.py b/.jupyter/api_identifier/api/persistence_endpoint_api.py similarity index 100% rename from .invenio/api_identifier/api/persistence_endpoint_api.py rename to .jupyter/api_identifier/api/persistence_endpoint_api.py diff --git a/.invenio/api_identifier/api_client.py b/.jupyter/api_identifier/api_client.py similarity index 100% rename from .invenio/api_identifier/api_client.py rename to .jupyter/api_identifier/api_client.py diff --git a/.invenio/api_identifier/configuration.py b/.jupyter/api_identifier/configuration.py similarity index 100% rename from .invenio/api_identifier/configuration.py rename to .jupyter/api_identifier/configuration.py diff --git a/.invenio/api_identifier/models/__init__.py b/.jupyter/api_identifier/models/__init__.py similarity index 100% rename from .invenio/api_identifier/models/__init__.py rename to .jupyter/api_identifier/models/__init__.py diff --git a/.invenio/api_identifier/models/api_error_dto.py b/.jupyter/api_identifier/models/api_error_dto.py similarity index 100% rename from .invenio/api_identifier/models/api_error_dto.py rename to .jupyter/api_identifier/models/api_error_dto.py diff --git a/.invenio/api_identifier/models/creator_dto.py b/.jupyter/api_identifier/models/creator_dto.py similarity index 100% rename from .invenio/api_identifier/models/creator_dto.py rename to .jupyter/api_identifier/models/creator_dto.py diff --git a/.invenio/api_identifier/models/identifier_dto.py b/.jupyter/api_identifier/models/identifier_dto.py similarity index 100% rename from .invenio/api_identifier/models/identifier_dto.py rename to .jupyter/api_identifier/models/identifier_dto.py diff --git a/.invenio/api_identifier/rest.py b/.jupyter/api_identifier/rest.py similarity index 100% rename from .invenio/api_identifier/rest.py rename to .jupyter/api_identifier/rest.py diff --git a/.invenio/api_query/__init__.py b/.jupyter/api_query/__init__.py similarity index 100% rename from .invenio/api_query/__init__.py rename to .jupyter/api_query/__init__.py diff --git a/.invenio/api_query/api/__init__.py b/.jupyter/api_query/api/__init__.py similarity index 100% rename from .invenio/api_query/api/__init__.py rename to .jupyter/api_query/api/__init__.py diff --git a/.invenio/api_query/api/export_endpoint_api.py b/.jupyter/api_query/api/export_endpoint_api.py similarity index 100% rename from .invenio/api_query/api/export_endpoint_api.py rename to .jupyter/api_query/api/export_endpoint_api.py diff --git a/.invenio/api_query/api/query_endpoint_api.py b/.jupyter/api_query/api/query_endpoint_api.py similarity index 100% rename from .invenio/api_query/api/query_endpoint_api.py rename to .jupyter/api_query/api/query_endpoint_api.py diff --git a/.invenio/api_query/api/store_endpoint_api.py b/.jupyter/api_query/api/store_endpoint_api.py similarity index 100% rename from .invenio/api_query/api/store_endpoint_api.py rename to .jupyter/api_query/api/store_endpoint_api.py diff --git a/.invenio/api_query/api/table_data_endpoint_api.py b/.jupyter/api_query/api/table_data_endpoint_api.py similarity index 100% rename from .invenio/api_query/api/table_data_endpoint_api.py rename to .jupyter/api_query/api/table_data_endpoint_api.py index a0717e8c4242461be2c7ee4646711380a862e5a9..b1ba3cb7a3fefa93235671ded708b85491371dd8 100644 --- a/.invenio/api_query/api/table_data_endpoint_api.py +++ b/.jupyter/api_query/api/table_data_endpoint_api.py @@ -259,7 +259,7 @@ class TableDataEndpointApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/table/{tableId}/data', 'GET', + '/api/container/{id}/database/{databaseId}/table/{tableId}/data', 'HEAD', path_params, query_params, header_params, @@ -380,7 +380,7 @@ class TableDataEndpointApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/table/{tableId}/data', 'HEAD', + '/api/container/{id}/database/{databaseId}/table/{tableId}/data', 'GET', path_params, query_params, header_params, diff --git a/.invenio/api_query/api_client.py b/.jupyter/api_query/api_client.py similarity index 100% rename from .invenio/api_query/api_client.py rename to .jupyter/api_query/api_client.py diff --git a/.invenio/api_query/configuration.py b/.jupyter/api_query/configuration.py similarity index 100% rename from .invenio/api_query/configuration.py rename to .jupyter/api_query/configuration.py diff --git a/.invenio/api_query/models/__init__.py b/.jupyter/api_query/models/__init__.py similarity index 100% rename from .invenio/api_query/models/__init__.py rename to .jupyter/api_query/models/__init__.py diff --git a/.invenio/api_query/models/api_error_dto.py b/.jupyter/api_query/models/api_error_dto.py similarity index 100% rename from .invenio/api_query/models/api_error_dto.py rename to .jupyter/api_query/models/api_error_dto.py diff --git a/.invenio/api_query/models/column_dto.py b/.jupyter/api_query/models/column_dto.py similarity index 97% rename from .invenio/api_query/models/column_dto.py rename to .jupyter/api_query/models/column_dto.py index 1b1ecf326453186c2f71fa1befdd015e79588974..4873a95e8de00c9fd8622dd19aeec1010eb97d3a 100644 --- a/.invenio/api_query/models/column_dto.py +++ b/.jupyter/api_query/models/column_dto.py @@ -90,11 +90,13 @@ class ColumnDto(object): if references is not None: self.references = references self.internal_name = internal_name - self.date_format = date_format + if date_format is not None: + self.date_format = date_format self.auto_generated = auto_generated self.is_primary_key = is_primary_key self.column_type = column_type - self.column_concept = column_concept + if column_concept is not None: + self.column_concept = column_concept if decimal_digits_before is not None: self.decimal_digits_before = decimal_digits_before if decimal_digits_after is not None: @@ -238,8 +240,6 @@ class ColumnDto(object): :param date_format: The date_format of this ColumnDto. # noqa: E501 :type: ImageDateDto """ - if date_format is None: - raise ValueError("Invalid value for `date_format`, must not be `None`") # noqa: E501 self._date_format = date_format @@ -336,8 +336,6 @@ class ColumnDto(object): :param column_concept: The column_concept of this ColumnDto. # noqa: E501 :type: ConceptDto """ - if column_concept is None: - raise ValueError("Invalid value for `column_concept`, must not be `None`") # noqa: E501 self._column_concept = column_concept diff --git a/.invenio/api_query/models/concept_dto.py b/.jupyter/api_query/models/concept_dto.py similarity index 100% rename from .invenio/api_query/models/concept_dto.py rename to .jupyter/api_query/models/concept_dto.py diff --git a/.invenio/api_query/models/container_dto.py b/.jupyter/api_query/models/container_dto.py similarity index 100% rename from .invenio/api_query/models/container_dto.py rename to .jupyter/api_query/models/container_dto.py diff --git a/.invenio/api_query/models/database_dto.py b/.jupyter/api_query/models/database_dto.py similarity index 100% rename from .invenio/api_query/models/database_dto.py rename to .jupyter/api_query/models/database_dto.py diff --git a/.invenio/api_query/models/execute_statement_dto.py b/.jupyter/api_query/models/execute_statement_dto.py similarity index 100% rename from .invenio/api_query/models/execute_statement_dto.py rename to .jupyter/api_query/models/execute_statement_dto.py diff --git a/.invenio/api_query/models/granted_authority_dto.py b/.jupyter/api_query/models/granted_authority_dto.py similarity index 100% rename from .invenio/api_query/models/granted_authority_dto.py rename to .jupyter/api_query/models/granted_authority_dto.py diff --git a/.invenio/api_query/models/image_date_dto.py b/.jupyter/api_query/models/image_date_dto.py similarity index 100% rename from .invenio/api_query/models/image_date_dto.py rename to .jupyter/api_query/models/image_date_dto.py diff --git a/.invenio/api_query/models/image_dto.py b/.jupyter/api_query/models/image_dto.py similarity index 100% rename from .invenio/api_query/models/image_dto.py rename to .jupyter/api_query/models/image_dto.py diff --git a/.invenio/api_query/models/image_env_item_dto.py b/.jupyter/api_query/models/image_env_item_dto.py similarity index 100% rename from .invenio/api_query/models/image_env_item_dto.py rename to .jupyter/api_query/models/image_env_item_dto.py diff --git a/.invenio/api_query/models/import_dto.py b/.jupyter/api_query/models/import_dto.py similarity index 100% rename from .invenio/api_query/models/import_dto.py rename to .jupyter/api_query/models/import_dto.py diff --git a/.invenio/api_query/models/query_dto.py b/.jupyter/api_query/models/query_dto.py similarity index 100% rename from .invenio/api_query/models/query_dto.py rename to .jupyter/api_query/models/query_dto.py diff --git a/.invenio/api_query/models/query_result_dto.py b/.jupyter/api_query/models/query_result_dto.py similarity index 100% rename from .invenio/api_query/models/query_result_dto.py rename to .jupyter/api_query/models/query_result_dto.py diff --git a/.invenio/api_query/models/table_csv_delete_dto.py b/.jupyter/api_query/models/table_csv_delete_dto.py similarity index 100% rename from .invenio/api_query/models/table_csv_delete_dto.py rename to .jupyter/api_query/models/table_csv_delete_dto.py diff --git a/.invenio/api_query/models/table_csv_dto.py b/.jupyter/api_query/models/table_csv_dto.py similarity index 100% rename from .invenio/api_query/models/table_csv_dto.py rename to .jupyter/api_query/models/table_csv_dto.py diff --git a/.invenio/api_query/models/table_csv_update_dto.py b/.jupyter/api_query/models/table_csv_update_dto.py similarity index 100% rename from .invenio/api_query/models/table_csv_update_dto.py rename to .jupyter/api_query/models/table_csv_update_dto.py diff --git a/.invenio/api_query/models/table_dto.py b/.jupyter/api_query/models/table_dto.py similarity index 100% rename from .invenio/api_query/models/table_dto.py rename to .jupyter/api_query/models/table_dto.py diff --git a/.invenio/api_query/models/user_dto.py b/.jupyter/api_query/models/user_dto.py similarity index 100% rename from .invenio/api_query/models/user_dto.py rename to .jupyter/api_query/models/user_dto.py diff --git a/.invenio/api_query/rest.py b/.jupyter/api_query/rest.py similarity index 100% rename from .invenio/api_query/rest.py rename to .jupyter/api_query/rest.py diff --git a/.invenio/api_table/__init__.py b/.jupyter/api_table/__init__.py similarity index 100% rename from .invenio/api_table/__init__.py rename to .jupyter/api_table/__init__.py diff --git a/.invenio/api_table/api/__init__.py b/.jupyter/api_table/api/__init__.py similarity index 100% rename from .invenio/api_table/api/__init__.py rename to .jupyter/api_table/api/__init__.py diff --git a/.invenio/api_table/api/table_endpoint_api.py b/.jupyter/api_table/api/table_endpoint_api.py similarity index 99% rename from .invenio/api_table/api/table_endpoint_api.py rename to .jupyter/api_table/api/table_endpoint_api.py index 34fc204e5e4df4c78e25e4bad259b685a7f6d6f7..ca2f072bd02fb59f14d40e93d298617cc76511f2 100644 --- a/.invenio/api_table/api/table_endpoint_api.py +++ b/.jupyter/api_table/api/table_endpoint_api.py @@ -337,7 +337,7 @@ class TableEndpointApi(object): ['*/*']) # noqa: E501 # Authentication setting - auth_settings = [] # noqa: E501 + auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( '/api/container/{id}/database/{databaseId}/table', 'GET', @@ -446,7 +446,7 @@ class TableEndpointApi(object): ['*/*']) # noqa: E501 # Authentication setting - auth_settings = [] # noqa: E501 + auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( '/api/container/{id}/database/{databaseId}/table/{tableId}', 'GET', diff --git a/.invenio/api_table/api_client.py b/.jupyter/api_table/api_client.py similarity index 100% rename from .invenio/api_table/api_client.py rename to .jupyter/api_table/api_client.py diff --git a/.invenio/api_table/configuration.py b/.jupyter/api_table/configuration.py similarity index 100% rename from .invenio/api_table/configuration.py rename to .jupyter/api_table/configuration.py diff --git a/.invenio/api_table/models/__init__.py b/.jupyter/api_table/models/__init__.py similarity index 100% rename from .invenio/api_table/models/__init__.py rename to .jupyter/api_table/models/__init__.py diff --git a/.invenio/api_table/models/api_error_dto.py b/.jupyter/api_table/models/api_error_dto.py similarity index 100% rename from .invenio/api_table/models/api_error_dto.py rename to .jupyter/api_table/models/api_error_dto.py diff --git a/.invenio/api_table/models/column_create_dto.py b/.jupyter/api_table/models/column_create_dto.py similarity index 100% rename from .invenio/api_table/models/column_create_dto.py rename to .jupyter/api_table/models/column_create_dto.py diff --git a/.invenio/api_table/models/column_dto.py b/.jupyter/api_table/models/column_dto.py similarity index 97% rename from .invenio/api_table/models/column_dto.py rename to .jupyter/api_table/models/column_dto.py index 3c540b2b69aeff1547d0dcb325b9580b3b1afd75..75f507814e83bc88c6cb76bd29379e3e12354d5f 100644 --- a/.invenio/api_table/models/column_dto.py +++ b/.jupyter/api_table/models/column_dto.py @@ -90,11 +90,13 @@ class ColumnDto(object): if references is not None: self.references = references self.internal_name = internal_name - self.date_format = date_format + if date_format is not None: + self.date_format = date_format self.auto_generated = auto_generated self.is_primary_key = is_primary_key self.column_type = column_type - self.column_concept = column_concept + if column_concept is not None: + self.column_concept = column_concept if decimal_digits_before is not None: self.decimal_digits_before = decimal_digits_before if decimal_digits_after is not None: @@ -238,8 +240,6 @@ class ColumnDto(object): :param date_format: The date_format of this ColumnDto. # noqa: E501 :type: ImageDateDto """ - if date_format is None: - raise ValueError("Invalid value for `date_format`, must not be `None`") # noqa: E501 self._date_format = date_format @@ -336,8 +336,6 @@ class ColumnDto(object): :param column_concept: The column_concept of this ColumnDto. # noqa: E501 :type: ConceptDto """ - if column_concept is None: - raise ValueError("Invalid value for `column_concept`, must not be `None`") # noqa: E501 self._column_concept = column_concept diff --git a/.invenio/api_table/models/concept_dto.py b/.jupyter/api_table/models/concept_dto.py similarity index 100% rename from .invenio/api_table/models/concept_dto.py rename to .jupyter/api_table/models/concept_dto.py diff --git a/.invenio/api_table/models/image_date_dto.py b/.jupyter/api_table/models/image_date_dto.py similarity index 100% rename from .invenio/api_table/models/image_date_dto.py rename to .jupyter/api_table/models/image_date_dto.py diff --git a/.invenio/api_table/models/table_brief_dto.py b/.jupyter/api_table/models/table_brief_dto.py similarity index 100% rename from .invenio/api_table/models/table_brief_dto.py rename to .jupyter/api_table/models/table_brief_dto.py diff --git a/.invenio/api_table/models/table_create_dto.py b/.jupyter/api_table/models/table_create_dto.py similarity index 100% rename from .invenio/api_table/models/table_create_dto.py rename to .jupyter/api_table/models/table_create_dto.py diff --git a/.invenio/api_table/models/table_dto.py b/.jupyter/api_table/models/table_dto.py similarity index 100% rename from .invenio/api_table/models/table_dto.py rename to .jupyter/api_table/models/table_dto.py diff --git a/.invenio/api_table/rest.py b/.jupyter/api_table/rest.py similarity index 100% rename from .invenio/api_table/rest.py rename to .jupyter/api_table/rest.py diff --git a/.invenio/deposit.ipynb b/.jupyter/deposit.ipynb similarity index 100% rename from .invenio/deposit.ipynb rename to .jupyter/deposit.ipynb diff --git a/.jupyter/dev.py b/.jupyter/dev.py new file mode 100755 index 0000000000000000000000000000000000000000..5f4cf64f3824e333372bf5ae61c811afe1e19d45 --- /dev/null +++ b/.jupyter/dev.py @@ -0,0 +1,10 @@ +import csv +import time + +with open('./resources/ugz_ogd_air_h1_2021.csv', mode='r', encoding='utf-8-sig') as f: + csv_reader = csv.reader(f, delimiter=',', quotechar='"') + for row in csv_reader: + payload = {'date': row[0], 'location': row[1], 'parameter': row[2], 'interval': row[3], 'unit': row[4], + 'value': row[5], 'status': row[6]} + print('sending', payload, '...') + time.sleep(5) diff --git a/.invenio/feature_extract.ipynb b/.jupyter/feature_extract.ipynb similarity index 100% rename from .invenio/feature_extract.ipynb rename to .jupyter/feature_extract.ipynb diff --git a/.jupyter/publish.ipynb b/.jupyter/publish.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..eca8c634e991660ba3a1afef6e73f85db972433c --- /dev/null +++ b/.jupyter/publish.ipynb @@ -0,0 +1,265 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true, + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [], + "source": [ + "import uuid\n", + "import time\n", + "from api_broker.BrokerServiceClient import BrokerServiceClient\n", + "from api_authentication.api.authentication_endpoint_api import AuthenticationEndpointApi\n", + "from api_authentication.api.user_endpoint_api import UserEndpointApi\n", + "from api_container.api.container_endpoint_api import ContainerEndpointApi\n", + "from api_database.api.container_database_endpoint_api import ContainerDatabaseEndpointApi\n", + "from api_table.api.table_endpoint_api import TableEndpointApi\n", + "from api_query.api.table_data_endpoint_api import TableDataEndpointApi\n", + "from api_query.api.query_endpoint_api import QueryEndpointApi\n", + "from api_identifier.api.identifier_endpoint_api import IdentifierEndpointApi\n", + "from api_identifier.api.persistence_endpoint_api import PersistenceEndpointApi\n", + "\n", + "authentication = AuthenticationEndpointApi()\n", + "user = UserEndpointApi()\n", + "container = ContainerEndpointApi()\n", + "database = ContainerDatabaseEndpointApi()\n", + "table = TableEndpointApi()\n", + "query = QueryEndpointApi()\n", + "data = TableDataEndpointApi()\n", + "identifier = IdentifierEndpointApi()\n", + "persistence = PersistenceEndpointApi()\n", + "\n", + "exchange = \"airquality\"\n", + "routing_key = \"airquality\"\n", + "host = \"localhost\"\n", + "username = \"mweise\"\n", + "password = \"V0f38ad2!\"\n", + "\n", + "broker = BrokerServiceClient(exchange=exchange, routing_key=routing_key, host=host, username=username, password=password)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "response = authentication.authenticate_user1({\n", + " \"username\": \"user\",\n", + " \"password\": \"user\"\n", + "})\n", + "user_id = response.id\n", + "token = response.token\n", + "container.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}\n", + "database.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}\n", + "table.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}\n", + "data.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}\n", + "query.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}\n", + "identifier.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}\n", + "user.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}\n", + "persistence.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "response = user.update({\n", + " \"firstname\": \"Martin\",\n", + " \"lastname\": \"Weise\"\n", + "}, user_id)\n", + "print(response)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "response = container.create1({\n", + " \"name\": \"ethmusmir \" + str(uuid.uuid1()),\n", + " \"repository\": \"mariadb\",\n", + " \"tag\": \"10.5\"\n", + "})\n", + "container_id = response.id\n", + "print(response)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "response = container.modify({\n", + " \"action\": \"start\"\n", + "}, container_id)\n", + "time.sleep(5)\n", + "print(response)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "response = database.create({\n", + " \"name\": \"ethmusmir \" + str(uuid.uuid1()),\n", + " \"description\": \"ethmusmir\",\n", + " \"is_public\": False\n", + "}, container_id)\n", + "database_id = response.id\n", + "print(response)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "response = database.update({\n", + " \"description\": \"Feature Vectors extracted with the EthMusMIR Analysis Server https://github.com/ketchupok/ethmusmir applied on a remixed recording of the SeFiRe field recordings dataset https://github.com/matijama/field-recording-db\",\n", + " \"publisher\": \"Technical University of Vienna\",\n", + " \"license\": {\n", + " \"identifier\": \"Apache-2.0\",\n", + " \"uri\": \"https://opensource.org/licenses/Apache-2.0\"\n", + " },\n", + " \"language\": \"en\",\n", + " \"is_public\": False,\n", + " \"publication\": \"2022-07-17\"\n", + "}, container_id, database_id)\n", + "print(response)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "response = table.create({\n", + " \"name\": \"Feature Extraction\",\n", + " \"description\": \"SeFiRe\",\n", + " \"columns\": [{\n", + " \"name\": \"Content\",\n", + " \"type\": \"STRING\",\n", + " \"unique\": False,\n", + " \"primary_key\": False,\n", + " \"null_allowed\": True,\n", + " }, {\n", + " \"name\": \"Start\",\n", + " \"type\": \"NUMBER\",\n", + " \"unique\": False,\n", + " \"primary_key\": False,\n", + " \"null_allowed\": True,\n", + " }, {\n", + " \"name\": \"Duration\",\n", + " \"type\": \"NUMBER\",\n", + " \"unique\": False,\n", + " \"primary_key\": False,\n", + " \"null_allowed\": True,\n", + " }]\n", + "}, container_id, database_id)\n", + "table_id = response.id\n", + "print(response)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 2, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n" + ] + } + ], + "source": [ + "response = broker.send({\n", + " \"date\": \"2021-07-17\",\n", + " \"location\": \"Melaka\",\n", + " \"parameter\": \"CO\",\n", + " \"interval\": \"h1\",\n", + " \"unit\": \"mg/m3\",\n", + " \"value\": 0.3,\n", + " \"status\": \"tentative\"\n", + "})\n", + "print(response)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/.invenio/requirements.txt b/.jupyter/requirements.txt similarity index 100% rename from .invenio/requirements.txt rename to .jupyter/requirements.txt diff --git a/.rabbitmq/api_broker/__pycache__/BrokerServiceClient.cpython-310.pyc b/.rabbitmq/api_broker/__pycache__/BrokerServiceClient.cpython-310.pyc deleted file mode 100644 index e211fe3cda3d7b5e838dfb174395110fe8d9b4e5..0000000000000000000000000000000000000000 Binary files a/.rabbitmq/api_broker/__pycache__/BrokerServiceClient.cpython-310.pyc and /dev/null differ diff --git a/.rabbitmq/publish.ipynb b/.rabbitmq/publish.ipynb deleted file mode 100644 index f46656bc2d456758e15dea1546666ec0e9516b1a..0000000000000000000000000000000000000000 --- a/.rabbitmq/publish.ipynb +++ /dev/null @@ -1,90 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 203, - "metadata": { - "collapsed": true, - "pycharm": { - "name": "#%%\n" - } - }, - "outputs": [], - "source": [ - "from api_broker.BrokerServiceClient import BrokerServiceClient\n", - "\n", - "exchange = \"airquality\"\n", - "routing_key = \"airquality\"\n", - "host = \"localhost\"\n", - "username = \"user\"\n", - "password = \"user\"\n", - "\n", - "broker = BrokerServiceClient(exchange=exchange, routing_key=routing_key, host=host, username=username, password=password)" - ] - }, - { - "cell_type": "markdown", - "source": [ - "Ingest AMQP" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%% md\n" - } - } - }, - { - "cell_type": "code", - "execution_count": 204, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "True\n" - ] - } - ], - "source": [ - "response = broker.send({\n", - " \"date\": \"2021-07-17\",\n", - " \"location\": \"Melaka\",\n", - " \"parameter\": \"CO\",\n", - " \"interval\": \"h1\",\n", - " \"unit\": \"mg/m3\",\n", - " \"value\": 0.3,\n", - " \"status\": \"tentative\"\n", - "})\n", - "print(response)" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - } - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 2 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.6" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/.rabbitmq/requirements.txt b/.rabbitmq/requirements.txt deleted file mode 100644 index 700b460421a7eb5ea93de31049ff011f1d1ed984..0000000000000000000000000000000000000000 --- a/.rabbitmq/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pika==1.3.0 \ No newline at end of file diff --git a/fda-metadata-db/api/src/main/java/at/tuwien/api/database/table/columns/ColumnDto.java b/fda-metadata-db/api/src/main/java/at/tuwien/api/database/table/columns/ColumnDto.java index 3b5ae5781615b4f49cdae3f1b0632393f615b1c4..9c69230acd2a663a062c5cba6fd0edc2efacee21 100644 --- a/fda-metadata-db/api/src/main/java/at/tuwien/api/database/table/columns/ColumnDto.java +++ b/fda-metadata-db/api/src/main/java/at/tuwien/api/database/table/columns/ColumnDto.java @@ -31,7 +31,6 @@ public class ColumnDto { @Parameter(name = "internal name", example = "mdb_date", required = true) private String internalName; - @NotBlank @JsonProperty("date_format") @Parameter(name = "date format", example = "1") private ImageDateDto dateFormat; @@ -51,12 +50,10 @@ public class ColumnDto { @Parameter(name = "type", example = "STRING", required = true) private ColumnTypeDto columnType; - @NotNull @Parameter(name = "unique", example = "true", required = true) @JsonProperty("column_concept") private ConceptDto concept; - @NotNull @Parameter(name = "unique", example = "true", required = true) private Boolean unique; diff --git a/fda-query-service/services/src/main/java/at/tuwien/service/impl/RabbitMqServiceImpl.java b/fda-query-service/services/src/main/java/at/tuwien/service/impl/RabbitMqServiceImpl.java index 20748480fc50b84e0e99d14ced472da987017d60..f1721172668bbb7d9356784785b6ae41d68a50d0 100644 --- a/fda-query-service/services/src/main/java/at/tuwien/service/impl/RabbitMqServiceImpl.java +++ b/fda-query-service/services/src/main/java/at/tuwien/service/impl/RabbitMqServiceImpl.java @@ -1,6 +1,7 @@ package at.tuwien.service.impl; import at.tuwien.api.database.table.TableCsvDto; +import at.tuwien.config.AmqpConfig; import at.tuwien.entities.database.table.Table; import at.tuwien.exception.*; import at.tuwien.service.MessageQueueService; @@ -18,27 +19,30 @@ import org.springframework.web.client.HttpClientErrorException; import java.io.IOException; import java.util.HashMap; +import java.util.concurrent.TimeoutException; @Log4j2 @Service public class RabbitMqServiceImpl implements MessageQueueService { - private final Channel channel; + private Channel channel; + private final AmqpConfig amqpConfig; private final ObjectMapper objectMapper; private final QueryService queryService; private final TableService tableService; @Autowired - public RabbitMqServiceImpl(Channel channel, ObjectMapper objectMapper, QueryService queryService, - TableService tableService) { + public RabbitMqServiceImpl(Channel channel, AmqpConfig amqpConfig, ObjectMapper objectMapper, + QueryService queryService, TableService tableService) { this.channel = channel; + this.amqpConfig = amqpConfig; this.objectMapper = objectMapper; this.queryService = queryService; this.tableService = tableService; } @Transactional(readOnly = true) - private void createConsumer(String routingKey, Long containerId, Long databaseId, Long tableId) throws AmqpException { + protected void createConsumer(String routingKey, Long containerId, Long databaseId, Long tableId) throws AmqpException { try { final String consumerTag = channel.basicConsume(routingKey, true, new Consumer() { @Override @@ -119,14 +123,17 @@ public class RabbitMqServiceImpl implements MessageQueueService { private Boolean hasConsumer(Table table) { try { final AMQP.Queue.DeclareOk response = channel.queueDeclarePassive(table.getTopic()); - log.debug("queue {} has {} messages waiting", table.getTopic(), response.getMessageCount()); - log.debug("queue {} has {} consumers", table.getTopic(), response.getConsumerCount()); + log.trace("queue {} has {} messages waiting", table.getTopic(), response.getMessageCount()); + log.trace("queue {} has {} consumers", table.getTopic(), response.getConsumerCount()); return response.getConsumerCount() > 0; } catch (IOException e) { log.error("Failed to check if queue {} has consumers", table.getTopic()); - /* ignore */ + return false; + } catch (AlreadyClosedException e) { + log.error("Failed to check, channel is already closed: {}", e.getMessage()); + log.throwing(e); + return null; } - return false; } @Override @@ -135,8 +142,17 @@ public class RabbitMqServiceImpl implements MessageQueueService { public void renewConsumers() { tableService.findAll() .forEach(table -> { - if (hasConsumer(table)) { - log.debug("table {} has already one consumer, skipping.", table.getId()); + final Boolean hasConsumer = hasConsumer(table); + if (hasConsumer == null) { + try { + this.channel = amqpConfig.getChannel(); + } catch (IOException | TimeoutException e) { + log.error("Failed to renew channel"); + log.throwing(e); + /* ignore */ + } + } else if (hasConsumer) { + log.trace("table {} has already one consumer, skipping.", table.getId()); return; } try { diff --git a/fda-table-service/rest-service/src/main/java/at/tuwien/endpoints/TableEndpoint.java b/fda-table-service/rest-service/src/main/java/at/tuwien/endpoints/TableEndpoint.java index ee7b7c6e227935aac290362ee6be0cb4bdd95d08..baff04fead52add2f48f34edb57043a7c29725f4 100644 --- a/fda-table-service/rest-service/src/main/java/at/tuwien/endpoints/TableEndpoint.java +++ b/fda-table-service/rest-service/src/main/java/at/tuwien/endpoints/TableEndpoint.java @@ -42,7 +42,7 @@ public class TableEndpoint { @GetMapping @Transactional(readOnly = true) @PreAuthorize("hasRole('ROLE_RESEARCHER') and hasPermission(#databaseId, 'TABLE_VIEW')") - @Operation(summary = "List all tables") + @Operation(summary = "List all tables", security = @SecurityRequirement(name = "bearerAuth")) public ResponseEntity<List<TableBriefDto>> findAll(@NotNull @PathVariable("id") Long containerId, @NotNull @PathVariable("databaseId") Long databaseId, Principal principal) @@ -73,7 +73,7 @@ public class TableEndpoint { @GetMapping("/{tableId}") @Transactional(readOnly = true) @PreAuthorize("hasRole('ROLE_RESEARCHER') and hasPermission(#databaseId, 'TABLE_VIEW')") - @Operation(summary = "Get information about table") + @Operation(summary = "Get information about table", security = @SecurityRequirement(name = "bearerAuth")) public ResponseEntity<TableDto> findById(@NotNull @PathVariable("id") Long containerId, @NotNull @PathVariable("databaseId") Long databaseId, @NotNull @PathVariable("tableId") Long tableId, diff --git a/fda-ui/components/dialogs/EditTuple.vue b/fda-ui/components/dialogs/EditTuple.vue index 3195cb4b1f0a54ef849560436d307f3e79c8fe21..71c8ef80cd972790e72f3311b35dfd68ae12ccb1 100644 --- a/fda-ui/components/dialogs/EditTuple.vue +++ b/fda-ui/components/dialogs/EditTuple.vue @@ -27,9 +27,21 @@ :label="attr.name" type="text" /> <v-text-field - v-if="attr.column_type === 'TIMESTAMP' || attr.column_type === 'DATE'" + v-if="attr.column_type === 'TIMESTAMP'" v-model="tuple[attr.internal_name]" suffix="UTC" + hint="e.g. 2022-07-12 18:32:59" + :rules="[v => /^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$/.test(v) || $t('Required format yyyy-MM-dd HH:mm:ss')]" + class="mb-2" + :required="!attr.is_null_allowed" + :label="attr.name" + type="text" /> + <v-text-field + v-if="attr.column_type === 'DATE'" + v-model="tuple[attr.internal_name]" + suffix="UTC" + hint="e.g. 2022-07-12" + :rules="[v => /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(v) || $t('Required format yyyy-MM-dd')]" class="mb-2" :required="!attr.is_null_allowed" :label="attr.name" diff --git a/fda-ui/pages/container/_container_id/database/_database_id/table/_table_id/index.vue b/fda-ui/pages/container/_container_id/database/_database_id/table/_table_id/index.vue index 60b0ecb24218ca3599a55f877dfc073343585d83..df0ec49cfbf9f5e906c1ee8c84f6609b5c6d5fa1 100644 --- a/fda-ui/pages/container/_container_id/database/_database_id/table/_table_id/index.vue +++ b/fda-ui/pages/container/_container_id/database/_database_id/table/_table_id/index.vue @@ -74,7 +74,7 @@ <script> import EditTuple from '@/components/dialogs/EditTuple' import TimeTravel from '@/components/dialogs/TimeTravel' -import { formatTimestampUTC } from '@/utils' +import { formatTimestampUTC, formatDateUTC } from '@/utils' export default { components: { @@ -237,10 +237,16 @@ export default { } const res = await this.$axios.get(url, this.config) this.total = parseInt(res.headers['fda-count']) + this.rows = res.data.result this.rows = res.data.result.map((row) => { for (const col in row) { - if (this.dateColumns.filter(c => c.internal_name === col).length > 0) { - row[col] = formatTimestampUTC(row[col]) + const columnDefinition = this.dateColumns.filter(c => c.internal_name === col) + if (columnDefinition.length > 0) { + if (columnDefinition[0].column_type === 'DATE') { + row[col] = formatDateUTC(row[col]) + } else if (columnDefinition[0].column_type === 'TIMESTAMP') { + row[col] = formatTimestampUTC(row[col]) + } } } return row