Skip to content

Commit 713bf00

Browse files
committed
Update/add search translator tests. Fix EIDR.
1 parent 59a7e7b commit 713bf00

8 files changed

+338
-31
lines changed

Airiti.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,11 @@ var testCases = [
449449
"people capability maturity model"
450450
],
451451
"seeAlso": [],
452-
"attachments": [],
452+
"attachments": [
453+
{
454+
"title": "Snapshot"
455+
}
456+
],
453457
"itemID": "AL:10220690-201202-201202200002-201202200002-1-20",
454458
"issue": "1",
455459
"abstractNote": "The People Capability Maturity Model (P-CMM) is an evolving channel for and a roadmap of organizational development and improvement. This model comprises five consecutive maturity levels: initial, managed, defined, predictable, and optimized. The unique characteristics of P-CMM lie in the standardization of processes guiding employees to perform their daily routines more efficiently. This was a field research project that used document analysis, observation, interviews, and analysis of researchers' field notes. By triangulating this data, researchers hoped to maintain a satisfactory level of reliability and validity for the model. Through on-site research into the industrial control industry, researchers endeavored to obtain some indication of the significance and potential application of this model. After evaluating each step of the current production process, researchers made necessary changes or appropriate adjustments based on the protocol set out in the second level of P-CMM to evaluate and diagnose the model.",

DataCite.js

+14-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"inRepository": true,
1010
"translatorType": 8,
1111
"browserSupport": "gcs",
12-
"lastUpdated": "2014-05-24 07:46:16"
12+
"lastUpdated": "2014-05-29 07:46:16"
1313
}
1414

1515
function detectSearch(items) {
@@ -92,22 +92,23 @@ var testCases = [
9292
},
9393
"items": [
9494
{
95-
"itemType": "journalArticle"
95+
"itemType": "journalArticle",
9696
"creators": [
9797
{
98-
"lastName": "Heiliges römisches Reich deutscher Nation"
99-
"fieldMode": 1
98+
"lastName": "Heiliges römisches Reich deutscher Nation",
99+
"fieldMode": 1,
100100
"creatorType": "author"
101101
}
102-
]
103-
"notes": []
104-
"tags": []
105-
"seeAlso": []
106-
"attachments": []
107-
"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."
108-
"url": "http://dx.doi.org/10.12763/ONA1045"
109-
"DOI": "10.12763/ONA1045"
110-
"date": "1734"
102+
],
103+
"notes": [],
104+
"tags": [],
105+
"seeAlso": [],
106+
"attachments": [],
107+
"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.",
108+
"url": "http://dx.doi.org/10.12763/ONA1045",
109+
"DOI": "10.12763/ONA1045",
110+
"date": "1734",
111+
"libraryCatalog": "DataCite"
111112
}
112113
]
113114
}

EIDR.js

+61-16
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99
"inRepository": true,
1010
"translatorType": 8,
1111
"browserSupport": "gcsi",
12-
"lastUpdated": "2012-04-12 01:51:21"
12+
"lastUpdated": "2014-05-29 01:51:21"
1313
}
1414

1515
var typeMap = {
1616
// 'Series'
1717
// 'Season'
1818
// 'Supplemental'
19-
'TV Show': 'tvBroadcast',
19+
// 'Composite'
20+
// 'Compilation'
21+
// Interactive Material'
22+
'TV': 'tvBroadcast',
2023
'Movie': 'film',
2124
'Short': 'videoRecording',
2225
'Web': 'videoRecording'
@@ -58,7 +61,13 @@ function detectSearch(item) {
5861
//we should detect party and user but throw an error later
5962
//this way other translators don't need to process the DOI
6063
var prefix = item.DOI.split('/')[0];
61-
if(prefix == '10.5237' || prefix == '10.5238' || prefix == '10.5240') {
64+
if([
65+
'10.5237', // Parties
66+
'10.5238', // Users
67+
'10.5239', // Video Services
68+
'10.5240' // Content Records
69+
].indexOf(prefix) != -1)
70+
{
6271
return true;
6372
}
6473
}
@@ -67,34 +76,28 @@ function doSearch(searchItem) {
6776
if(!searchItem.DOI)
6877
throw new Error("EIDR not specified.");
6978
if(!checkEIDR(searchItem.DOI))
70-
throw new Error("Invalid EIDR: " + searchItem.DOI);
79+
throw new Error("EIDR not supported: " + searchItem.DOI);
7180

7281
var request = 'https://resolve.eidr.org/EIDR/object/' + searchItem.DOI
7382
+ '/?type=Full&followAlias=true';
7483
ZU.doGet(request, function(text) {
7584
var parser = new DOMParser();
7685
var res = parser.parseFromString(text, "application/xml");
7786

78-
var ns = {
79-
'n' : 'http://www.eidr.org/schema/1.0',
80-
'md': 'http://www.movielabs.com/md'
81-
};
87+
var ns = {
88+
'n' : 'http://www.eidr.org/schema',
89+
'md': 'http://www.movielabs.com/schema/md/v2.1/md'
90+
};
8291

8392
if(res.getElementsByTagName('Response').length) {
84-
93+
8594
throw new Error("Server returned error: ("
8695
+ getValue(res, 'Code') + ") "
8796
+ getValue(res, 'Type'));
8897
}
8998

9099
var base = res.getElementsByTagName('BaseObjectData')[0];
91100

92-
if(getValue(base, 'StructuralType') != 'Performance') {
93-
Z.debug("Unhandled StructuralType: "
94-
+ getValue(base, 'StructuralType'));
95-
return;
96-
}
97-
98101
var type = typeMap[getValue(base,'ReferentType')];
99102
if(!type) {
100103
Z.debug("Unhandled ReferentType: " + getValue(base,'ReferentType'));
@@ -136,4 +139,46 @@ function doSearch(searchItem) {
136139

137140
item.complete();
138141
});
139-
}
142+
}
143+
144+
/** BEGIN TEST CASES **/
145+
var testCases = [
146+
{
147+
"type": "search",
148+
"input": {
149+
"DOI": "10.5240/6F7E-EF59-329B-1F0A-8440-2"
150+
},
151+
"items": [
152+
{
153+
"itemType": "videoRecording",
154+
"creators": [
155+
{
156+
"lastName": "Rowland",
157+
"firstName": "Roy",
158+
"creatorType": "director"
159+
},
160+
{
161+
"firstName": "Byron",
162+
"lastName": "Shores",
163+
"creatorType": "castMember"
164+
},
165+
{
166+
"firstName": "C. Henry",
167+
"lastName": "Gordon",
168+
"creatorType": "castMember"
169+
}
170+
],
171+
"notes": [],
172+
"tags": [],
173+
"seeAlso": [],
174+
"attachments": [],
175+
"libraryCatalog": "EIDR",
176+
"title": "You, the People",
177+
"date": "1940",
178+
"place": "US",
179+
"runningTime": "1260s"
180+
}
181+
]
182+
}
183+
]
184+
/** END TEST CASES **/

Library of Congress ISBN.js

+42
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,45 @@ function doSearch(item) {
3333
translator.translate();
3434
});
3535
}
36+
37+
/** BEGIN TEST CASES **/
38+
var testCases = [
39+
{
40+
"type": "search",
41+
"input": {
42+
"ISBN": "9780521779241"
43+
},
44+
"items": [
45+
{
46+
"itemType": "book",
47+
"creators": [
48+
{
49+
"lastName": "Haakonssen",
50+
"firstName": "Knud",
51+
"creatorType": "editor"
52+
}
53+
],
54+
"notes": [
55+
{
56+
"note": "Imagination : morals, science, arts / Charles L. Griswold, Jr. -- Adam Smith, belletrist / Mark Salber Phillips -- Adam Smith's theory of language / Marcelo Dascal -- Smith and science / Christopher J. Berry -- Smith on ingenuity, pleasure, and the imitative arts / Neil de Marchi -- Sympathy and the impartial spectator / Alexander Broadie -- Virtues, utility, and rules / Robert Shaver -- Adam Smith on justice, rights, and law / David Lieberman -- Self-interest and other interests / Pratap Bhanu Mehta -- Adam Smith and history / J.G.A. Pocock -- Adam Smith's politics / Douglas Long -- Adam Smith's economics / Emma Rothschild and Amartya Sen -- The legacy of Adam Smith / Knud Haakonssen and Donald Winch"
57+
}
58+
],
59+
"tags": [
60+
"Smith, Adam"
61+
],
62+
"seeAlso": [],
63+
"attachments": [],
64+
"libraryCatalog": "Library of Congress ISBN",
65+
"place": "Cambridge ; New York",
66+
"ISBN": "0521770599",
67+
"title": "The Cambridge companion to Adam Smith",
68+
"publisher": "Cambridge University Press",
69+
"date": "2006",
70+
"numPages": "409",
71+
"series": "Cambridge companions to philosophy",
72+
"callNumber": "B1545.Z7 C36 2006"
73+
}
74+
]
75+
}
76+
]
77+
/** END TEST CASES **/

Lulu.js

+37
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,43 @@ var testCases = [
219219
"libraryCatalog": "Lulu"
220220
}
221221
]
222+
},
223+
{
224+
"type": "search",
225+
"input": {
226+
"ISBN": "9780951470329"
227+
},
228+
"items": [
229+
{
230+
"itemType": "book",
231+
"creators": [
232+
{
233+
"firstName": "Stephen Skelton",
234+
"lastName": "MW",
235+
"creatorType": "author"
236+
}
237+
],
238+
"notes": [],
239+
"tags": [],
240+
"seeAlso": [],
241+
"attachments": [
242+
{
243+
"title": "Lulu Link",
244+
"mimeType": "text/html",
245+
"snapshot": false
246+
}
247+
],
248+
"abstractNote": "ALL YOU NEED TO KNOW ABOUT GROWING VINES IN 123 PAGES. \n\nThis book is a basic introduction to growing grapes and aimed at the serious student in the wine trade, WSET Diploma student or Master of Wine candidate. It is also very useful for those thinking of setting up vineyards as it answers a lot of the basic questions. \n\nHas sold over 3,500 copies now and received LOTS of emails saying how helpful it has been. \n\n\"Couldn't have become an MW without your book\" was the latest endorsement!",
249+
"ISBN": "9780951470329",
250+
"rights": "Stephen Skelton (Standard Copyright License)",
251+
"language": "English",
252+
"numPages": "146",
253+
"libraryCatalog": "Lulu",
254+
"title": "Viticulture - An Introduction to Commercial Grape Growing for Wine Production",
255+
"publisher": "Stephen Skelton",
256+
"date": "May 24, 2014"
257+
}
258+
]
222259
}
223260
]
224261
/** END TEST CASES **/

NCBI PubMed.js

+102
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,108 @@ var testCases = [
11621162
"libraryCatalog": "NCBI PubMed"
11631163
}
11641164
]
1165+
},
1166+
{
1167+
"type": "search",
1168+
"input": {
1169+
"PMID": "20729678"
1170+
},
1171+
"items": [
1172+
{
1173+
"itemType": "journalArticle",
1174+
"creators": [
1175+
{
1176+
"creatorType": "author",
1177+
"lastName": "Coar",
1178+
"firstName": "Jaekea T"
1179+
},
1180+
{
1181+
"creatorType": "author",
1182+
"lastName": "Sewell",
1183+
"firstName": "Jeanne P"
1184+
}
1185+
],
1186+
"notes": [],
1187+
"tags": [
1188+
"Bibliography as Topic",
1189+
"Database Management Systems",
1190+
"Humans"
1191+
],
1192+
"seeAlso": [],
1193+
"attachments": [
1194+
{
1195+
"title": "PubMed entry",
1196+
"mimeType": "text/html",
1197+
"snapshot": false
1198+
}
1199+
],
1200+
"ISSN": "1538-9855",
1201+
"journalAbbreviation": "Nurse Educ",
1202+
"issue": "5",
1203+
"language": "eng",
1204+
"abstractNote": "Zotero is a powerful free personal bibliographic manager (PBM) for writers. Use of a PBM allows the writer to focus on content, rather than the tedious details of formatting citations and references. Zotero 2.0 (http://www.zotero.org) has new features including the ability to synchronize citations with the off-site Zotero server and the ability to collaborate and share with others. An overview on how to use the software and discussion about the strengths and limitations are included.",
1205+
"DOI": "10.1097/NNE.0b013e3181ed81e4",
1206+
"extra": "PMID: 20729678",
1207+
"libraryCatalog": "NCBI PubMed",
1208+
"shortTitle": "Zotero",
1209+
"title": "Zotero: harnessing the power of a personal bibliographic manager",
1210+
"pages": "205-207",
1211+
"publicationTitle": "Nurse educator",
1212+
"volume": "35",
1213+
"date": "2010 Sep-Oct"
1214+
}
1215+
]
1216+
},
1217+
{
1218+
"type": "search",
1219+
"input": {
1220+
"contextObject": "url_ver=Z39.88-2004&ctx_ver=Z39.88-2004&rfr_id=info:sid/zotero.org:2&rft_id=info:doi/10.1097/NNE.0b013e3181ed81e4&rft_id=info:pmid/20729678&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft.genre=article&rft.atitle=Zotero: harnessing the power of a personal bibliographic manager&rft.jtitle=Nurse educator&rft.stitle=Nurse Educ&rft.volume=35&rft.issue=5&rft.aufirst=Jaekea T&rft.aulast=Coar&rft.au=Jaekea T Coar&rft.au=Jeanne P Sewell&rft.date=2010-10&rft.pages=205-207&rft.spage=205&rft.epage=207&rft.issn=1538-9855&rft.language=eng"
1221+
},
1222+
"items": [
1223+
{
1224+
"itemType": "journalArticle",
1225+
"creators": [
1226+
{
1227+
"creatorType": "author",
1228+
"lastName": "Coar",
1229+
"firstName": "Jaekea T"
1230+
},
1231+
{
1232+
"creatorType": "author",
1233+
"lastName": "Sewell",
1234+
"firstName": "Jeanne P"
1235+
}
1236+
],
1237+
"notes": [],
1238+
"tags": [
1239+
"Bibliography as Topic",
1240+
"Database Management Systems",
1241+
"Humans"
1242+
],
1243+
"seeAlso": [],
1244+
"attachments": [
1245+
{
1246+
"title": "PubMed entry",
1247+
"mimeType": "text/html",
1248+
"snapshot": false
1249+
}
1250+
],
1251+
"ISSN": "1538-9855",
1252+
"journalAbbreviation": "Nurse Educ",
1253+
"issue": "5",
1254+
"language": "eng",
1255+
"abstractNote": "Zotero is a powerful free personal bibliographic manager (PBM) for writers. Use of a PBM allows the writer to focus on content, rather than the tedious details of formatting citations and references. Zotero 2.0 (http://www.zotero.org) has new features including the ability to synchronize citations with the off-site Zotero server and the ability to collaborate and share with others. An overview on how to use the software and discussion about the strengths and limitations are included.",
1256+
"DOI": "10.1097/NNE.0b013e3181ed81e4",
1257+
"extra": "PMID: 20729678",
1258+
"libraryCatalog": "NCBI PubMed",
1259+
"shortTitle": "Zotero",
1260+
"title": "Zotero: harnessing the power of a personal bibliographic manager",
1261+
"pages": "205-207",
1262+
"publicationTitle": "Nurse educator",
1263+
"volume": "35",
1264+
"date": "2010 Sep-Oct"
1265+
}
1266+
]
11651267
}
11661268
]
11671269
/** END TEST CASES **/

0 commit comments

Comments
 (0)