Пример #1
0
def to_database(metadata):
    print('------------------------------------------------')
    pprint(metadata)

    dnum = metadata['dnum']
    doc_number = metadata['doc-number']
    kind = metadata['kind']
    date_publ = metadata['date-publ']
    status = metadata['status']
    country = metadata['country']
    abstract = metadata['abstract']
    date_file = metadata['date-file']
    date_issue = metadata['date-issue']
    date_priority = metadata['date-priority']
    citations = metadata['citations']
    classifications = metadata['classifications']
    assignees = metadata['assignees']

    DataImport.create_document('FullText', '?', dnum, doc_number, kind, date_publ,
                               status, country, '', abstract, date_file, date_issue, date_priority)

    for citation in citations:
        DataImport.add_citation(doc_number, citation.get('doc-number', ''), citation.get(
            'country', ''), citation.get('kind', ''), date_publ, date_file, date_issue, date_priority)

    for classification in classifications:
        DataImport.add_classification(doc_number, classification.get('section', ''), classification.get('class', ''), classification.get(
            'subclass', ''), classification.get('main-group', ''), classification.get('subgroup', ''), date_publ, date_file, date_issue, date_priority)

    for assignee in assignees:
        DataImport.add_assignee(doc_number, assignee.get('name', ''), assignee.get('epo-number', ''), assignee.get(
            'reference', ''), assignee.get('cross-reference', ''), date_publ, date_file, date_issue, date_priority)

    print('------------------------------------------------')
    print('\n')
Пример #2
0
def create_citation(citer_document, cited_document):
    print('creating citation: ' + citer_document['doc_number'] + '->' +
          cited_document['doc_number'])
    DataImport.add_citation(
        citer_document['doc_number'], cited_document['doc_number'],
        citer_document['country'], citer_document['kind'],
        citer_document['datepublished'], citer_document['filedate'],
        citer_document['issuedate'], citer_document['prioritydate'])
Пример #3
0
def _to_database(typeof, metadata):
    print('------------------------------------------------')
    pprint(metadata)

    date_publ = metadata['date-publ']
    status = metadata['status']
    title = metadata['title']
    abstract = metadata['abstract']
    claims = metadata['claims']
    citations = metadata['citations']
    assignees = metadata['assignees']
    classifications = metadata['classifications']

    description = metadata['description']

    publication_reference = metadata['publication-reference']
    application_reference = metadata['application-reference']

    DataImport.create_us_document(typeof, 'publication', '',
                                  publication_reference.get('doc-number', ''),
                                  publication_reference.get('kind', ''),
                                  date_publ, status,
                                  publication_reference.get('country',
                                                            ''), title,
                                  abstract, '', '', '', claims, description)
    #DataImport.create_document(typeof, 'application', '', application_reference.get('doc-number', ''), '', date_publ, status, application_reference.get('country', ''), title, abstract, '', '', '')

    for citation in citations:
        DataImport.add_citation(publication_reference.get('doc-number', ''),
                                citation.get('doc-number', ''),
                                citation.get('country', ''),
                                citation.get('kind', ''), date_publ, '', '',
                                '')
        DataImport.add_citation(application_reference.get('doc-number', ''),
                                citation.get('doc-number', ''),
                                citation.get('country', ''),
                                citation.get('kind', ''), date_publ, '', '',
                                '')

    for assignee in assignees:
        # TODO: can we rely on assignees alone, or should we test and use parties/applicants if needed?
        DataImport.add_assignee(publication_reference.get('doc-number', ''),
                                assignee.get('orgname', ''), '', '', '',
                                date_publ, '', '', '')
        DataImport.add_assignee(application_reference.get('doc-number', ''),
                                assignee.get('orgname', ''), '', '', '',
                                date_publ, '', '', '')

    for classification in classifications:
        DataImport.add_classification(
            publication_reference.get('doc-number', ''),
            classification.get('section', ''), classification.get('class', ''),
            classification.get('subclass', ''),
            classification.get('main-group', ''),
            classification.get('subgroup', ''), date_publ, '', '', '')
        DataImport.add_classification(
            application_reference.get('doc-number', ''),
            classification.get('section', ''), classification.get('class', ''),
            classification.get('subclass', ''),
            classification.get('main-group', ''),
            classification.get('subgroup', ''), date_publ, '', '', '')

    print('------------------------------------------------')
    print('\n')