Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-2242

ValueSeparator not working in CSV (BTE)

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Answered
    • Affects Version/s: 4.1
    • Fix Version/s: None
    • Component/s: Documentation, DSpace API
    • Labels:
      None
    • Environment:
      CentOS, dspace-cris
    • Attachments:
      0
    • Comments:
      5
    • Documentation Status:
      Needed

      Description

      Hi, I'm trying to use the import option of the dspace binary in order to add some new metadata items by csv, specially the problem is when I need to add more than one author.

      I have been configuring the bte.xml file for csv import, adding all my dc fields:

      <bean id="csvDataLoader" class="gr.ekt.bteio.loaders.CSVDataLoader">
      <property name="fieldMap">
      <map>
      <entry key="0" value="title" />
      <entry key="1" value="authors" />
      <entry key="2" value="issued" />
      <entry key="3" value="journal" />
      <entry key="4" value="abstract" />
      <entry key="5" value="jissn" />
      <entry key="6" value="subtype" />
      <entry key="7" value="doi" />
      <entry key="8" value="handle" />
      <entry key="9" value="citation" />
      <entry key="10" value="publisher" />
      <entry key="11" value="groupauthors" />
      <entry key="12" value="directors" />
      </map>
      </property>
      <property name="skipLines" value="1" />

      </bean>

      and in the same file I added the new non default dc fields in outputMap.

      I have tried to import this csv:

      title,authors,issued,journal,abstract,jissn,type,doi,handle,citation,publisher,groupAuthors
      "SMOS calibration","author a||author b",2008-03-01,,,,Journal Article,"10.1309/TTRS.2007.914560","null","IEEE transactions","IEEE transactions","null",

      So, execute the import command as ./dspace import -b -m mapFile -e my.email.here@dspace.com -c 123456789/2 -s test.csv -i csv

      and the output is this:

      Destination collections:
      Owning Collection: prova
      INFO: Dataloader will load data from the file specified in the command prompt (and not from the Spring XML configuration file)
      INFO: Dataloader gr.ekt.bteio.loaders.CSVDataLoader@7425029d will be used for the import!
      Adding items from directory: /dades/dspace/imports/20141104_1321_OnSJOJFO
      Generating mapfile: mapFile
      Adding item from directory 00001
      Loading dublin core from /dades/dspace/imports/20141104_1321_OnSJOJFO/00001/dublin_core.xml
      Schema: dc Element: description Qualifier: abstract Value:
      Schema: dc Element: source Qualifier: Value:
      Schema: dc Element: publisher Qualifier: Value: IEEE transactions
      Schema: dc Element: contributor Qualifier: author Value: author a||author b
      Schema: dc Element: type Qualifier: Value: Journal Article
      Schema: dc Element: identifier Qualifier: uri Value: null
      Schema: dc Element: identifier Qualifier: citation Value: IEEE transactions
      Schema: dc Element: contributor Qualifier: authors Value: null
      Schema: dc Element: title Qualifier: Value: SMOS calibration
      Schema: dc Element: identifier Qualifier: doi Value: 10.1309/TTRS.2007.914560
      Schema: dc Element: contributor Qualifier: advisor Value:
      Schema: dc Element: date Qualifier: issued Value: 2008-03-01
      Schema: dc Element: identifier Qualifier: issn Value:
      Processing contents file: /dades/dspace/imports/20141104_1321_OnSJOJFO/00001/contents
      Processing handle file: handle
      It appears there is no handle file – generating one
      0 00001
      Started: 1415103680884
      Ended: 1415103685641
      Elapsed time: 4 secs (4757 msecs)

      As you can see, the authors are not spltited correctly.

      I saw in bte.xml this comment " In this case the CSVDataLoader can split the CSV value into its individual values, if they are separated with valueSeparator. This can be a full java regular expression. Default value: null (the csv value is not used by default). -->

      So I uncommented the line valueseparator = || in /config/modules/bulkedit.cfg without effect.

      I don't understand why is not working, and why in bte.xml says that default separator value is null and in bulkedit.cfg says that default value is ||

      Thanks.

        Attachments

          Activity

            People

            • Assignee:
              kstamatis Kostas Stamatis
              Reporter:
              Pablo Pablo Buenaposada
              Reviewer:
              Andrea Bollini (4Science)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: