# Parsing CrossRef Data

**URL:** <https://forum.openrefine.org/t/parsing-crossref-data/834>\
**Category:** Support and Helpdesk\
**Created:** [June 21, 2023, 6:55pm UTC](https://forum.openrefine.org/t/parsing-crossref-data/834 "2023-06-21T18:55:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitnath](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@amitnath](https://forum.openrefine.org/u/amitnath)\
**Post date:** [June 21, 2023, 6:55pm UTC](https://forum.openrefine.org/t/parsing-crossref-data/834/1 "2023-06-21T18:55:49Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![tfmorris](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/tfmorris/32/17_2.png) [@tfmorris](https://forum.openrefine.org/u/tfmorris)\
**Post date:** [June 21, 2023, 11:43pm UTC](https://forum.openrefine.org/t/parsing-crossref-data/834/2 "2023-06-21T23:43:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amitnath](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@amitnath](https://forum.openrefine.org/u/amitnath)\
**Post date:** [June 22, 2023, 12:44am UTC](https://forum.openrefine.org/t/parsing-crossref-data/834/3 "2023-06-22T00:44:47Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![amitnath](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@amitnath](https://forum.openrefine.org/u/amitnath)\
**Post date:** [June 22, 2023, 12:47am UTC](https://forum.openrefine.org/t/parsing-crossref-data/834/4 "2023-06-22T00:47:30Z")

</div>

PFA.

[text.zip](https://forum.openrefine.org/uploads/short-url/6IZPmSkoVgGLR3CrtVP5pzw8u1q.zip) (1.98 KB)

---

<div class="post-metadata">

**Author:** ![ostephens](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/ostephens/32/8_2.png) [@ostephens](https://forum.openrefine.org/u/ostephens)\
**Post date:** [June 22, 2023, 8:25am UTC](https://forum.openrefine.org/t/parsing-crossref-data/834/5 "2023-06-22T08:25:00Z")

</div>

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

> [@Converting quotes to smart quotes in Discourse posts can lead to problems](https://forum.openrefine.org/t/converting-quotes-to-smart-quotes-in-discourse-posts-can-lead-to-problems/835):
>
> Discourse is currently automatically converting any plain quotes that are outside code blocks to smart quotes. This means that if someone forgets, or is not aware, that they should use code blocks for JSON or GREL (or other code) then they end up with non-usable JSON/GREL in their post. An example of this can be seen in this topic [Parsing CrossRef Data](https://forum.openrefine.org/t/parsing-crossref-data/834). There is a setting in Discourse which controls this, and which we have the option to turn off (see [Smart Quotes in topics? - support - Discour…](https://meta.discourse.org/t/smart-quotes-in-topics/86270)

---

<div class="post-metadata">

**Author:** ![amitnath](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@amitnath](https://forum.openrefine.org/u/amitnath)\
**Post date:** [June 22, 2023, 10:28am UTC](https://forum.openrefine.org/t/parsing-crossref-data/834/6 "2023-06-22T10:28:03Z")

</div>

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

Thanks to both of you.
