Parsing CrossRef Data

Hi OR Team,

I’ve faced an issue regarding parsing data from Crossref.

The JSON Data:

{ "status": "ok", "message-type": "work", "message-version": "1.0.0", "message": { "indexed": { "date-parts": [ [ 2023, 6, 15 ] ], "date-time": "2023-06-15T04:21:43Z", "timestamp": 1686802903829 }, "**reference-count**": 15, "publisher": "Korean Academy of Oral and Maxillofacial Radiology", "issue": "4", "license": [ { "start": { "date-parts": [ [ 2012, 1, 1 ] ], "date-time": "2012-01-01T00:00:00Z", "timestamp": 1325376000000 }, "content-version": "tdm", "delay-in-days": 0, "URL": "http:\/\/creativecommons.org\/licenses\/by-nc\/3.0\/" } ], "content-domain": { "domain": [], "crossmark-restriction": false }, "short-container-title": [ "Imaging Sci Dent" ], "published-print": { "date-parts": [ [ 2012 ] ] }, "DOI": "10.5624\/isd.2012.42.4.213", "type": "journal-article", "created": { "date-parts": [ [ 2012, 12, 28 ] ], "date-time": "2012-12-28T02:18:31Z", "timestamp": 1356661111000 }, "page": "213", "source": "Crossref", "is-referenced-by-count": 36, "title": [ "Uniqueness of radiographic patterns of the frontal sinus for personal identification" ], "prefix": "10.5624", "volume": "42", "author": [ { "given": "Neha", "family": "Patil", "sequence": "first", "affiliation": [ { "name": "Department of Oral Medicine and Radiology, MGM, Dental College and Hospital, Navi Mumbai, India." } ] }, { "given": "Freny R.", "family": "Karjodkar", "sequence": "additional", "affiliation": [ { "name": "Department of Oral Medicine and Radiology, Nair Hospital Dental College, Mumbai, India." } ] }, { "given": "Subodh", "family": "Sontakke", "sequence": "additional", "affiliation": [ { "name": "Department of Oral Medicine and Radiology, Nair Hospital Dental College, Mumbai, India." } ] }, { "given": "Kaustubh", "family": "Sansare", "sequence": "additional", "affiliation": [ { "name": "Department of Oral Medicine and Radiology, Nair Hospital Dental College, Mumbai, India." } ] }, { "given": "Rohini", "family": "Salvi", "sequence": "additional", "affiliation": [ { "name": "Department of Oral Medicine and Radiology, MGM, Dental College and Hospital, Navi Mumbai, India." } ] } ], "member": "3589", "reference": [ { "key": "10.5624\/isd.2012.42.4.213_ref1", "doi-asserted-by": "crossref", "first-page": "223", "DOI": "10.1016\/j.jflm.2009.12.012", "volume": "17", "author": "Kanchan", "year": "2010", "journal-title": "J Forensic Leg Med" }, { "key": "10.5624\/isd.2012.42.4.213_ref2", "first-page": "168", "volume": "24", "author": "Igbigbi", "year": "2003", "journal-title": "Am J Forensic Med Pathol" }, { "key": "10.5624\/isd.2012.42.4.213_ref3", "doi-asserted-by": "crossref", "first-page": "554", "DOI": "10.5694\/j.1326-5377.1943.tb44655.x", "volume": "1", "author": "Schuller", "year": "1943", "journal-title": "Med J Aust" }, { "key": "10.5624\/isd.2012.42.4.213_ref4", "doi-asserted-by": "crossref", "first-page": "289", "DOI": "10.1016\/0379-0738(87)90041-7", "volume": "34", "author": "Yoshino", "year": "1987", "journal-title": "Forensic Sci Int" }, { "key": "10.5624\/isd.2012.42.4.213_ref5", "doi-asserted-by": "crossref", "first-page": "104.e1", "DOI": "10.1016\/j.forsciint.2008.10.017", "volume": "183", "author": "Tang", "year": "2009", "journal-title": "Forensic Sci Int" }, { "key": "10.5624\/isd.2012.42.4.213_ref6", "doi-asserted-by": "crossref", "first-page": "26", "DOI": "10.1177\/014556130007900108", "volume": "79", "author": "Ribeiro Fde", "year": "2000", "journal-title": "Ear Nose Throat J" }, { "key": "10.5624\/isd.2012.42.4.213_ref7", "first-page": "3", "volume": "8", "author": "Kullman", "year": "1990", "journal-title": "J Forensic Odontostomatol" }, { "key": "10.5624\/isd.2012.42.4.213_ref8", "doi-asserted-by": "crossref", "first-page": "147", "DOI": "10.1016\/S0379-0738(96)02033-6", "volume": "83", "author": "Quatrehomme", "year": "1996", "journal-title": "Forensic Sci Int" }, { "key": "10.5624\/isd.2012.42.4.213_ref9", "doi-asserted-by": "crossref", "first-page": "761", "DOI": "10.1111\/j.1556-4029.2009.01075.x", "volume": "54", "author": "Cox", "year": "2009", "journal-title": "J Forensic Sci" }, { "key": "10.5624\/isd.2012.42.4.213_ref10", "doi-asserted-by": "crossref", "first-page": "291", "DOI": "10.1002\/ajpa.20116", "volume": "127", "author": "Christensen", "year": "2005", "journal-title": "Am J Phys Anthropol" }, { "key": "10.5624\/isd.2012.42.4.213_ref11", "doi-asserted-by": "crossref", "first-page": "1765", "DOI": "10.1520\/JFS13202J", "volume": "36", "author": "Marlin", "year": "1991", "journal-title": "J Forensic Sci" }, { "key": "10.5624\/isd.2012.42.4.213_ref12", "doi-asserted-by": "crossref", "first-page": "16", "DOI": "10.1002\/(SICI)1098-2353(1999)12:1<16::AID-CA3>3.0.CO;2-D", "volume": "12", "author": "Nambiar", "year": "1999", "journal-title": "Clin Anat" }, { "key": "10.5624\/isd.2012.42.4.213_ref13", "doi-asserted-by": "crossref", "first-page": "59", "DOI": "10.1016\/S0094-1298(20)30097-3", "volume": "2", "author": "Nahum", "year": "1975", "journal-title": "Clin Plast Surg" }, { "key": "10.5624\/isd.2012.42.4.213_ref14", "doi-asserted-by": "crossref", "first-page": "593", "DOI": "10.1288\/00005537-198806000-00002", "volume": "98", "author": "Wallis", "year": "1988", "journal-title": "Laryngoscope" }, { "key": "10.5624\/isd.2012.42.4.213_ref15", "doi-asserted-by": "crossref", "first-page": "287", "DOI": "10.1002\/ca.20617", "volume": "21", "author": "Tatlisumak", "year": "2008", "journal-title": "Clin Anat" } ], "container-title": [ "Imaging Science in Dentistry" ], "original-title": [], "language": "en", "link": [ { "URL": "https:\/\/synapse.koreamed.org\/DOIx.php?id=10.5624\/isd.2012.42.4.213", "content-type": "unspecified", "content-version": "vor", "intended-application": "text-mining" }, { "URL": "https:\/\/synapse.koreamed.org\/pdf\/10.5624\/isd.2012.42.4.213", "content-type": "unspecified", "content-version": "vor", "intended-application": "text-mining" }, { "URL": "https:\/\/isdent.org\/DOIx.php?id=10.5624\/isd.2012.42.4.213", "content-type": "unspecified", "content-version": "vor", "intended-application": "similarity-checking" } ], "deposited": { "date-parts": [ [ 2020, 7, 19 ] ], "date-time": "2020-07-19T13:18:00Z", "timestamp": 1595164680000 }, "score": 1, "resource": { "primary": { "URL": "https:\/\/isdent.org\/DOIx.php?id=10.5624\/isd.2012.42.4.213" } }, "subtitle": [], "short-title": [], "issued": { "date-parts": [ [ 2012 ] ] }, "references-count": 15, "journal-issue": { "issue": "4", "published-print": { "date-parts": [ [ 2012 ] ] } }, "URL": "http:\/\/dx.doi.org\/10.5624\/isd.2012.42.4.213", "relation": {}, "ISSN": [ "2233-7822", "2233-7830" ], "issn-type": [ { "value": "2233-7822", "type": "print" }, { "value": "2233-7830", "type": "electronic" } ], "subject": [ "Radiology, Nuclear Medicine and imaging", "General Dentistry", "Radiological and Ultrasound Technology" ], "published": { "date-parts": [ [ 2012 ] ] } } }

Can anybody guide me on how to parse “reference-count” data?

Probably something like parseJson(value)[‘message’][‘reference-count’], but it’s difficult to test because your JSON data has been corrupted. It not only has “smart” (ie dumb) quotes, but also something (Discourse?) has eliminated the domain names.

Tom

Hi Tom

I appreciate your quick response. Unfortunately, the GREL is not working. I’ve attached the JSON file for your reference.

(Attachment text.json is missing)

PFA.

text.zip (1.98 KB)

When putting in JSON or GREL into a Discourse post it works best to surround it with backticks ` which will result in it being displayed without any additional formatting being applied. I've edited the original post to add in the backticks and this is now rendering the JSON correctly.

The same issue has led to the GREL in @tfmorris's reply also being mangled by the Discourse software - as this is GREL the quotes should be straigh not smart - so you will need:

parseJson(value)['message']['reference-count']

That works for me with the JSON you've posted

In case of interest I've also started a thread about whether we should change the behaviour of the forum to avoid quotes being converted to smart quotes automatically as it seems to me that this caused more problems than it solved at least in this particular case

1 Like

I heartily apologize for the misunderstanding, there was an error on my side. The GREL is working smoothly.

Thanks to both of you.