scriptotek / php-marc

Simple interface for working with MARC records using the File_MARC package
MIT License
52 stars 11 forks source link

Handling of 653 fields with multiple $a #6

Closed danmichaelo closed 7 years ago

danmichaelo commented 7 years ago

In all 6XX fields one field maps to one subject. Except 653, where $a is repeatable and each $a represents a separate subject!

With php-marc, Record::getSubjects() returns an array of Subject, with Subject extending Field. So a single 653 field is treated as a single subject with multiple string elements:

[
    {
        "id": null,
        "term": "Statistikk",
        "type": "650",
        "vocabulary": "noubomn"
    },
    {
        "id": null,
        "term": "matematisk : statistikk : sannsynlighet : risiko : populærvitenskap : sannsynlighetsregning",
        "type": "653",
        "vocabulary": null
    },
    {
        "id": null,
        "term": "Populærvitenskap",
        "type": "655",
        "vocabulary": "noubomn"
    }
]

Decoupling Subject from Field would add a lot of extra complexity though.