Hello, Tom, and thanks for your reply. I wrote a long explanation of what I'm doing and how I've tried to do it, clicked "post," and watched it disappear. (So you see what you're dealing with here -- hopeless!). :-)
First, can VIAF return results of SRU requests in JSON? It didn't seem that was possible from the Search Results description on
http://www.oclc.org/developer/documentation/virtual-international-authority-file-viaf/search-resultsI need to search on a column of names in OpenRefine; my search in GREL was:
"
http://www.viaf.org/viaf/search?query=local.personalNames+all+%22"+escape(value, "url")+"%22&version=1.1&operation=searchRetrieve&recordSchema=http%3A%2F%2Fviaf.org%2FVIAFCluster&maximumRecords=10&startRecord=1&recordPacking=xml&sortKeys=holdingscount&httpAccept=text/xml"
The XML result, just for the name Vallee Rudy, was nearly 1500 lines long (viewing it in Oxygen). The XPath to the data I need is basically:
searchRetrieveResponse/records/record/recordData/ns2:/VIAFCluster/ns2:mainHeadings/ns2:/mainHeadingEl[2]/ns2:datafield/ns2:subfield[code='a']/ and .../ns2:subfield[code='d'] when ...ns2:sources/ns2:s has a value of "LC."
That gives me the name and dates of the LC authorized form of name. Given the same path, I also need the value of the sibling following ns2:sources, the value of ns2:id (which is the LC ID number of the name).
The XML returned from VIAF for the pertinent ns2:mainHeadingEl is:
<ns2:mainHeadingEl>
<ns2:datafield dtype="MARC21" ind1="1" ind2=" " tag="100">
<ns2:subfield code="a">Vallée, Rudy,</ns2:subfield>
<ns2:subfield code="d">1901-1986</ns2:subfield>
</ns2:datafield>
<ns2:sources>
<ns2:s>LC</ns2:s>
</ns2:sources>
<ns2:id>LC|n 82152282</ns2:id>
Is there a tutorial or description available that explains how to parse XML in OpenRefine? It looks as though parseHTML() may be used, and I can see that "select" with an element name should extract an element value. Is it important to indicate the XPath to the desired elements and attributes? How is the value of an attribute extracted?
Actually, I'd prefer to reconcile my column of names against VIAF, but there's no way to do that at present, correct? Roderic Page established a reconciliation service for VIAF
http://iphylo.blogspot.com/2013/04/reconciling-author-names-using-open.html but he says it's "fairly crude '' -- seems it was mainly for testing purposes.
Thanks so much.
Marsha