Documentation

MarcCslVariables extends MarcGrok
in package
implements JsonSerializable

Wraps a MARC Record to provide Citation Style Language variables.

Objects of this class can be serialized to CSL JSON, a.k.a. CiteProc JSON:

$obj->jsonSerialize();

OR:

json_encode($obj);

For each CSL variable, this class has a getter. E.g. to get CSL variable title-short, use:

$obj->getTitleShort();

Built from the CSL 1.0.1 Specification docs, accessed 2020-07-30.

Tags
see
https://docs.citationstyles.org/en/stable/specification.html#appendix-iv-variables

List of CSL variables.

see
https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html

CSL JSON markup specification.

see
http://marcspec.github.io/MARCspec/marc-spec.html

MARC-SPEC query language docs.

Interfaces, Classes and Traits

JsonSerializable

Table of Contents

$type  : string
$record  : Record
The MARC record being wrapped.
$container  : array<string|int, mixed>
The container (parent record) info.
$meetings  : array<string|int, mixed>
All meetings.
$names  : array<string|int, mixed>
All names, excluding meetings, series names.
$publication  : array<string|int, mixed>
The publication info (publisher, date, etc.)
$seriesNames  : array<string|int, mixed>
All series names.
__construct()  : mixed
MarcGrok constructor.
getAbstract()  : string
Get the abstract of the item (e.g. the abstract of a journal article).
getAccessed()  : array<string|int, mixed>
Get the date the item has been accessed.
getAll()  : array<string|int, mixed>
Get all CSL variables in CiteProc-JSON compatible format.
getAllMeetings()  : array<string|int, mixed>
Get all meetings.
getAllNames()  : array<string|int, mixed>
Get all personal, corporate and uncontrolled names.
getAllPublicationInfo()  : array<string|int, mixed>
Get all info about publishers, etc.
getAllSeriesNames()  : array<string|int, mixed>
Get all series names.
getAnnote()  : string
Get the reader’s notes about the item content.
getArchive()  : string
Get the archive storing the item.
getArchiveLocation()  : string
Get the storage location within an archive (e.g. a box and folder number).
getArchivePlace()  : string
Get the geographic location of the archive.
getAuthor()  : array<string|int, mixed>
Get the authors.
getAuthority()  : string
Get the issuing or judicial authority.
getCallNumber()  : string
Get the call number (to locate the item in a library).
getChapterNumber()  : string
Get the chapter number.
getCollectionEditor()  : array<string|int, mixed>
Get the editors of the collection holding the item.
getCollectionNumber()  : string
Get the number identifying the collection holding the item.
getCollectionTitle()  : string
Get the title of the collection holding the item.
getComposer()  : array<string|int, mixed>
Get the composers (e.g. of a musical score).
getContainer()  : array<string|int, mixed>
Get the ?.
getContainerAuthor()  : array<string|int, mixed>
Get the authors of the container holding the item.
getContainerInfo()  : array<string|int, mixed>
Get all container (parent record) info.
getContainerTitle()  : string
Get the title of the container holding the item.
getContainerTitleShort()  : string
Get the short/abbreviated form of “container-title”.
getDimensions()  : string
Get the physical (e.g. size) or temporal (e.g. running time) dimensions.
getDirector()  : array<string|int, mixed>
Get the directors (e.g. of a film).
getDoi()  : string
Get the Digital Object Identifier (e.g. “10.1128/AEM.02591-07”).
getEdition()  : string
Get the (container) edition holding the item.
getEditor()  : array<string|int, mixed>
Get the editors.
getEditorialDirector()  : array<string|int, mixed>
Get the managing editors (“Directeur de la Publication” in French).
getEvent()  : string
Get the name of the related event.
getEventDate()  : array<string|int, mixed>
Get the date the related event took place.
getEventPlace()  : string
Get the geographic location of the related event.
getGenre()  : string
Get the class, type or genre of the item.
getIllustrator()  : array<string|int, mixed>
Get the illustrators (e.g. of a children’s book).
getInterviewer()  : array<string|int, mixed>
Get the interviewers (e.g. of an interview).
getIsbn()  : string
Get the International Standard Book Number.
getIssn()  : string
Get the International Standard Serial Number.
getIssue()  : string
Get the (container) issue holding the item.
getIssued()  : array<string|int, mixed>
Get the most recent date the item was issued/published.
getJurisdiction()  : string
Get the geographic scope of relevance (e.g. “US” for a US patent).
getKeyword()  : string
Get the keyword(s) or tag(s) attached to the item.
getMedium()  : string
Get the medium description (e.g. “CD”, “DVD”, etc.).
getNote()  : string
Get the (short) inline note giving additional item details.
getNumber()  : string
Get the number identifying the item (e.g. a report number).
getNumberOfPages()  : string
Get the total number of pages of the cited item.
getNumberOfVolumes()  : string
Get the total number of volumes.
getOriginalAuthor()  : array<string|int, mixed>
Get the original authors?
getOriginalDate()  : array<string|int, mixed>
Get the first/original date the item was issued / published.
getOriginalPublisher()  : string
Get the name of the original publisher.
getOriginalPublisherPlace()  : string
Get the geographic location of the original publisher (e.g. “London, UK”).
getOriginalTitle()  : string
Get the title of the original version.
getPage()  : string
Get the range of pages the item covers in a container.
getPageFirst()  : string
Get the first page of the range of pages the item covers in a container.
getPmcid()  : string
Get the PubMed Central reference number.
getPmid()  : string
Get the PubMed reference number.
getPublisher()  : string
Get the name of the current/latest publisher.
getPublisherPlace()  : string
Get the geographic location of the current/latest publisher.
getRecipient()  : array<string|int, mixed>
Get the recipients (e.g. of a letter).
getRecord()  : Record
Get the wrapped MARC record.
getReferences()  : string
Get the resources related to the procedural history of a legal case.
getReviewedAuthor()  : array<string|int, mixed>
Get the authors of the item reviewed by the current item.
getReviewedTitle()  : string
Get the title of the item reviewed by the current item.
getScale()  : string
Get the scale of e.g. a map.
getSection()  : string
Get the container section holding the item.
getSource()  : string
Get the source from whence the item originates.
getStatus()  : string
Get the (publication) status of the item (e.g. “forthcoming”).
getSubmitted()  : array<string|int, mixed>
Get the date the item has been submitted for publication.
getTitle()  : string
Get the primary title of the item.
getTitleShort()  : string
Get the short/abbreviated form of “title”.
getTranslator()  : array<string|int, mixed>
Get the translators.
getUrl()  : string
Get the Uniform Resource Locator.
getVersion()  : string
Get the version of the item (e.g. “2.0.9” for a software program).
getVolume()  : string
Get the (container) volume holding the item.
jsonSerialize()  : object
Get all CSL variables in CiteProc-JSON compatible format.
extractNames()  : array<string|int, mixed>
Extract names from an X00 or X10 field.
getAllMeetingsNotMemoized()  : array<string|int, mixed>
Get all meetings.
getAllNamesNotMemoized()  : array<string|int, mixed>
Get all personal, corporate and uncontrolled names.
getAllPublicationInfoNotMemoized()  : array<string|int, mixed>
Get all info about publishers, etc.
getAllSeriesNamesNotMemoized()  : array<string|int, mixed>
Get all series names.
getContainerInfoNotMemoized()  : array<string|int, mixed>
Get all container (parent record) info.
wrapDate()  : array<string|int, mixed>|array<string|int, string>
Utility function for wrapping raw strings in array for CSL-JSON.

Properties

$record

The MARC record being wrapped.

protected Record $record

$container

The container (parent record) info.

private array<string|int, mixed> $container = NULL

$meetings

All meetings.

private array<string|int, mixed> $meetings = NULL

$names

All names, excluding meetings, series names.

private array<string|int, mixed> $names = NULL

$publication

The publication info (publisher, date, etc.)

private array<string|int, mixed> $publication = NULL

$seriesNames

All series names.

private array<string|int, mixed> $seriesNames = NULL

Methods

__construct()

MarcGrok constructor.

public __construct(Record $record) : mixed
Parameters
$record : Record

The MARC record to wrap.

Return values
mixed

getAbstract()

Get the abstract of the item (e.g. the abstract of a journal article).

public getAbstract() : string
  • CSL: abstract
  • MARC: ?

TODO: Use 520[0]$a$b, but only if first indicator is 3.

Return values
string

getAccessed()

Get the date the item has been accessed.

public getAccessed() : array<string|int, mixed>
  • CSL: accessed
  • MARC: TODO
Return values
array<string|int, mixed>

getAll()

Get all CSL variables in CiteProc-JSON compatible format.

public getAll() : array<string|int, mixed>
Return values
array<string|int, mixed>

Associative array of all available CSL variables.

getAllMeetings()

Get all meetings.

public getAllMeetings() : array<string|int, mixed>

Memoized. See getAllMeetingsNotMemoized for details.

Tags
see
MarcGrok::getAllMeetingsNotMemoized()
Return values
array<string|int, mixed>

An array of arrays containing CSL name variables, keyed by relator code.

getAllNames()

Get all personal, corporate and uncontrolled names.

public getAllNames() : array<string|int, mixed>

Memoized. See getAllNamesNotMemoized for details.

Tags
see
MarcGrok::getAllNamesNotMemoized()
Return values
array<string|int, mixed>

An array of arrays containing CSL name variables, keyed by relator code.

getAllPublicationInfo()

Get all info about publishers, etc.

public getAllPublicationInfo() : array<string|int, mixed>

Memoized. See getAllPublicationInfoNotMemoized for details.

Tags
see
MarcGrok::getAllPublicationInfoNotMemoized
Return values
array<string|int, mixed>

Associative array of publication info.

getAllSeriesNames()

Get all series names.

public getAllSeriesNames() : array<string|int, mixed>

Memoized. See getAllSeriesNamesNotMemoized for details.

Tags
see
MarcGrok::getAllSeriesNamesNotMemoized()
Return values
array<string|int, mixed>

An array of arrays containing CSL name variables, keyed by relator code.

getAnnote()

Get the reader’s notes about the item content.

public getAnnote() : string
  • CSL: annote
  • MARC: ?

TODO: Maybe use 500[0]$a ?

Return values
string

getArchive()

Get the archive storing the item.

public getArchive() : string
  • CSL: archive
  • MARC: ?

TODO: Find the correct MARC record.

  • 535[0]$a ?
  • 850[0]$a ?
  • 852[0]$a$b ?
Return values
string

getArchiveLocation()

Get the storage location within an archive (e.g. a box and folder number).

public getArchiveLocation() : string
  • CSL: archive-location
  • MARC: ?

TODO: 852[0]$c ?

Return values
string

getArchivePlace()

Get the geographic location of the archive.

public getArchivePlace() : string
  • CSL: archive-place
  • MARC: ?

TODO: 852[0]$e ?

Return values
string

getAuthor()

Get the authors.

public getAuthor() : array<string|int, mixed>
  • CSL: author
  • MARC: 100, 110, 600, 610, 700, 710 or 720.

See getAllNamesNotMemoized and extractNames for more info on the specific MARC subfields. In general, the main author should be in 100$a$b.

Tags
see
MarcGrok::getAllNamesNotMemoized()
see
MarcGrok::extractNames()
see
https://www.loc.gov/marc/bibliographic/bdx00.html
see
https://www.loc.gov/marc/bibliographic/bdx10.html
see
https://www.loc.gov/marc/bibliographic/bd720.html
see
https://www.loc.gov/marc/relators/relaterm.html
Return values
array<string|int, mixed>

getAuthority()

Get the issuing or judicial authority.

public getAuthority() : string

(e.g. “USPTO” for a patent, “Fairfax Circuit Court” for a legal case).

  • CSL: authority
  • MARC: ?

TODO: Find the correct MARC record.

Return values
string

getCallNumber()

Get the call number (to locate the item in a library).

public getCallNumber() : string
  • CSL: call-number
  • MARC: 082[0]$a
    • 082 - Dewey Decimal Classification Number (R)
      • $a - Classification number (R)

TODO: Support other types of call numbers.

Tags
see
https://www.loc.gov/marc/bibliographic/bd082.html
Return values
string

getCollectionEditor()

Get the editors of the collection holding the item.

public getCollectionEditor() : array<string|int, mixed>

(e.g. the series editor for a book).

  • CSL: collection-editor
  • MARC: 800 or 810
Tags
see
MarcGrok::getAllSeriesNamesNotMemoized()
see
MarcGrok::extractNames()
see
https://www.loc.gov/marc/bibliographic/bdx00.html
see
https://www.loc.gov/marc/bibliographic/bdx10.html
see
https://www.loc.gov/marc/relators/relaterm.html
Return values
array<string|int, mixed>

getCollectionNumber()

Get the number identifying the collection holding the item.

public getCollectionNumber() : string

(e.g. the series number for a book).

  • CSL: collection-number
  • MARC:
    • 490 - Series Statement (R)
      • $v - Volume/sequential designation (R)
    • 830 - Series Added Entry-Uniform Title (R)
      • $v - Volume/sequential designation (NR)
Return values
string

getCollectionTitle()

Get the title of the collection holding the item.

public getCollectionTitle() : string

(e.g. the series title for a book).

  • CSL: collection-title
  • MARC:
    • 490[0]$a
      • 490 - Series Statement (R)
        • $a - Series statement (R)
    • 830[0]$a
      • 830 - Series Added Entry-Uniform Title (R)
        • $a - Uniform title (NR)
    • 760[0]$t
      • 760 - Main Series Entry (R)
        • $t - Title (NR)
Tags
see
https://www.loc.gov/marc/bibliographic/bd490.html
see
https://www.loc.gov/marc/bibliographic/bd830.html
see
https://www.loc.gov/marc/bibliographic/bd760.html
Return values
string

getComposer()

Get the composers (e.g. of a musical score).

public getComposer() : array<string|int, mixed>
  • CSL: composer
  • MARC: 100, 110, 600, 610, 700, 710 or 720.

See getAllNamesNotMemoized and extractNames for more info on the specific MARC subfields. In general, the main author should be in 100$a$b.

Tags
see
MarcGrok::getAllNamesNotMemoized()
see
MarcGrok::extractNames()
see
https://www.loc.gov/marc/bibliographic/bdx00.html
see
https://www.loc.gov/marc/bibliographic/bdx10.html
see
https://www.loc.gov/marc/bibliographic/bd720.html
see
https://www.loc.gov/marc/relators/relaterm.html
Return values
array<string|int, mixed>

getContainer()

Get the ?.

public getContainer() : array<string|int, mixed>

This CSL variable has no documentation. Even the CSL spec lists this as "?".

  • CSL: container
  • MARC: ???
Return values
array<string|int, mixed>

getContainerInfo()

Get all container (parent record) info.

public getContainerInfo() : array<string|int, mixed>

Memoized. See getContainerInfoNotMemoized for more info.

Tags
see
MarcGrok::getContainerInfoNotMemoized()
Return values
array<string|int, mixed>

Associative array of container info.

getDimensions()

Get the physical (e.g. size) or temporal (e.g. running time) dimensions.

public getDimensions() : string
  • CSL: dimensions
  • MARC: ???
Return values
string

getDirector()

Get the directors (e.g. of a film).

public getDirector() : array<string|int, mixed>
  • CSL: director
  • MARC: 100, 110, 600, 610, 700, 710 or 720.

See getAllNamesNotMemoized and extractNames for more info on the specific MARC subfields. In general, the main author should be in 100$a$b.

Tags
see
MarcGrok::getAllNamesNotMemoized()
see
MarcGrok::extractNames()
see
https://www.loc.gov/marc/bibliographic/bdx00.html
see
https://www.loc.gov/marc/bibliographic/bdx10.html
see
https://www.loc.gov/marc/bibliographic/bd720.html
see
https://www.loc.gov/marc/relators/relaterm.html
Return values
array<string|int, mixed>

getDoi()

Get the Digital Object Identifier (e.g. “10.1128/AEM.02591-07”).

public getDoi() : string
  • CSL: doi
  • MARC: ???
Return values
string

getEdition()

Get the (container) edition holding the item.

public getEdition() : string

(e.g. “3” when citing a chapter in the third edition of a book).

  • CSL: edition
  • MARC: 773$b or 250[0]$a
    • 773 - Host Item Entry (R)
      • $b - Edition (NR)
    • 250 - Edition Statement (R)
      • $a - Edition statement (NR)
Tags
see
MarcGrok::getContainerInfoNotMemoized()
see
https://www.loc.gov/marc/bibliographic/bd773.html
see
https://www.loc.gov/marc/bibliographic/bd250.html
Return values
string

getEditor()

Get the editors.

public getEditor() : array<string|int, mixed>
  • CSL: editor
  • MARC: 100, 110, 600, 610, 700, 710 or 720.

See getAllNamesNotMemoized and extractNames for more info on the specific MARC subfields. In general, the main author should be in 100$a$b.

Tags
see
MarcGrok::getAllNamesNotMemoized()
see
MarcGrok::extractNames()
see
https://www.loc.gov/marc/bibliographic/bdx00.html
see
https://www.loc.gov/marc/bibliographic/bdx10.html
see
https://www.loc.gov/marc/bibliographic/bd720.html
see
https://www.loc.gov/marc/relators/relaterm.html
Return values
array<string|int, mixed>

getEditorialDirector()

Get the managing editors (“Directeur de la Publication” in French).

public getEditorialDirector() : array<string|int, mixed>
  • CSL: editorial-director
  • MARC: 100, 110, 600, 610, 700, 710 or 720.

See getAllNamesNotMemoized and extractNames for more info on the specific MARC subfields. In general, the main author should be in 100$a$b.

Tags
see
MarcGrok::getAllNamesNotMemoized()
see
MarcGrok::extractNames()
see
https://www.loc.gov/marc/bibliographic/bdx00.html
see
https://www.loc.gov/marc/bibliographic/bdx10.html
see
https://www.loc.gov/marc/bibliographic/bd720.html
see
https://www.loc.gov/marc/relators/relaterm.html
Return values
array<string|int, mixed>

getGenre()

Get the class, type or genre of the item.

public getGenre() : string

(e.g. “adventure” for an adventure movie, “PhD dissertation” for a PhD thesis).

  • CSL: genre
  • MARC: TODO
Return values
string

getIllustrator()

Get the illustrators (e.g. of a children’s book).

public getIllustrator() : array<string|int, mixed>
  • CSL: illustrator
  • MARC: 100, 110, 600, 610, 700, 710 or 720.

See getAllNamesNotMemoized and extractNames for more info on the specific MARC subfields. In general, the main author should be in 100$a$b.

Tags
see
MarcGrok::getAllNamesNotMemoized()
see
MarcGrok::extractNames()
see
https://www.loc.gov/marc/bibliographic/bdx00.html
see
https://www.loc.gov/marc/bibliographic/bdx10.html
see
https://www.loc.gov/marc/bibliographic/bd720.html
see
https://www.loc.gov/marc/relators/relaterm.html
Return values
array<string|int, mixed>

getInterviewer()

Get the interviewers (e.g. of an interview).

public getInterviewer() : array<string|int, mixed>
  • CSL: interviewer
  • MARC: 100, 110, 600, 610, 700, 710 or 720.

See getAllNamesNotMemoized and extractNames for more info on the specific MARC subfields. In general, the main author should be in 100$a$b.

Tags
see
MarcGrok::getAllNamesNotMemoized()
see
MarcGrok::extractNames()
see
https://www.loc.gov/marc/bibliographic/bdx00.html
see
https://www.loc.gov/marc/bibliographic/bdx10.html
see
https://www.loc.gov/marc/bibliographic/bd720.html
see
https://www.loc.gov/marc/relators/relaterm.html
Return values
array<string|int, mixed>

getIssued()

Get the most recent date the item was issued/published.

public getIssued() : array<string|int, mixed>
  • CSL: issued
  • MARC:
    • 260 - Publication, Distribution, etc. (Imprint) (R)
      • $c - Date of publication, distribution, etc. (R)
    • 264 - Production, Publication, Distribution, Manufacture, and Copyright Notice (R)
      • $c - Date of production, publication, distribution, manufacture, or copyright notice (R)
    • 773 - Host Item Entry (R)
      • $g - Related parts (R) -> extract date from parentheses.
Tags
see
MarcGrok::getAllPublicationInfoNotMemoized()
see
MarcGrok::getContainerInfoNotMemoized()
see
https://www.loc.gov/marc/bibliographic/bd260.html
see
https://www.loc.gov/marc/bibliographic/bd264.html
Return values
array<string|int, mixed>

getJurisdiction()

Get the geographic scope of relevance (e.g. “US” for a US patent).

public getJurisdiction() : string
  • CSL: jurisdiction
  • MARC: TODO
Return values
string

getKeyword()

Get the keyword(s) or tag(s) attached to the item.

public getKeyword() : string
  • CSL: keyword
  • MARC: TODO
Return values
string

getMedium()

Get the medium description (e.g. “CD”, “DVD”, etc.).

public getMedium() : string
  • CSL: medium
  • MARC: TODO
Return values
string

getNote()

Get the (short) inline note giving additional item details.

public getNote() : string

(e.g. a concise summary or commentary).

  • CSL: note
  • MARC: TODO
Return values
string

getNumber()

Get the number identifying the item (e.g. a report number).

public getNumber() : string
  • CSL: number
  • MARC: ???
Return values
string

getNumberOfPages()

Get the total number of pages of the cited item.

public getNumberOfPages() : string
  • CSL: number-of-pages
  • MARC: TODO
Return values
string

getNumberOfVolumes()

Get the total number of volumes.

public getNumberOfVolumes() : string

Usable for citing multi-volume books and such.

  • CSL: number-of-volumes
  • MARC: TODO
Return values
string

getOriginalAuthor()

Get the original authors?

public getOriginalAuthor() : array<string|int, mixed>
  • CSL: original-author
  • MARC: TODO
Return values
array<string|int, mixed>

getOriginalDate()

Get the first/original date the item was issued / published.

public getOriginalDate() : array<string|int, mixed>
  • CSL: original-date
  • MARC:
    • 260 - Publication, Distribution, etc. (Imprint) (R)
      • $c - Date of publication, distribution, etc. (R)
    • 264 - Production, Publication, Distribution, Manufacture, and Copyright Notice (R)
      • $c - Date of production, publication, distribution, manufacture, or copyright notice (R)
Tags
see
MarcGrok::getAllPublicationInfoNotMemoized()
see
https://www.loc.gov/marc/bibliographic/bd260.html
see
https://www.loc.gov/marc/bibliographic/bd264.html
Return values
array<string|int, mixed>

getOriginalPublisher()

Get the name of the original publisher.

public getOriginalPublisher() : string

For items that have been republished by a different publisher.

  • CSL: original-publisher
  • MARC:
    • 260 - Publication, Distribution, etc. (Imprint) (R)
      • $b - Name of publisher, distributor, etc. (R)
    • 264 - Production, Publication, Distribution, Manufacture, and Copyright Notice (R)
      • $b - Name of producer, publisher, distributor, manufacturer (R)
Tags
see
MarcGrok::getAllPublicationInfoNotMemoized()
see
https://www.loc.gov/marc/bibliographic/bd260.html
see
https://www.loc.gov/marc/bibliographic/bd264.html
Return values
string

getOriginalPublisherPlace()

Get the geographic location of the original publisher (e.g. “London, UK”).

public getOriginalPublisherPlace() : string
  • CSL: original-publisher-place
  • MARC:
    • 260 - Publication, Distribution, etc. (Imprint) (R)
      • $a - Place of publication, distribution, etc. (R)
    • 264 - Production, Publication, Distribution, Manufacture, and Copyright Notice (R)
      • $a - Place of production, publication, distribution, manufacture
Tags
see
MarcGrok::getAllPublicationInfoNotMemoized()
see
https://www.loc.gov/marc/bibliographic/bd260.html
see
https://www.loc.gov/marc/bibliographic/bd264.html
Return values
string

getOriginalTitle()

Get the title of the original version.

public getOriginalTitle() : string

(e.g. “Война и мир”, the untranslated Russian title of “War and Peace”).

  • CSL: original-title
  • MARC: 247[0]$a$b
    • 247 - Former Title (R)
      • $a - Title (NR)
      • $b - Remainder of title (NR)
Return values
string

getPage()

Get the range of pages the item covers in a container.

public getPage() : string

E.g. range of pages covered by journal article in journal issue.

  • CSL: page
  • MARC: 773$g OR 773$q
    • 773 - Host Item Entry (R)
      • $g - Related parts (R)
      • $q - Enumeration and first page (NR)

$g is considered before $q, since $g may contain a range of pages, but $q only contains the first page.

Tags
see
MarcGrok::getContainerInfoNotMemoized()
see
https://www.loc.gov/marc/bibliographic/bd773.html
Return values
string

getPmcid()

Get the PubMed Central reference number.

public getPmcid() : string
  • CSL: pmcid
  • MARC: TODO
Return values
string

getPmid()

Get the PubMed reference number.

public getPmid() : string
  • CSL: pmid
  • MARC: TODO
Return values
string

getPublisher()

Get the name of the current/latest publisher.

public getPublisher() : string
  • CSL: publisher
  • MARC:
    • 260 - Publication, Distribution, etc. (Imprint) (R)
      • $b - Name of publisher, distributor, etc. (R)
    • 264 - Production, Publication, Distribution, Manufacture, and Copyright Notice (R)
      • $b - Name of producer, publisher, distributor, manufacturer (R)
Tags
see
MarcGrok::getAllPublicationInfoNotMemoized()
see
https://www.loc.gov/marc/bibliographic/bd260.html
see
https://www.loc.gov/marc/bibliographic/bd264.html
Return values
string

getPublisherPlace()

Get the geographic location of the current/latest publisher.

public getPublisherPlace() : string
  • CSL: publisher-place
  • MARC:
    • 260 - Publication, Distribution, etc. (Imprint) (R)
      • $a - Place of publication, distribution, etc. (R)
    • 264 - Production, Publication, Distribution, Manufacture, and Copyright Notice (R)
      • $a - Place of production, publication, distribution, manufacture
Tags
see
MarcGrok::getAllPublicationInfoNotMemoized()
see
https://www.loc.gov/marc/bibliographic/bd260.html
see
https://www.loc.gov/marc/bibliographic/bd264.html
Return values
string

getRecipient()

Get the recipients (e.g. of a letter).

public getRecipient() : array<string|int, mixed>
  • CSL: recipient
  • MARC: 100, 110, 600, 610, 700, 710 or 720.

See getAllNamesNotMemoized and extractNames for more info on the specific MARC subfields. In general, the main author should be in 100$a$b.

Tags
see
MarcGrok::getAllNamesNotMemoized()
see
MarcGrok::extractNames()
see
https://www.loc.gov/marc/bibliographic/bdx00.html
see
https://www.loc.gov/marc/bibliographic/bdx10.html
see
https://www.loc.gov/marc/bibliographic/bd720.html
see
https://www.loc.gov/marc/relators/relaterm.html
Return values
array<string|int, mixed>

getRecord()

Get the wrapped MARC record.

public getRecord() : Record
Return values
Record

The MARC record.

getReferences()

Get the resources related to the procedural history of a legal case.

public getReferences() : string
  • CSL: references
  • MARC: TODO
Return values
string

getReviewedAuthor()

Get the authors of the item reviewed by the current item.

public getReviewedAuthor() : array<string|int, mixed>
  • CSL: reviewed-author
  • MARC: TODO
Return values
array<string|int, mixed>

getReviewedTitle()

Get the title of the item reviewed by the current item.

public getReviewedTitle() : string
  • CSL: reviewed-title
  • MARC: TODO
Return values
string

getScale()

Get the scale of e.g. a map.

public getScale() : string
  • CSL: scale
  • MARC: TODO
Return values
string

getSource()

Get the source from whence the item originates.

public getSource() : string

(e.g. a library catalog or database).

  • CSL: source
  • MARC: TODO
Return values
string

getStatus()

Get the (publication) status of the item (e.g. “forthcoming”).

public getStatus() : string
  • CSL: status
  • MARC: TODO
Return values
string

getSubmitted()

Get the date the item has been submitted for publication.

public getSubmitted() : array<string|int, mixed>
  • CSL: submitted
  • MARC: TODO
Return values
array<string|int, mixed>

getTranslator()

Get the translators.

public getTranslator() : array<string|int, mixed>
  • CSL: translator
  • MARC: 100, 110, 600, 610, 700, 710 or 720.

See getAllNamesNotMemoized and extractNames for more info on the specific MARC subfields. In general, the main author should be in 100$a$b.

Tags
see
MarcGrok::getAllNamesNotMemoized()
see
MarcGrok::extractNames()
see
https://www.loc.gov/marc/bibliographic/bdx00.html
see
https://www.loc.gov/marc/bibliographic/bdx10.html
see
https://www.loc.gov/marc/bibliographic/bd720.html
see
https://www.loc.gov/marc/relators/relaterm.html
Return values
array<string|int, mixed>

getUrl()

Get the Uniform Resource Locator.

public getUrl() : string

(e.g. “http://aem.asm.org/cgi/content/full/74/9/2766”).

  • CSL: url
  • MARC: 856[0]$u
    • 856 - Electronic Location and Access (R)
      • $u - Uniform Resource Identifier (R)

TODO: There are probably many other fields that may contain URLs.

Return values
string

getVersion()

Get the version of the item (e.g. “2.0.9” for a software program).

public getVersion() : string
  • CSL: version
  • MARC: TODO
Return values
string

jsonSerialize()

Get all CSL variables in CiteProc-JSON compatible format.

public jsonSerialize() : object

Convert to object to conform to the JsonSerializable interface.

Return values
object

JSON-serializable object.

extractNames()

Extract names from an X00 or X10 field.

protected extractNames(string $tag) : array<string|int, mixed>

MARC: Any tag containing personal names (X00) or corporate names (X10).

  • X00 - Personal Names-General Information
    • $a - Personal name (NR)
    • $c - Titles and words associated with a name (R)
    • $e - Relator term (R)
  • X10 - Corporate Names-General Information
    • $a - Corporate name or jurisdiction name as entry element (NR)
    • $c - Location of meeting (R)
    • $e - Relator term (R)
Parameters
$tag : string

The tag of the field from which to extract the names.

Tags
see
https://www.loc.gov/marc/bibliographic/bdx00.html
see
https://www.loc.gov/marc/bibliographic/bdx10.html
see
https://www.loc.gov/marc/relators/relaterm.html
see
https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html#name-fields
Return values
array<string|int, mixed>

An array of arrays, each serializable to CSL-JSON name variables.

getAllMeetingsNotMemoized()

Get all meetings.

private getAllMeetingsNotMemoized() : array<string|int, mixed>

Excludes:

  • meetings in 611, because they are the subjects of the work, rather than contributors.

Not memoized.

Tags
see
https://www.loc.gov/marc/bibliographic/bdx11.html
Return values
array<string|int, mixed>

An array of meetings. Each meeting can have the following keys:

  • name: string
  • locations: array of strings
  • dates: array of strings

getAllNamesNotMemoized()

Get all personal, corporate and uncontrolled names.

private getAllNamesNotMemoized() : array<string|int, mixed>

Excludes:

  • meeting names
  • series names
  • names in 600 and 610, because they are the subjects of the work, rather than contributors.

Not memoized.

Tags
see
https://www.loc.gov/marc/bibliographic/bdx00.html
see
https://www.loc.gov/marc/bibliographic/bdx10.html
see
https://www.loc.gov/marc/bibliographic/bd720.html
see
https://www.loc.gov/marc/relators/relaterm.html
Return values
array<string|int, mixed>

An array of arrays containing CSL name variables, keyed by relator code.

getAllPublicationInfoNotMemoized()

Get all info about publishers, etc.

private getAllPublicationInfoNotMemoized() : array<string|int, mixed>

Not memoized.

MARC:

  • 260 - Publication, Distribution, etc. (Imprint) (R)
    • $a - Place of publication, distribution, etc. (R)
    • $b - Name of publisher, distributor, etc. (R)
    • $c - Date of publication, distribution, etc. (R)
    • $e - Place of manufacture (R)
    • $f - Manufacturer (R)
    • $g - Date of manufacture (R)
  • 264 - Production, Publication, Distribution, Manufacture, and Copyright Notice (R)
    • $a - Place of production, publication, distribution, manufacture
    • $b - Name of producer, publisher, distributor, manufacturer (R)
    • $c - Date of production, publication, distribution, manufacture, or copyright notice (R)

Results are grouped by the named entity's function (e.g. publisher, producer, etc.). Each group is sorted, first by the first indicator, then by date, so that the current/latest entity is listed first,

To keep things simple, we support the repeated fields, but not repeated subfields here. We simply use the first subfield if available.

Tags
see
https://www.loc.gov/marc/bibliographic/bd260.html
see
https://www.loc.gov/marc/bibliographic/bd264.html
Return values
array<string|int, mixed>

Associative array of publication info.

getContainerInfoNotMemoized()

Get all container (parent record) info.

private getContainerInfoNotMemoized() : array<string|int, mixed>

Not memoized.

MARC: 773 - Host Item Entry (R)

  • $t - Title (NR) -> title
  • $p - Abbreviated title (NR) -> title_short
  • $g - Related parts (R) -> pages, number, volume, part, date
  • $q - Enumeration and first page (NR) -> first page, number, volume, part
  • $b - Edition (NR) -> edition
  • $a - Main entry heading (NR) -> authors

Subfield $q is considered before subfield $g for number, volume and part, because it uses a fixed format which can be reliably parsed. However, if a range of pages needs to be specified, we have to get it is from $g, since $q only contains the first page in the range.

Tags
see
https://www.loc.gov/marc/bibliographic/bd773.html
Return values
array<string|int, mixed>

Associative array of container info.

wrapDate()

Utility function for wrapping raw strings in array for CSL-JSON.

private static wrapDate([string|null $raw = NULL ]) : array<string|int, mixed>|array<string|int, string>
Parameters
$raw : string|null = NULL

The date string.

Return values
array<string|int, mixed>|array<string|int, string>

An array like ['raw' => 'October 1998'] if the string is not empty. Otherwise [].

Search results