infojunkie / isbn-info.js

Console tools to identify books by their ISBN and output formatted metadata.
GNU General Public License v3.0
4 stars 1 forks source link

Series name #7

Open infojunkie opened 3 years ago

infojunkie commented 3 years ago

Most text books belong to a series (aka ISSN). Extract the series name from the various API queries and provide it as a new placeholder.

infojunkie commented 3 years ago

Looks like Google Books API calls it bibliogroup e.g. https://www.google.ca/search?tbo=p&tbm=bks&q=bibliogroup:%22The+Frontiers+Collection%22&source=gbs_metadata_r&cad=9

infojunkie commented 3 years ago

Asked on SO https://stackoverflow.com/questions/66306183/how-to-retrieve-bibliogroup-from-google-books-api

infojunkie commented 3 years ago

This site provides information about ISSNs in the form of a JSON-LD fragment:

{
    "@context": "http://schema.org/",
    "@id": "https://portal.issn.org/resource/ISSN/1612-3018",
    "@type": "Periodical",
    "exampleOfWork": {
        "@id": "https://portal.issn.org/resource/ISSN-L/1612-3018",
        "@type": "CreativeWork",
        "workExample": [
            {
                "@id": "https://portal.issn.org/resource/ISSN/1612-3018",
                "name": "The frontiers collection (Print)"
            },
            {
                "@id": "https://portal.issn.org/resource/ISSN/2197-6619",
                "name": "The frontiers collection (Internet)"
            }
        ]
    },
    "issn": "1612-3018",
    "identifier": [
        {
            "@type": "PropertyValue",
            "name": "ISSN",
            "value": "1612-3018",
            "description": "Valid"
        },
        {
            "@type": "PropertyValue",
            "name": "ISSN-L",
            "value": "1612-3018",
            "description": "Valid"
        }
    ],
    "name": "The frontiers collection (Print)",
    "alternateName": "The frontiers collection.",
    "publication": {
        "@id": "https://portal.issn.org/resource/ISSN/1612-3018#ReferencePublicationEvent",
        "@type": "PublicationEvent",
        "location": {
            "@id": "https://www.iso.org/obp/ui/#iso:code:3166:DE",
            "@type": "Country",
            "name": "Germany"
        }
    },
    "mainEntityOfPage": {
        "@id": "https://portal.issn.org/resource/ISSN/1612-3018#Record",
        "@type": "CreativeWork",
        "dateModified": "2014-11-29",
        "mainEntity": "https://portal.issn.org/resource/ISSN/1612-3018",
        "sourceOrganization": {
            "@id": "http://issn.org/organization/ISSNCenter#_6",
            "@type": "Organization",
            "name": "ISSN National Centre for Germany"
        },
        "version": "Register"
    },
    "material": "Print"
}

The name attribute is what we're after.

infojunkie commented 3 years ago

It is also necessary to extract an ISSN from a book's content in isbn-extract.sh, something like https://github.com/richdouglasevans/issn/blob/master/issn.js#L6 but optionally prepended with string "ISSN".

infojunkie commented 3 years ago

Properly implementing ISSN extraction requires some large-scale changes in the code, namely passing either a filename or a file's contents to isbn-info to extract ISBN and ISSN. This means merging isbn-detect.js into isbn-info.js, and changing the shell scripts accordingly.