Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Create marc21 record #10

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

philippgualdi
Copy link
Collaborator

@philippgualdi philippgualdi commented Dec 3, 2020

PR notes

Aim
Provide a rest-api can create marc21 records

Demo
Creating a record

`$ curl -X POST -k -H 'Content-Type: application/json' -i 'https://127.0.0.1:5000/api/marc/' \
--data '{{
   "__order__":[
      "control_number_identifier",
      "date_and_time_of_latest_transaction",
      "physical_description_fixed_field_general_information",
      "fixed_length_data_elements",
      "cataloging_source",
      "language_code",
      "country_of_publishing_producing_entity_code",
      "title_statement"
   ],
   "control_number_identifier":"AT-OBV",
   "date_and_time_of_latest_transaction":"20170703041800.0",
   "physical_description_fixed_field_general_information":"cr#|||||||||||",
   "fixed_length_data_elements":"100504|1932####au######o#####|||#|#ger#u",
   "cataloging_source":{
      "__order__":[
         "original_cataloging_agency",
         "language_of_cataloging",
         "modifying_agency",
         "description_conventions"
      ],
      "modifying_agency":[
         "TUW"
      ],
      "original_cataloging_agency":"TUG",
      "language_of_cataloging":"ger",
      "description_conventions":[
         "rakwb"
      ]
   },
   "language_code":[
      {
         "__order__":[
            "language_code_of_text_sound_track_or_separate_title",
            "translation_indication",
            "source_of_code"
         ],
         "language_code_of_text_sound_track_or_separate_title":[
            "ger"
         ],
         "translation_indication":"No information provided",
         "source_of_code":"MARC language code"
      }
   ],
   "country_of_publishing_producing_entity_code":{
      "__order__":[
         "iso_country_code"
      ],
      "iso_country_code":[
         "XA-AT"
      ]
   },
   "title_statement":{
      "__order__":[
         "title",
         "statement_of_responsibility",
         "title_added_entry"
      ],
      "statement_of_responsibility":"hrsg. von Josef Frank",
      "title":"<<Die>> Internationale Werkbundsiedlung Wien 1932",
      "title_added_entry":"No added entry"
   }
}'
`


Now we can search in the /api/marc/ endpoint to see a list of records:

`$ curl -k "https://127.0.0.1:5000/api/marc/?prettyprint=1"`

refactored: version and __init__ python file
changing the rest config of marc21 module to work with newer invenio instance
and init config in records_rest_endpoints. Updating setup requirements using
newer versions and adding marc21 module to the invenio_base.api_apps and
invenio_config.
@philippgualdi philippgualdi requested a review from mb-wali December 3, 2020 12:41
adding sqlalchemy-continuum dependency for failing tests.
@mb-wali
Copy link

mb-wali commented Dec 9, 2020

PR based -

  1. consider resolving the conflicts.
  2. PR description - format the JSON
  3. add more information on why MARC21_UI_EXPORT_FORMATS was removed.

code base -
@utnapischtim and @philippgualdi we should talk over a meeting - and discuss in details the purpose of these changes.
for example why we have a new endpoint? what is the overall purpose of this module?

@utnapischtim
Copy link

@philippgualdi does the order key has to be there?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants