mardi_importer.zbmath module

mardi_importer.zbmath.ZBMathSource module

class mardi_importer.zbmath.ZBMathSource.ZBMathSource(out_dir, tags, from_date=None, until_date=None, raw_dump_path=None, processed_dump_path=None, split_id=None)[source]

Bases: ADataSource

Reads data from zb math API.

create_local_entities()[source]
get_creation_date(xml_record)[source]

Get creation date from xml record.

Parameters:

xml_record (xml element) – record returned by zbMath API

Returns:

creation date

Return type:

string

get_de_number(xml_record)[source]

Get zbMath id from xml record.

Parameters:

xml_record (xml element) – record returned by zbMath API

Returns:

zbMath ID

Return type:

string

get_line()[source]
old_process_data()[source]

Overrides abstract method. Reads a raw zbMath data dump and processes it, then saves it as a csv.

old_write_data_dump()[source]

Overrides abstract method. This method queries the zbMath API to get a data dump of all records, optionally between from_date and until_date

parse_record(xml_record)[source]

Parse xml record from zbMath API.

Parameters:

xml_record (xml element) – record returned by zbMath API

Returns:

dict of (tag,value) pairs extracted from xml_record

Return type:

dict

process_data()[source]

Overrides abstract method. Reads a raw zbMath data dump and processes it, then saves it as a csv.

pull()[source]

Pull data from DataSource

push()[source]

Updates the MaRDI Wikibase entities corresponding to zbMath publications. It creates a mardi_importer.zbmath.ZBMathPublication instance for each publication. Authors and journals are added, as well.

setup()[source]

Create all necessary properties and entities for zbMath

write_data_dump()[source]

Overrides abstract method. This method queries the zbMath API to get a data dump of all records, optionally between from_date and until_date

mardi_importer.zbmath.misc module

mardi_importer.zbmath.misc.get_info_from_doi(doi, key)[source]

Query crossref API for DOI information.

Parameters:
  • doi – doi

  • key – document_title only for now

Returns:

document title

Return type:

title

mardi_importer.zbmath.misc.get_tag(tag_name, namespace)[source]

Returns a fully qualified tag name.

Parameters:
  • tag_name (string) – name of tag, e.g. author

  • namespace (string) – namespace URL of a namespace

mardi_importer.zbmath.misc.parse_doi_info(val, work_info)[source]

Function to extract information returned by a doi query for a specific tag.

Parameters:
  • val (string) – tag, e.g. author

  • work_info (dict) – information from doi query response

Returns:

information for specific tag, None if not found

Return type:

string