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).
146
-
147
-
*But* providing a single, *general* string representation that makes sense in all cases
148
-
can sometimes be quite a challenge. The general string representation might not fit your
149
-
specific need.
150
-
151
-
Take the `Title` class based on `245`. The string representation doesn't include data
152
-
from `$h` (medium) or `$c` (statement of responsibility, etc.), since that's probably
153
-
not the kind of info most non-librarians would expect to see in a "title". But it currently
154
-
does include everything contained in `$a` and `$b` (except any final `/` ISBD marker),
155
-
which means it doesn't make any attempt of removing parallel titles.<supid="a1">[1](#f1)</sup>
156
-
It also includes text from `$n` (part number) and `$p` (part title), but yet some other
157
-
subfields like `$f`, `$g` and `$k` are currently ignored since I haven't really decided
158
-
whether to include them or not.
159
-
160
-
I would love to remove the ending dot that is present
161
-
in records with explicit ISBD markers, but that's not trivial for the same reason
162
-
identifying parallel titles is not<supid="a1">[1](#f1)</sup> – there's just no safe
163
-
way to tell if the final dot is an ISBD marker or part of the title.<supid="a2">[2](#f2)</sup>
164
-
Since explicit ISBD markers are included in records catalogued in the American tradition,
165
-
but not in records catalogued in the British tradition, a mix of records from both traditions
166
-
will look silly.
167
-
168
-
I hope this makes clear that you need to check if the assumptions and simplifications made
169
-
in the string representation methods makes sense to *your* project or not. It's also not
170
-
unlikely that some methods make false assumptions based on (my) incomplete knowledge of
171
-
cataloguing rules/practice. A developer given just a few MARC records might for instance assume
172
-
that `300 $a` is a subfield for "number of pages".<supid="a3">[3](#f3)</sup> A quick glance
173
-
at e.g. [LC's MARC documentation](https://www.loc.gov/marc/bibliographic/bd300.html) would
174
-
be enough to prove that wrong, but in other cases it's harder to avoid making false assumptions
175
-
without deep familiarity with cataloguing rules and practices.
176
-
177
-
There's also cases where different traditions conflict, and you just have to make a choice.
178
-
Subject subfields, for instance, have to be joined using some kind of glue.
179
-
[LCSHs](https://en.wikipedia.org/wiki/Library_of_Congress_Subject_Headings) are
180
-
ordinarily presented as strings glued together with em-dashes or double en-dashes
181
-
(`650 $aPhysics $xHistory $yHistory` is presented as `Physics--History--20th century`).
182
-
But in other subject heading systems colons are used as the glue (`Physics : History : 20th century`).
183
-
This package defaults to colon, but you change that by setting `Subject::glue = '--'` or whatever.
215
+
The string representation of this field makes use of the constant `Subject::glue`
216
+
to glue subject components together. The default value is a space-padded colon,
217
+
making `Physics : History : 20th century` the string representation of
218
+
`650 $aPhysics $xHistory $yHistory`. If you prefer the "LCSH-way" of
219
+
`Physics--History--20th century`, just set `Subject::glue = '--'`.
184
220
185
221
## Notes
186
222
223
+
It's unfortunately easy to err when trying to present data from MARC records in
224
+
end user applications. A developer learning by example might for instance assume
225
+
that `300 $a` is a subfield for "number of pages".<supid="a3">[3](#f3)</sup> A
226
+
quick glance at e.g. [LC's MARC
227
+
documentation](https://www.loc.gov/marc/bibliographic/bd300.html) would be
228
+
enough to prove that wrong, but in other cases it's harder to avoid making false
229
+
assumptions without deep familiarity with cataloguing rules and practices.
230
+
187
231
<bid="f1">1</b> That might change in the future. But even if I decide to remove parallel titles,
188
232
I'm not really sure how to do it in a safe way. Parallel titles are identified by a leading `=`
189
233
ISBD marker. If the marker is at the end of subfield `$a`, we can be certain it's an ISBD marker,
190
234
but since the `$a` and `$c` subfields are not repeatable, multiple titles are just added to the
191
235
`$c` subfield. So if we encounter an `=` sign in the middle middle of `$c` somewhere, how can we
192
236
tell if it's an ISBD marker or just an equal sign part of the title (like in the fictive book
193
237
`"$aEating the right way : The 2 + 2 = 5 diet"`)? Some kind of escaping would have made that clear,
194
-
but the ISBD principles doesn't seem to call for that, leaving us completely in the dark!
238
+
but the ISBD principles doesn't seem to call for that, leaving us completely in the dark.
0 commit comments