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

Doc-number in application-reference overwrites doc-number in publication-reference #7

Open
softwaregravy opened this issue May 12, 2024 · 1 comment

Comments

@softwaregravy
Copy link

When parsing the bibliographical information, we just insert the keys

    invention_title = root_tree.find(invention_title_path)
    document_data = {}    
    if publication_info != None:
        publication_reference_info = {element.tag: element.text for element in list(publication_info)}
        document_data = {**document_data,**publication_reference_info}
    if application_info !=None:
        application_reference_info = {element.tag: element.text for element in list(application_info)}
        if application_info.attrib and application_info.attrib['appl-type']:
            application_reference_info['application_type'] =  application_info.attrib['appl-type']
        document_data = {**document_data,**application_reference_info}

source

An example patent might look like this (xml4)

<publication-reference>
<document-id>
<country>US</country>
<doc-number>09784948</doc-number>
<kind>B2</kind>
<date>20171010</date>
</document-id>
</publication-reference>
<application-reference appl-type="utility">
<document-id>
<country>US</country>
<doc-number>15067369</doc-number>
<date>20160311</date>
</document-id>
</application-reference>

The resulting dictionary lacks the patent id now, containing only the application id:

[{'bibliographic_information': {'country': 'US', 'doc-number': '15067369', 'kind': 'B2', 'date': '20160311', 'invention_title': 'xxx'}}]
@softwaregravy
Copy link
Author

Fix that works for me is here. I prioritize the patent id, so I'm fine omitting other identifiers if it is present.

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