BDRC Public Data Interface
This resource provides direct data access to the BDRC Library.
This work is privided under a Creative Commons C0 1.0 Universal Public Domain Dedication. Although BDRC does not impose any legally binding conditions on access to the Metadata, BDRC requests (as a community norm) that BDRC be given attribution as a source of the data, to the extent it is technologically feasible to do so.
Instructions
Public queries are run via urls of the form:
https://www.tbrc.org/public?module=MMM&query=QQQ&args=AAAA|BBB|CCC
or
https://www.tbrc.org/public?query=QQQ&args=AAAA|BBB|CCC
The first form is used when the module name and the query name are different. The second
form can be used when the module name and the query name are the same. If the query has
no arguments then the args parameter should be omitted. Multiple arguments are separated
by the pipe, '|', character.
Examples:
https://www.tbrc.org/public?query=place&args=G123
and
https://www.tbrc.org/public?module=place&query=layer&args=major
Modules:
84000
- dashboard()
- glossary()
- modules()
- tei(rid)
- tei-html(rid)
- rid -
- returns - element()
- translations()
- unique-tei-elements()
- xml-html(rid)
- rid -
- returns - element()
84000-local-g
- glossary(type)
- type -
- returns - element()
any
This module provides access to any resource by id
- name(rid) :
This query returns the title or name associated with a given Resource IDentifier.
- rid - the Resource IDentifier of the Resource title or name to be retrieved.
- returns - title or name string
archive
- archive() :
This query generates a table of statistics for the current archive and
works in the meta-database.
There is also a link to a csv of the scan requests generated during the
current month to date.
- counts() :
Returns the number of volumes and pages in the archive
- metadata(year) :
This query generates a table of statistics for the metadata items:
Works, Persons, etc
for the given year
- year -
- returns - element()
- page-counts(rid) :
This query returns the number of number of pages given a work RID
- pipeline()
- scanrequests(month, year) :
This query returns a link to a csv of the scan requests generated during the
specified month and year.
- month -
- year -
- returns - element()
- scanrequests-html(month, year)
- month -
- year -
- returns - element()
- stats() :
This query generates a csv of statistics for the current archive and
works in the meta-database
- synced(date) :
This query provides a count of the number of volumes synced since the given date to the present.
Date is yyyy or yyyy-mm or yyyy-mm-dd
- date -
- returns - element()
- synced(start, end) :
This query provides a count of the number of volumes synced between the two given dates.
Dates are yyyy or yyyy-mm or yyyy-mm-dd
- start -
- end -
- returns - element()
- works-html(state)
- state -
- returns - element()
cf
- dashboard()
- glossary()
- modules()
- tei-html(rid)
- rid -
- returns - element()
- translations()
- xml-html(rid)
- rid -
- returns - element()
corporation
This module provides access to the TBRC Image Archive
etext
This module provides access to the TBRC eText Repository
- etext-doc(rid) :
Returns a csv of the etexts associated with the given RID
- rid - to list etexts
- returns - link to csv
- raw-search(qryString) :
This query performs an ft:query over the chunked eTexts and simply returns the
number of hits and a list of the documents containing the hits
- qryString - the query in extended Wylie - sending Tibetan Unicode in
the url seems to be a problem
- returns - the number of hits and the list of document names
- raw-search(qryString, collection)
- qryString -
- collection -
- returns - element()
- report() :
Returns a listing of all eTexts
- search(wq) :
This query calls the global-search:etexts-search with a limit of 100
- wq -
- returns - the full faceted search results as delivered to the app server
- search(path, qryString, near, ordered, limit) :
This query performs a near / proximity search over the selected collection or document. The
query phrase is split into syllables (tsheg bar) and then the query is performed with these
terms within the near / proxiity parameter and taking the order of the syllables into
account or not based on a parameter.
- path - is the collection or document path over which the query will be run. The path is
relative to the base of the eText collection, e.g., UCB-OCR or KarmaDelek
- qryString - is the Wylie or Unicode query phrase
- near - is the proximity factor
- ordered - is either 'yes' or 'no' to indicate whether the order of the syllables in the
$qryString is to be considered in the search
- limit - is the maximum number of matches to be returned
- returns - a document of all of the hits up to the $limit specified
- src-path(rid)
- rid -
- returns - element()
fpl
- catalog()
- catalog-csv()
- count()
image
This module provides access to the TBRC Image Archive
No public functions are defined in this module.
index
This module provides an index for the public modules
- index() :
This function creates the index of public queries dynamically.
- returns - XHTML page listing the public queries for each module.
lineage
- lineage(rid) :
This query returns the Lineage Transmission associated with a given Resource IDentifier.
- rid - the Resource IDentifier of the Lineage to be retrieved.
- returns - XML Lineage Transmission document
- lineage(rid, tib)
- rid -
- tib -
- returns - element()
marc
- marc(rid)
- rid -
- returns - element()
- marc-collection(works)
- works -
- returns - element()
outline
- json-texts(rid)
- rid -
- returns - xs:string
- outlines() :
Produces a list of the outlines in the db and the works they outline
- returns - XML element listing the outlines
- texts(rid)
- rid -
- returns - element()
- texts-csv(rid)
- rid -
- returns - element()
- texts2(rid) :
This query returns the Text nodes of an Outline given a Work Resource IDentifier.
- rid - the Resource IDentifier of the Work .
- returns - XML Outline Nodes of type text
- titles() :
Dumps all the titles in all the nodes of all the outlines in the system
Actually a pretty useless function
- returns - an XML element with all the titles
person
This module provides access to the TBRC Person Registry.
- holders() :
Returns holders lineage transmission documents
- lineages() :
Returns all lineage transmission documents
- person(rid) :
This query returns the Person associated with a given Resource IDentifier.
- rid - the Resource IDentifier of the Person to be retrieved.
- returns - XML Person document
- persons()
- persons-search(qryString, qryStringUni, limit)
- qryString -
- qryStringUni -
- limit -
- returns - element()
- search(uniStr)
- uniStr -
- returns - element()
- search(termStr, mode)
- termStr -
- mode -
- returns - element()
- tulku-titles()
place
This module provides access to the TBRC Place Registry
- geluk-monasteries()
- layer(type) :
This query returns a list of Places of the given type:
printeries - for the known printeries;
major - for the major monasteries;
minor - for the minor monasteries
- type - one of printeries, major, minor
- returns - CSV list of Places classified as
- place(rid) :
This query returns the Place associated with a given Resource IDentifier.
- rid - the Resource IDentifier of the Place to be retrieved.
- returns - XML Place document
- places()
schema
This module provides access to the TBRC Schema Registry.
- schema(name) :
This query returns the XSD Schema with the given name.
- name - the name of the schema to be retrieved.
- returns - the requested XSD Schema
topic
This module provides access to the TBRC Controlled Vocabulary (topic) Registry
- classifiedBy(rid) :
This query returns the Works and Texts classified by a given Topic Resource ID.
- rid - the Resource IDentifier of the Topic to be retrieved.
- returns - XML Topic document
- topic() :
This query returns the Topic associated with a given Resource IDentifier.
- returns - XML Topic document
- topic(rid) :
This query returns the Topic associated with a given Resource IDentifier.
- rid - the Resource IDentifier of the Topic to be retrieved.
- returns - XML Topic document
work
This module provides access to the TBRC Work Registry
- archive() :
TBRC Archive Report
This module returns a CSV file of the up-to-date works in the TBRC Library, as well as those
works accessioned, acquired and othewise in the publication pipeline.
- archive-works(work-list) :
TBRC Archive Report
This module returns a CSV file of the list of works in the TBRC Library.
- work-list -
- returns - CSV file
- catalogInfo()
- count-works()
- ctc-csv(ctcNum) :
This query returns a link to a csv file listing information about the Works contained
in the Core Text Collection of the given number
- ctcNum - number of the Core Text Collection to be retrieved
- returns - Link to csv file
- ctc-list(ctcNum) :
This query returns a list of the works contained in the Core Text Collection of the
given number. The Resource IDentifier for each Work and the primary title of the Work
in Wylie and Unicode is provided. See public:ctc-csv for a more detailed report
- ctcNum - number of the Core Text Collection to be retrieved
- returns - Link to csv file
- fpl-csv() :
Creates a csv file with link to work and title for each Fragile Palm Leaves work
with images in the archive
- returns - link to csv file
- marc(rid) :
Produces a MARC record for a given Work RID
- rid - of the Work
- returns - MARC record
- marc-collection(works) :
Produces a list of MARC records for a given list of Works
- works - sequence of Work RIDs
- returns - MARC record
- marc-collection(works, ggl) :
Produces a list of MARC records for a given list of Works
- works - sequence of Work RIDs
- ggl - if present formats separator for 505 fields as " -- " otherwise "--" is used
- returns - MARC record
- not-on-disk(work-list) :
TBRC Archive Report
This module returns a list of RIDS that are not on disk. Input list of works to check.
- work-list -
- returns - CSV file
- num-vols(wrid) :
returns the number of volumes for the given work RID
- wrid - RID of the work
- returns - number of volumes for the specified work
- outline(rid) :
TBRC Outline Service
This module returns a CSV file of all the texts in an outline, sorted by the vol.
- rid -
- returns - HTML file pointing to the generated CSV file
- product-csv(prod) :
This query returns a link to a csv file listing information about the Works contained
in the given Product
- prod -
- returns - Link to csv file
- title-variants()
- work(rid) :
This query returns the Work associated with a given Resource IDentifier.
- rid - the Resource IDentifier of the Work to be retrieved.
- returns - XML Work document
- work-igs(rid) :
Returns a list of the imagegroups in the volumemap for the given work
- rid - the Work for which the imagegroup RIDs are wanted
- returns - the list of imagegroup RIDs
- worku(rid) :
This query returns the Work associated with a given Resource IDentifier with all Tibetan
language fields in Tibetan Unicode rather than Wylie: title, creator and subject
- rid - the Resource IDentifier of the Work to be retrieved.
- returns - XML Work document
work-local
- archive-headers()
- catalogInfo()
- eTextRids()
- fixClass(s)
- fixSubj(s)
- fixType(s)
- fixup(x)
- fixup2(x, none)
- x -
- none -
- returns - xs:string
- harvard()
- harvard-dataset()
- html(rid)
- rid -
- returns - element()
- html-model(rid)
- rid -
- returns - element()
- license()
- license_bo()
- localize(es)
- make-row(items)
- marc(RID, ggl)
- RID -
- ggl -
- returns - item()
- marc-loop(works, ggl)
- works -
- ggl -
- returns - element()
- nodes(outline)
- outline -
- returns - node()
- ocrPath-for-work(rid)
- rid -
- returns - xs:string
- scan-backlog()
- scanreqs()
- text-titles(text-nodes, vol)
- text-nodes -
- vol -
- returns - node()
- texts(outline)
- outline -
- returns - element()
- titles()
- titles-helper(w)
- utext(text-nodes, vol)
- text-nodes -
- vol -
- returns - xs:string
- uvol(vol)
- vol -
- returns - xs:string
- w2u(input)
- work-exists-on-disk(wrid)
- wrid -
- returns - xs:boolean
- work2row(w, eTextRids)
- w -
- eTextRids -
- returns - node()
- works()
- works-list(works-file)
- works-file -
- returns - node()
- works-not-on-disk(works-file)
- works-file -
- returns - node()
- works-scanned-between(from, to)
- from -
- to -
- returns - node()
- works-scanned-between2(from, to)
- from -
- to -
- returns - node()
- worksInProd(prod)
- write-csv(rows, outPath)
- rows -
- outPath -
- returns - xs:string
work2
This module provides access to the TBRC Work Registry
- incremental-dld(from, to) :
This creates DLD csv for open-access works synced to disk within the interval $fm - $to
for the purpose of building incremental DLDs.
This module returns a CSV file of works in the TBRC Library, that were synced between
the two provided year and month pairs. The format for a year and month pair is:
YYYY-MM
for example,
https://www.tbrc.org/public?module=work2&query=incremental-dld&args=2018-12|2019-03
will return works synced from 2018-12-01 up to but not including 2019-03-01.
If the from and to parameters are the same then a single month is requested
- from - the beginning year month pair
- to - the ending year month pair
- returns - CSV file
- incremental-dld-catalog(locale, catid, prodId) :
This creates a DLD catalog html file for open-access works in a given product
This module returns an html catalog file of works in the TBRC Library, that were synced between
the two provided year and month pairs. The format for a year and month pair is:
YYYY-MM
for example,
https://www.tbrc.org/public?module=work2&query=incremental-dld-catalog&args=bo|dldWMDL07|PR1DOR7
will return link to html dld catalog for works in product PR1DOR7, the WMDL07.
- locale - to generate catalog for
- catid - an identifier of the catalog, e.g., dld2021
- prodId - product RID
- returns - link to html catalog file
- incremental-dld-catalog(locale, catid, from, to) :
This creates a DLD catalog html file for open-access works synced to disk within the interval $fm - $to
This module returns an html catalog file of works in the TBRC Library, that were synced between
the two provided year and month pairs. The format for a year and month pair is:
YYYY-MM
for example,
https://www.tbrc.org/public?module=work2&query=incremental-dld-catalog&args=bo|dld2021|2020-12|2021-01
will return link to html dld catalog for works synced from 2020-12-01 up to but not including 2021-01-01.
If the from and to parameters are the same then a single month is requested
- locale - to generate catalog for
- catid - an identifier of the catalog, e.g., dld2021
- from - the beginning year month pair
- to - the ending year month pair
- returns - link to html catalog file
- works-synced-between(from, to) :
Report Works synced between one month and another month.
This module returns a CSV file of works in the TBRC Library, that were synced between
the two provided year and month pairs. The format for a year and month pair is:
YYYY-MM
for example,
https://www.tbrc.org/public?module=work2&query=works-synced-between&args=2018-12|2019-03
will return works synced from 2018-12-01 up to but not including 2019-03-01.
If the from and to parameters are the same then a single month is requested
- from - the beginning year month pair
- to - the ending year month pair
- returns - CSV file