Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create readers for other OAI Metadata Schemas? #49

Open
bhavin2897 opened this issue Nov 15, 2021 · 0 comments
Open

How to create readers for other OAI Metadata Schemas? #49

bhavin2897 opened this issue Nov 15, 2021 · 0 comments

Comments

@bhavin2897
Copy link

I am trying to harvest datasets and metadata from OAI Servers.

I was successful to retrieve metadata from oai_dc, using available, oai_dc-reader.

How can I create a new reader, such that I can harvest GetRecord from other metadata schemas.

Here, I require metadata from DataCite.org which uses oai_datacite.
Currently, I could create a MetadataReader, using normal XML Parser Syntax. But fail to parse or retrieve data.

oai_datacite_reader = MetadataReader(
fields={
    'title':       ('textList', '//resource/titles/title/text()'),
    'creator':     ('textList', '//resource/creator/creator/text()'),
    'subject':     ('textList', '//resource/subjects/subject/text()'),
    'description': ('textList', '//resource/descriptions/description/text()'),
    'publisher':   ('textList', '//resource/publisher/text()'),
    'contributor': ('textList', '//resource/contributors/contributor/text()'),
    'date':        ('textList', '//resource/dates/date/text()'),
    #'type':        ('textList', '//resource/type/text()'),
    'format':      ('textList', '//resource/format/text()'),
    'identifier':  ('textList', '//resource/identifier/text()'),
    #'source':      ('textList', '//resource/source/text()'),
    'language':    ('textList', '//resource/language/text()'),
    'relation':    ('textList', '//resource/relatedIdentifiers/relatedIdentifier/text()'),
    #'coverage':    ('textList', '//resource/coverage/text()'),
    'rights':      ('textList', '//resource/rights/text()'),
    'version':      ('textList', '//resource/version/text()'),
    'publicationYear': ('textList', '//resource/publicationYear/text()')
    },
    namespaces={'oai_datacite:' 'http://datacite.org/schema/kernel-4'}
)

All the field are returned empty.
result:

{"title": [], "creator": [], "subject": [], "description": [], "publisher": [], "contributor": [], "date": [], "format": [], "identifier": [], "language": [], "relation": [], "rights": [], "version": [], "publicationYear": []}

Please give guidance to define a new field metadata reader.

Thanks in advance

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

No branches or pull requests

1 participant