{
"translatorID": "fe85e97b-5e2a-4d9e-976e-c336c5350ce9",
"label": "semantics Visual Library",
"creator": "Philipp Zumstein",
"target": "^https?://www\\.(blldb-online\\.de/blldb|bdsl-online\\.de/BDSL-DB)/suche/",
"minVersion": "3.0",
"maxVersion": "",
"priority": 150,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsv",
"lastUpdated": "2014-12-29 11:56:09"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2014 Philipp Zumstein
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see .
***** END LICENSE BLOCK *****
*/
var mappingTypes = {
'Aufsatz in Zeitschrift' : 'journalArticle',
'Journal article' : 'journalArticle',
'Aufsatz in Sammelband' : 'bookSection',
'Book article' : 'bookSection',
'Monographie' : 'book',
'Monograph' : 'book',
'Sammelband' : 'book',
'Anthology' : 'book',
//'Serie' : '',
//'Series' : '',
//'Zeitschrift' : '',
//'Journal' : '',
};
var mapping = {
'Verfasser' : 'author',
'Author' : 'author',
'Beteiligte Pers.' : 'editor',
'Involved pers.' : 'editor',
'Körperschaften' : 'organization',
'Corporation' : 'organization',
'Titel' : 'title',
'Title' : 'title',
//'Original-Titel' : '',
//'Original title' : '',
'Sprache' : 'language',
'Written in' : 'language',
'Language' : 'language',
'Erschienen in' : 'publicationTitle',
'Source' : 'publicationTitle',
'Jahrgang' : 'volume',
'Volume' : 'volume', //but only for journalArticle
'Jahr' : 'date',
'Year' : 'date',
'Heft' : 'issue',
'Issue' : 'issue',
'Seitenangabe' : 'pages',
'Page' : 'pages',
'Serie' : 'series',
'Series' : 'series',
'ISBN' : 'ISBN',
'ISSN' : 'ISSN',
'Auflage' : 'edition',
'Edition' : 'edition',
'Umfang' : 'numPages',
'Extent' : 'numPages',
'Ort : Verlag' : 'publisher',
'Place : Publ.' : 'publisher',
'Hochschulschrift' : 'note',
'Academic paper' : 'note',
'Anmerkung' : 'note',
'Notes' : 'note',
'Zusatztitel' : 'subtitle',
'subtitle' : 'subtitle',
'Teilband' : 'title',
//'Volume' : 'title', //but only for books (will be corrected in the cleanup section if necessary)
'Gesamtwerk' : 'note',
'Part of' : 'note',
};
function detectWeb(doc, url) {
if (url.toLowerCase().indexOf('/titelaufnahme.xml?') != -1 ) {//single item
var type = doc.getElementsByClassName('karteilegende')[0];
if (type && mappingTypes[type.textContent]) {
return mappingTypes[type.textContent];
} else {
Z.debug('not recognized: ' + type);
}
} else if (getSearchResults(doc, true)) {
return "multiple";
}
}
//for testing in detectWeb use true for checkOnly
//for the items in doWeb use false for checkOnly
//then the items will be an object containing the href/title pairs
function getSearchResults(doc, checkOnly) {
var items = {};
var found = false;
var rows = ZU.xpath(doc, '//table[@class="fliesstext"]//td/a[@class="noDeco"]');
for (var i=0; i return "387"
function extractFirstNumber(string) {
return string.replace(/^\D*(\d+).*$/,'$1');
}
function scrape(doc, url) {
var item = new Zotero.Item(detectWeb(doc, url));
var key;
var keyValuePairs = [];
var karteilegende = doc.getElementsByClassName('karteilegende');
for (var j=1; j 2) {//filter out the empty values
var value = sibling[2].textContent;
if (value == 'Hinweise zum Inhalt' || value == 'Selections from contents') {
var link = sibling[2].getElementsByTagName('a')[0];
if (link) {
item.attachments.push({
title : value,
url : link.href,
snapshot : false
});
}
} else {
if (keyValuePairs[key]) {
keyValuePairs[key] += ' : ' + value;
} else {
keyValuePairs[key] = value;
}
}
}
}
//creators
var creatorTypes = ['Verfasser', 'Beteiligte Pers.', 'Author', 'Involved pers.'];
for (var k=0; k",
"creatorType": "contributor",
"fieldMode": 1
}
],
"date": "1998",
"ISBN": "3-7776-0882-3",
"language": "German",
"libraryCatalog": "BLLDB (semantics Visual Library)",
"numPages": "174",
"place": "Stuttgart [u.a.]",
"publisher": "Hirzel",
"shortTitle": "Probleme der Textauswahl für einen elektronischen Thesaurus",
"attachments": [
{
"title": "Snapshot"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://www.bdsl-online.de/BDSL-DB/suche/titelaufnahme.xml?vid={AA8DC9D5-D10C-4C4F-B98D-FB1A5090B582}&contenttype=text/html&Skript=titelaufnahme&Publikation_ID=130721638&lang=de",
"defer": true,
"items": [
{
"itemType": "journalArticle",
"title": "Literatur aus Literatur: zum Tode des Übersetzers Ralph Manheim",
"creators": [
{
"firstName": "Alexander",
"lastName": "Weber",
"creatorType": "author"
}
],
"date": "1992-10-01",
"issue": "229",
"libraryCatalog": "BDSL (semantics Visual Library)",
"pages": "30",
"publicationTitle": "[Frankfurter Allgemeine / D]: Frankfurter Allgemeine",
"shortTitle": "Literatur aus Literatur",
"attachments": [
{
"title": "Snapshot"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://www.bdsl-online.de/BDSL-DB/suche/titelaufnahme.xml?vid={F1F0B146-4489-4299-96EF-4784977E61A4}&contenttype=text/html&Skript=titelaufnahme&Publikation_ID=13389942X&lang=de",
"defer": true,
"items": [
{
"itemType": "book",
"title": "Studienausgabe in Einzelbänden; Madame Legros; sämtliche Schauspiele2",
"creators": [
{
"firstName": "Heinrich",
"lastName": "Mann",
"creatorType": "author"
},
{
"firstName": "Peter-Paul",
"lastName": "Schneider",
"creatorType": "editor"
}
],
"date": "2005",
"ISBN": "3-596-16713-2; 978-3-596-16713-5",
"language": "Deutsch",
"libraryCatalog": "BDSL (semantics Visual Library)",
"numPages": "829",
"place": "Frankfurt am Main",
"publisher": "Fischer-Taschenbuch-Verl.",
"series": "Fischer",
"seriesNumber": "16713 / Heinrich Mann. Hrsg. von Peter-Paul Schneider",
"attachments": [
{
"title": "Snapshot"
}
],
"tags": [],
"notes": [
{
"note": "Anmerkung = Literaturangaben\nGesamtwerk = Studienausgabe in Einzelbänden / Mann, Heinrich / Heinrich Mann. Hrsg. von Peter-Paul Schneider\n"
}
],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://www.bdsl-online.de/BDSL-DB/suche/titelaufnahme.xml?vid={1A778DD2-F52E-4A3A-944F-E06B5E8A5F0A}&contenttype=text/html&Skript=titelaufnahme&Publikation_ID=028514998&lang=de",
"defer": true,
"items": [
{
"itemType": "book",
"title": "The tin drum",
"creators": [
{
"firstName": "Günter",
"lastName": "Grass",
"creatorType": "author"
},
{
"firstName": "Ralph",
"lastName": "Manheim",
"creatorType": "editor"
}
],
"date": "1993",
"ISBN": "1-85715-147-X",
"language": "Englisch",
"libraryCatalog": "BDSL (semantics Visual Library)",
"numPages": "551",
"publisher": "London",
"series": "Everyman's library",
"seriesNumber": "147",
"attachments": [
{
"title": "Snapshot"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/