VIAF is an international authority database for authors (and other persons), works, and places. Every author in the database is given a unique ID, which can be referred to through an internet link.
The following experiment tests whether authors recorded in the Tyrolis Latina database (mostly with names beginning with B) exist in VIAF. For those that have an entry there, the link leads to VIAF; for others, to the current LBI database.
Why is this important? If we want to aggregate, standardize, and enrich our bibliographies, ensuring their usability and sustainability in the process, we need ways to connect to external resources. This is also a way to check accuracy of records.
Mostly the authors beginning with B. Hover over the link to check where it leads.
We got the data by querying the XML database of Tyrolis Latina authors (converted to TEI) with the following query:
declare namespace TEI="http://www.tei-c.org/ns/1.0"; for $i in //*:persName[1] where $i[text()] order by $i return element n { data($i) }
The list produced by query was then used in another XQuery which queries VIAF API:
(: query viaf for a list of names, get viafID's :) declare namespace ns2="http://viaf.org/viaf/terms#"; declare namespace ns3="http://viaf.org/viaf/terms#"; (: address to which we are sending the queries :) let $url := ("http://www.viaf.org/viaf/search?query=local.personalNames+all+%22REPLACE_URN%22&maximumRecords=1&sortKeys=holdingscount&httpAccept=text/xml") (: model as follows :) (: http://viaf.org/viaf/search?query=[cqlQuery]&maximumRecords=100&startRecord=[startIndex]&sortKeys=holdingscount&httpAccept=text/xml :) return element ol { (: our sequence :) let $rijeci := <a> <n>Azzone, Marcus</n> <n>Bacca, Jakobus a</n> <n>Bacchetoni, Hieronymus L.</n> <n>Bagatini, Nicolaus Antonius</n> <n>Bagatta, Hieronymus</n> (: ... :) <n>Caccia, Franciscus</n> </a> (: for each item in sequence, batches of 100 :) for $r in $rijeci/n let $qrijeci := replace($r, " ", "+") let $parsed := (doc(replace($url,'REPLACE_URN',$qrijeci))) return element li { element a { attribute href { if (empty($parsed//ns2:VIAFCluster/ns2:viafID)) then "http://neolatin.lbg.ac.at/en/database" else concat("http://viaf.org/viaf/",data($parsed//ns2:VIAFCluster/ns2:viafID)) } , data($r) } } }