Permalink
Browse files

Update search and import translators (#1316)

* Update tests in Airiti.js
* Update test in DataCite.js, activate all browserSupport
* Update tests, browserSupport in other search translators
* Import translators: add test cases, more browser support
* Bump timestamps
* [DataCite.js] Add doi in extra field if no DOI field
  • Loading branch information...
zuphilip authored and adam3smith committed Jun 4, 2017
1 parent 3376a48 commit f5be7bae292960a2467eec987eb4f12f2e4dba77
Showing with 218 additions and 63 deletions.
  1. +2 −1 Airiti.js
  2. +74 −33 Bibliontology RDF.js
  3. +2 −2 Bookmarks.js
  4. +36 −2 CSL JSON.js
  5. +16 −7 DataCite.js
  6. +2 −2 EIDR.js
  7. +7 −5 Gemeinsamer Bibliotheksverbund ISBN.js
  8. +5 −4 Library of Congress ISBN.js
  9. +1 −1 Lulu.js
  10. +2 −2 OVID Tagged.js
  11. +2 −0 Open WorldCat.js
  12. +41 −2 RDF.js
  13. +2 −2 ReferBibIX.js
  14. +26 −0 mEDRA.js
View
@@ -465,7 +465,8 @@ var testCases = [
"publicationTitle": "品質學報",
"volume": "19",
"date": "February 2012",
"pages": "1-20"
"pages": "1-20",
"ISSN": "1022-0690"
}
]
}
View
@@ -1,17 +1,22 @@
{
"translatorID":"14763d25-8ba0-45df-8f52-b8d1108e7ac9",
"translatorType":3,
"label":"Bibliontology RDF",
"creator":"Simon Kornblith",
"target":"rdf",
"minVersion":"2.0",
"maxVersion":"",
"priority":50,
"browserSupport":"gcs",
"configOptions":{"getCollections":"true", "dataMode":"rdf/xml"},
"displayOptions":{"exportNotes":true},
"inRepository":false,
"lastUpdated":"2016-06-21 08:45:20"
"translatorID": "14763d25-8ba0-45df-8f52-b8d1108e7ac9",
"label": "Bibliontology RDF",
"creator": "Simon Kornblith",
"target": "rdf",
"minVersion": "2.0",
"maxVersion": "",
"priority": 50,
"configOptions": {
"getCollections": "true",
"dataMode": "rdf/xml"
},
"displayOptions": {
"exportNotes": true
},
"inRepository": true,
"translatorType": 3,
"browserSupport": "gcsibv",
"lastUpdated": "2017-06-03 10:21:42"
}
var n = {
@@ -145,26 +150,26 @@ var SUBCONTAINER_SERIES = 6; // not used
var CONTAINER_SERIES = 7;
/**
Fields should be in the form
<ZOTERO_FIELD>: ([<SUBJECT>, <PREDICATE>] | <FUNCTION>)
If a <FUNCTION> is specified, then it is passed the item and should return a set of triples in
the form
[[<SUBJECT>, <PREDICATE>, <OBJECT>, <LITERAL>]*]
where <SUBJECT> refers to one of the constants defined above. If <LITERAL> is true, then
<OBJECT> is treated as a literal.
If a <FUNCTION> is not used and <PREDICATE> is a string, then the parameters generate a triple
in the form
<SUBJECT> <PREDICATE> FIELD_CONTENT
where <SUBJECT> refers to one of the constants defined above. Alternatively, <PREDICATE> may be
an array in the form
Fields should be in the form
<ZOTERO_FIELD>: ([<SUBJECT>, <PREDICATE>] | <FUNCTION>)
If a <FUNCTION> is specified, then it is passed the item and should return a set of triples in
the form
[[<SUBJECT>, <PREDICATE>, <OBJECT>, <LITERAL>]*]
where <SUBJECT> refers to one of the constants defined above. If <LITERAL> is true, then
<OBJECT> is treated as a literal.
If a <FUNCTION> is not used and <PREDICATE> is a string, then the parameters generate a triple
in the form
<SUBJECT> <PREDICATE> FIELD_CONTENT
where <SUBJECT> refers to one of the constants defined above. Alternatively, <PREDICATE> may be
an array in the form
[<ITEM_PREDICATE>, [<BLANK_NODE_PREDICATE>, <BLANK_NODE_OBJECT>]*, <PREDICATE>]
This generates the triples
@@ -1110,3 +1115,39 @@ function doExport() {
//Zotero.debug("relations added");
}
}
/** BEGIN TEST CASES **/
var testCases = [
{
"type": "import",
"input": "<rdf:RDF\n xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n xmlns:res=\"http://purl.org/vocab/resourcelist/schema#\"\n xmlns:z=\"http://www.zotero.org/namespaces/export#\"\n xmlns:bibo=\"http://purl.org/ontology/bibo/\"\n xmlns:dcterms=\"http://purl.org/dc/terms/\"\n xmlns:foaf=\"http://xmlns.com/foaf/0.1/\">\n <z:UserItem rdf:about=\"http://zotero.org/users/96641/items/XW66MVF4\">\n <res:resource rdf:resource=\"http://libreas.eu/ausgabe29/05kim/\"/>\n <z:accessDate>2017-05-28 14:08:38</z:accessDate>\n <z:repository>libreas.eu</z:repository>\n </z:UserItem>\n <bibo:AcademicArticle rdf:about=\"http://libreas.eu/ausgabe29/05kim/\">\n <bibo:uri>http://libreas.eu/ausgabe29/05kim/</bibo:uri>\n <dcterms:language>de</dcterms:language>\n <dcterms:abstract>Im Folgenden soll aufgezeigt werden, wie derzeit das Literaturverwaltungsprogramm Zotero innerhalb des Index Theologicus genutzt wird, um unselbstständige Literatur in einem bibliothekarischen Katalogisierungssystem zu erfassen. Die modulare und flexible Architektur der Open Source Software erlaubt es, die bereits kollaborativ zusammengetragene Programmierarbeit zur Datenextraktion mitzunutzen. Das vorgestellte semiautomatische Verfahren bringt auch bei der Verknüpfung von Normdaten erhebliche Vorteile für die Medienbearbeitung. &lt;/br&gt; &lt;b&gt;Schlüsselwörter&lt;/b&gt;: Literaturverwaltungsprogramm, Zotero, Katalogisierung, Unselbständige Werke, Aufsatzliteratur, Index Theologicus, Online-Bibliographie, WinIBW, Fachinformationsdienst Theologie &lt;hr&gt; This article presents an approach to use the reference management software Zotero within the theological article database Index Theologicus to catalogue article metadata for a library management system. Zotero's Open Source nature and flexible architecture allowed us to seamlessly reuse the vast amount of data extraction routines collaboratively developed for the software. We will show how the semi-automatic workflow we developed will make authority linking fun again. &lt;/br&gt; &lt;b&gt;Keywords:&lt;/b&gt; Reference Management System, Zotero, Cataloguing, Journal articles, Index Theologicus, Theological database, Academic Information Services for Theology</dcterms:abstract>\n <dcterms:title>Semiautomatische Katalogisierung und Normdatenverknüpfung mit Zotero im Index Theologicus</dcterms:title>\n <dcterms:creator rdf:nodeID=\"n5\"/>\n <bibo:authorList>\n <rdf:Seq><rdf:li rdf:nodeID=\"n5\"/><rdf:li rdf:nodeID=\"n7\"/></rdf:Seq>\n </bibo:authorList>\n <dcterms:creator rdf:nodeID=\"n7\"/>\n <dcterms:isPartOf>\n <bibo:Issue>\n <bibo:issue>29</bibo:issue>\n <dcterms:date>2016</dcterms:date>\n <dcterms:isPartOf>\n <bibo:Journal>\n <dcterms:title>LIBREAS. Library Ideas</dcterms:title>\n <bibo:issn>1860-7950</bibo:issn>\n </bibo:Journal>\n </dcterms:isPartOf>\n </bibo:Issue>\n </dcterms:isPartOf>\n </bibo:AcademicArticle>\n <foaf:Person rdf:nodeID=\"n5\">\n <foaf:givenname>Timotheus Chang-whae</foaf:givenname>\n <foaf:surname>Kim</foaf:surname>\n </foaf:Person>\n <foaf:Person rdf:nodeID=\"n7\">\n <foaf:givenname>Philipp</foaf:givenname>\n <foaf:surname>Zumstein</foaf:surname>\n </foaf:Person>\n</rdf:RDF>\n",
"items": [
{
"itemType": "journalArticle",
"title": "Semiautomatische Katalogisierung und Normdatenverknüpfung mit Zotero im Index Theologicus",
"creators": [
{
"lastName": "Kim",
"firstName": "Timotheus Chang-whae"
},
{
"lastName": "Zumstein",
"firstName": "Philipp"
}
],
"date": "2016",
"ISSN": "1860-7950",
"abstractNote": "Im Folgenden soll aufgezeigt werden, wie derzeit das Literaturverwaltungsprogramm Zotero innerhalb des Index Theologicus genutzt wird, um unselbstständige Literatur in einem bibliothekarischen Katalogisierungssystem zu erfassen. Die modulare und flexible Architektur der Open Source Software erlaubt es, die bereits kollaborativ zusammengetragene Programmierarbeit zur Datenextraktion mitzunutzen. Das vorgestellte semiautomatische Verfahren bringt auch bei der Verknüpfung von Normdaten erhebliche Vorteile für die Medienbearbeitung. </br> <b>Schlüsselwörter</b>: Literaturverwaltungsprogramm, Zotero, Katalogisierung, Unselbständige Werke, Aufsatzliteratur, Index Theologicus, Online-Bibliographie, WinIBW, Fachinformationsdienst Theologie <hr> This article presents an approach to use the reference management software Zotero within the theological article database Index Theologicus to catalogue article metadata for a library management system. Zotero's Open Source nature and flexible architecture allowed us to seamlessly reuse the vast amount of data extraction routines collaboratively developed for the software. We will show how the semi-automatic workflow we developed will make authority linking fun again. </br> <b>Keywords:</b> Reference Management System, Zotero, Cataloguing, Journal articles, Index Theologicus, Theological database, Academic Information Services for Theology",
"issue": "29",
"language": "de",
"libraryCatalog": "libreas.eu",
"publicationTitle": "LIBREAS. Library Ideas",
"url": "http://libreas.eu/ausgabe29/05kim/",
"attachments": [],
"tags": [],
"notes": [],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/
View
@@ -8,8 +8,8 @@
"priority": 100,
"inRepository": true,
"translatorType": 3,
"browserSupport": "gcs",
"lastUpdated": "2014-03-31 20:27:28"
"browserSupport": "gcsibv",
"lastUpdated": "2017-06-03 11:41:00"
}
/*
View
@@ -8,8 +8,8 @@
"priority": 100,
"inRepository": true,
"translatorType": 3,
"browserSupport": "gcs",
"lastUpdated": "2016-07-31 15:24:21"
"browserSupport": "gcsibv",
"lastUpdated": "2017-06-03 11:41:00"
}
function parseInput() {
@@ -70,3 +70,37 @@ function doExport() {
while(item = Z.nextItem()) data.push(ZU.itemToCSLJSON(item));
Z.write(JSON.stringify(data, null, "\t"));
}
/** BEGIN TEST CASES **/
var testCases = [
{
"type": "import",
"input": "[\n\t{\n\t\t\"id\": \"http://zotero.org/users/96641/items/BDQRTS3T\",\n\t\t\"type\": \"book\",\n\t\t\"title\": \"Stochastic biomathematical models: With applications to neuronal modeling\",\n\t\t\"collection-title\": \"Lecture notes in mathematics\",\n\t\t\"publisher\": \"Springer\",\n\t\t\"publisher-place\": \"Heidelberg\",\n\t\t\"volume\": \"2058\",\n\t\t\"number-of-pages\": \"206\",\n\t\t\"event-place\": \"Heidelberg\",\n\t\t\"ISBN\": \"978-3-642-32156-6\",\n\t\t\"language\": \"en\",\n\t\t\"author\": [\n\t\t\t{\n\t\t\t\t\"family\": \"Bachar\",\n\t\t\t\t\"given\": \"Mostafa\"\n\t\t\t}\n\t\t],\n\t\t\"issued\": {\n\t\t\t\"date-parts\": [\n\t\t\t\t[\n\t\t\t\t\t\"2013\",\n\t\t\t\t\t1,\n\t\t\t\t\t1\n\t\t\t\t]\n\t\t\t]\n\t\t}\n\t}\n]",
"items": [
{
"itemType": "book",
"title": "Stochastic biomathematical models: With applications to neuronal modeling",
"creators": [
{
"lastName": "Bachar",
"firstName": "Mostafa",
"creatorType": "author"
}
],
"date": "January 1, 2013",
"ISBN": "978-3-642-32156-6",
"itemID": "http://zotero.org/users/96641/items/BDQRTS3T",
"language": "en",
"numPages": "206",
"place": "Heidelberg",
"publisher": "Springer",
"series": "Lecture notes in mathematics",
"volume": "2058",
"attachments": [],
"tags": [],
"notes": [],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/
View
@@ -8,8 +8,8 @@
"priority": 100,
"inRepository": true,
"translatorType": 8,
"browserSupport": "gcs",
"lastUpdated": "2014-05-29 07:46:16"
"browserSupport": "gcsibv",
"lastUpdated": "2017-06-03 11:41:00"
}
function detectSearch(items) {
@@ -78,6 +78,12 @@ function processDOIs(dois) {
var trans = Zotero.loadTranslator('import');
trans.setTranslator('bc03b4fe-436d-4a1f-ba59-de4d2d7a63f7');
trans.setString(text);
trans.setHandler("itemDone", function(obj, item) {
if (!item.DOI) {
item.extra = "DOI: " + doi;
}
item.complete();
});
trans.translate();
}, function() {
if(dois.length) processDOIs(dois, queryTracker);
@@ -92,10 +98,10 @@ var testCases = [
},
"items": [
{
"itemType": "journalArticle",
"itemType": "report",
"creators": [
{
"lastName": "Heiliges römisches Reich deutscher Nation",
"lastName": "Heiliges Römisches Reich Deutscher Nation",
"fieldMode": 1,
"creatorType": "author"
}
@@ -105,10 +111,13 @@ var testCases = [
"seeAlso": [],
"attachments": [],
"title": "Code criminel de l'empereur Charles V vulgairement appellé la Caroline contenant les loix qui sont suivies dans les jurisdictions criminelles de l'Empire et à l'usage des conseils de guerre des troupes suisses.",
"url": "http://dx.doi.org/10.12763/ONA1045",
"DOI": "10.12763/ONA1045",
"date": "1734",
"libraryCatalog": "DataCite"
"itemID": "https://doi.org/10.12763/ona1045",
"abstractNote": "Le code est accompagné de commentaires de F. A. Vogel, qui signe l'épitre dédicatoire",
"language": "fre",
"institution": "de l'imprimerie de Claude Simon (A Paris)",
"libraryCatalog": "DataCite",
"extra": "DOI: 10.12763/ONA1045"
}
]
}
View
@@ -8,8 +8,8 @@
"priority": 80,
"inRepository": true,
"translatorType": 8,
"browserSupport": "gcsi",
"lastUpdated": "2014-05-29 01:51:21"
"browserSupport": "gcsibv",
"lastUpdated": "2017-06-03 11:41:00"
}
var typeMap = {
@@ -142,7 +142,8 @@ var testCases = [
"date": "2014",
"numPages": "219",
"language": "ger",
"shortTitle": "Evaluation in Deutschland und Österreich"
"shortTitle": "Evaluation in Deutschland und Österreich",
"extra": "OCLC: 885612607"
}
]
},
@@ -166,14 +167,13 @@ var testCases = [
"note": "Literaturverz. S. [373] - 387 Die CD-ROM enth. einen Anh. mit Dokumenten zur Sprachproduktion und Sprachbewertung"
},
{
"note": "Univ., FB SLM, Diss. u.d.T.: Karl, Katrin Bente: Nicht materieller lexikalischer Transfer als Folge der aktuellen russisch-deutschen Zweisprachigkeit--Hamburg, 2011"
"note": "Teilw. zugl.: Hamburg, Univ., FB SLM, Diss., 2011 u.d.T.: Karl, Katrin Bente: Nicht materieller lexikalischer Transfer als Folge der aktuellen russisch-deutschen Zweisprachigkeit"
}
],
"tags": [
"CD-ROM",
"Deutsch",
"Deutsch",
"Hochschulschrift",
"Russisch",
"Russisch",
"Wortschatz",
@@ -198,7 +198,8 @@ var testCases = [
"shortTitle": "Bilinguale Lexik",
"title": "Bilinguale Lexik: nicht materieller lexikalischer Transfer als Folge der aktuellen russisch-deutschen Zweisprachigkeit",
"publisher": "Sagner",
"date": "2012"
"date": "2012",
"extra": "OCLC: 795769702"
}
]
},
@@ -253,7 +254,8 @@ var testCases = [
"seriesNumber": "1930",
"libraryCatalog": "Gemeinsamer Bibliotheksverbund ISBN",
"publisher": "Archaeopress" ,
"date": "2009"
"date": "2009",
"extra": "OCLC: 320755805"
}
]
}
@@ -8,8 +8,8 @@
"priority": 98,
"inRepository": true,
"translatorType": 8,
"browserSupport": "gcsb",
"lastUpdated": "2015-04-14 20:56:41"
"browserSupport": "gcsibv",
"lastUpdated": "2017-06-03 11:41:00"
}
@@ -63,13 +63,14 @@ var testCases = [
"attachments": [],
"libraryCatalog": "Library of Congress ISBN",
"place": "Cambridge ; New York",
"ISBN": "0521770599",
"ISBN": "9780521770590 9780521779241",
"title": "The Cambridge companion to Adam Smith",
"publisher": "Cambridge University Press",
"date": "2006",
"numPages": "409",
"series": "Cambridge companions to philosophy",
"callNumber": "B1545.Z7 C36 2006"
"callNumber": "B1545.Z7 C36 2006",
"extra": "OCLC: ocm60321422"
}
]
}
View
@@ -253,7 +253,7 @@ var testCases = [
"libraryCatalog": "Lulu",
"title": "Viticulture - An Introduction to Commercial Grape Growing for Wine Production",
"publisher": "Stephen Skelton",
"date": "2014-05-24"
"date": "2017-03-06"
}
]
}
View
@@ -8,8 +8,8 @@
"priority": 100,
"inRepository": true,
"translatorType": 1,
"browserSupport": "gcs",
"lastUpdated": "2015-10-22 05:25:37"
"browserSupport": "gcsibv",
"lastUpdated": "2017-06-03 11:41:00"
}
/*
View
@@ -595,6 +595,7 @@ var testCases = [
"place": "Cambridge, Mass.",
"date": "1996",
"ISBN": "9780585030159",
"extra": "OCLC: 793205903",
"accessDate": "CURRENT_TIMESTAMP"
}
]
@@ -633,6 +634,7 @@ var testCases = [
"place": "Cambridge, Mass.",
"date": "1996",
"ISBN": "9780585030159",
"extra": "OCLC: 42854423",
"accessDate": "CURRENT_TIMESTAMP"
}
]
Oops, something went wrong.

0 comments on commit f5be7ba

Please sign in to comment.