You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice that we used `isbns` instead of `getIsbns()`. In the same way, you can request `$record->subjects` instead of `$record->getSubjects()`, etc. This is made possible using [a little bit of PHP magic](https://github.com/scriptotek/php-marc/blob/master/src/Fields/Field.php#L19).
111
+
112
+
*But* providing a single, *general* string representation that makes sense in all cases
113
+
can sometimes be quite a challenge. The general string representation might not fit your
114
+
specific need.
115
+
116
+
Take the `Title` class based on `245`. The string representation doesn't include data
117
+
from `$h` (medium) or `$c` (statement of responsibility, etc.), since that's probably
118
+
not the kind of info most non-librarians would expect to see in a "title". But it currently
119
+
does include everything contained in `$a` and `$b` (except any final `/` ISBD marker),
120
+
which means it doesn't make any attempt of removing parallel titles.<supid="a1">[1](#f1)</sup>
121
+
It also includes text from `$n` (part number) and `$p` (part title), but yet some other
122
+
subfields like `$f`, `$g` and `$k` are currently ignored since I haven't really decided
123
+
whether to include them or not.
124
+
125
+
I would love to remove the ending dot that is present
126
+
in records with explicit ISBD markers, but that's not trivial for the same reason
127
+
identifying parallel titles is not<supid="a1">[1](#f1)</sup> – there's just no safe
128
+
way to tell if the final dot is an ISBD marker or part of the title.<supid="a2">[2](#f2)</sup>
129
+
Since explicit ISBD markers are included in records catalogued in the American tradition,
130
+
but not in records catalogued in the British tradition, a mix of records from both traditions
131
+
will look silly.
132
+
133
+
I hope this makes clear that you need to check if the assumptions and simplifications made
134
+
in the string representation methods makes sense to *your* project or not. It's also not
135
+
unlikely that some methods make false assumptions based on (my) incomplete knowledge of
136
+
cataloguing rules/practice. A developer given just a few MARC records might for instance assume
137
+
that `300 $a` is a subfield for "number of pages".<supid="a3">[3](#f3)</sup> A quick glance
138
+
at e.g. [LC's MARC documentation](https://www.loc.gov/marc/bibliographic/bd300.html) would
139
+
be enough to prove that wrong, but in other cases it's harder to avoid making false assumptions
140
+
without deep familiarity with cataloguing rules and practices.
141
+
142
+
There's also cases where different traditions conflict, and you just have to make a choice.
143
+
Subject subfields, for instance, have to be joined using some kind of glue.
144
+
[LCSHs](https://en.wikipedia.org/wiki/Library_of_Congress_Subject_Headings) are
145
+
ordinarily presented as strings glued together with em-dashes or double en-dashes
146
+
(`650 $aPhysics $xHistory $yHistory` is presented as `Physics--History--20th century`).
147
+
But in other subject heading systems colons are used as the glue (`Physics : History : 20th century`).
148
+
This package defaults to colon, but you change that by setting `Subject::glue = '--'` or whatever.
149
+
150
+
## Notes
151
+
152
+
<bid="f1">1</b> That might change in the future. But even if I decide to remove parallel titles,
153
+
I'm not really sure how to do it in a safe way. Parallel titles are identified by a leading `=`
154
+
ISBD marker. If the marker is at the end of subfield `$a`, we can be certain it's an ISBD marker,
155
+
but since the `$a` and `$c` subfields are not repeatable, multiple titles are just added to the
156
+
`$c` subfield. So if we encounter an `=` sign in the middle middle of `$c` somewhere, how can we
157
+
tell if it's an ISBD marker or just an equal sign part of the title (like in the fictive book
158
+
`"$aEating the right way : The 2 + 2 = 5 diet"`)? Some kind of escaping would have made that clear,
159
+
but the ISBD principles doesn't seem to call for that, leaving us completely in the dark!
0 commit comments