TITLE: Parsing of OAI_DC metadata in OpenRefine from OJS articles
AUTHORS: Alessandra  Moi, carlo.bianchini, Andrea   Marchitelli

[DESCRIPTION]
<div class = "text-blocks"><div class = "text-block">Abstract</div><div class = "text-block">Protocols for parsing metadata in OAI_DC format of articles harvested from Open Journal Systems (OJS) in order to create entities in WikiData</div></div>

[STEPS]
?. [Attività preliminari]
Import the OAI identifiers and generate the baseurl list:
?. [Attività preliminari]
Import the identifiers following the instructions in the protocolhttps://www.protocols.io/view/come-importare-identificatori-oai-pmh-in-openrefin-bp7mmrk6
?. 
?. [Attività preliminari]
From the list of imported identifiers, generate the list of baseurl for harvesting the metadata of each item according to the indications given in the protocol "Creare  baseurl per harvesting di repository OAI con OpenRefine"
N.B. For OAI_DC metadata collection, the metadataPrefix in the url must be=oai_dc
?. [Attività preliminari]
Test the operation of one of the generated URLs by clicking on the link and verifying that it opens a page with OAI_CD metadata in XML format.Es. https://aibstudi.aib.it/oai?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:ojs.riviste.aib.it:article/11366
OpenRefine will create a column containing XML text with the OAI_DC metadata of the article
?. [Harvesting dei metadati]
Click on the metadataURL column , select Edit Column > Add Column by retrieving from URLs, calling the new column metadata_oai.Once you have the metadata value for all items, you can move on to parsing
?. [Parsing dei dati]
Metadata Parsing
?. [Parsing dei dati]
Publishing datavalue.parseXml().select('record')[0].select('metadata')[0].select('oai_dc|dc')[0].select('dc|source')[0].ownText()The values exctracted with the previuos grel command usually contain the Journal title (P1433), the Volume, Issue & publication date (P478, P433, P577) and the Pages from/to (P304) in a unique stringTo extract these single values, divide using the command Edit Column > Split and choosing the appropriate separator (e.g.: ';')Total number of pages (P1104)From the column obtained by the command Split, derive two more columns (PagStr and PagFin) with the value of the starting page and the value of the ending page.Create a new colonn "NumTotPag (P1104)" based on the PagFin column with the grel command:toNumber(value-cells['PagStr'].value) + 1
?. [Parsing dei dati]
DOI (P356)value.parseXml().select('record')[0].select('metadata')[0].select('oai_dc|dc')[0].select('dc|identifier')[1].ownText()
?. [Parsing dei dati]
Title (P1476)value.parseXml().select('record')[0].select('metadata')[0].select('oai_dc|dc')[0].select('dc|title')[0].ownText()
?. [Parsing dei dati]
Authors name and related infoAuthors dataforEach(value.parseXml().select('record')[0].select('metadata')[0].select('oai_dc|dc')[0].select('dc|creator') ,v,v.ownText()).join("|")Author# inverted form Once you have the values of all authors in the column "Authors data", derive one column for each name author ("Author#1 inverted form", "Author#2 inverted form", etc...) using the command Edit Column > Split and choosing the separator |First name Author# (P735)  - Surname Author# (P734)Once you have the values in the column "Author# inverted form", derive the two columns "First name Author# (P735)" and "Surname Author# (P734)" using the command Edit Column > Split and choosing the separator ,Author# (P50) direct formCreate the new column with the grel command:cells['First name Author# (P735)'].value + ' ' + cells['Surname Author# (P734)'].value
?. [Parsing dei dati]
LinkURL (P2699)value.parseXml().select('record')[0].select('metadata')[0].select('oai_dc|dc')[0].select('dc|identifier')[0].ownText()PDF Full text (P953)value.parseXml().select('record')[0].select('metadata')[0].select('oai_dc|dc')[0].select('dc|relation')[0].ownText()
?. [Parsing dei dati]
Keyword, per languageOnce you have the values in a single cell, divide using the command Edit Column > Split and choosing the appropriate separator (e.g.: '|')KW ita (P921)value.parseXml().select('record')[0].select('metadata')[0].select('oai_dc|dc')[0].select('dc|subject[xml:lang="it-IT"]')[0].ownText()KW eng (P921)value.parseXml().select('record')[0].select('metadata')[0].select('oai_dc|dc')[0].select('dc|subject[xml:lang="en-US"]')[0].ownText()