Commit 4df120ae authored by Georg Petz's avatar Georg Petz

Cataloglink

parent 8c4f6a83
......@@ -120,7 +120,22 @@
" linksJoined = \", \".join(result)\n",
" barcodesJoined = \", \".join(barcodes)\n",
" #returns a list with URLs and Barcodes\n",
" return [linksJoined, barcodesJoined]"
" return [linksJoined, barcodesJoined]\n",
"\n",
"def getCatalogLink(local_mms_id):\n",
" print(local_mms_id)\n",
" cont=requests.get('https://open-na.hosted.exlibrisgroup.com/alma/43ACC_ONB/bf/entity/instance/' + local_mms_id).content\n",
" e = etree.XML(cont)\n",
" namespaces = {\n",
" 'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',\n",
" 'bf': 'http://id.loc.gov/ontologies/bibframe/',\n",
" 'rdfs': 'http://www.w3.org/2000/01/rdf-schema#',\n",
" 'bflc': 'http://id.loc.gov/ontologies/bflc/'\n",
" } \n",
" result = e.xpath('/rdf:RDF/bf:Work/bf:partOf/bf:Work/bf:identifiedBy/bf:Identifier/rdf:value/text()', namespaces=namespaces)\n",
" if not result:\n",
" result = e.xpath('/rdf:RDF/bf:Instance/bf:identifiedBy/bf:Local/rdf:value/text()', namespaces=namespaces)\n",
" return 'http://data.onb.ac.at/rec/' + result[0]"
]
},
{
......@@ -279,9 +294,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "labs",
"language": "python",
"name": "python3"
"name": "labs"
},
"language_info": {
"codemirror_mode": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment