CSV-Import Module - Data Type - config file

Hi,

we are using OmekaS in our project for a while now but just stumbled upon an issue when we use the CSV-Import Module to bulk import data into our database.
We are using a visualization tool that accesses our database via the API and we noticed that items that we have imported with the CSV Module are not picked up properly because the type of entries is conflicting.
As we are using the CSV-Module sort of “out-of-the-box”, we have no custom data types and locations are imported via the uri type.
However, the viz tool can only work with a type:“valuesuggest:geonames:geonames”

structure loc

There is a data type section in the config file of the csv import tool, and I was wondering if adding this specific type there could address our issue.

Does anyone have some experience with this? How can we change the type: of the data we import to this specific value?

The trouble here is that ValueSuggest is really used for its UI autosuggest feature, so it doesn’t support CSV Import.

I haven’t tried it out for this specifically but you probably can indeed just add an entry there if all you want is the type to be set. The entry would look like:

'csv_import' => [
    'data_types' => [
        'valuesuggest:geonames:geonames' => [
            'label' => 'Geonames',
            'adapter' => 'uri',
        ],
    ],
],

You can just add it to what’s already there in the CSV Import module’s config file (so just the inner part alongside the existing ones), or you can put it in your install’s config/local.config.php file (which could be a better idea so it doesn’t get lost during an upgrade).

Then to use the type you’d pick the “Geonames” type using the “wrench” icon for a column.

It’s not going to do any validation that the URI you put in is actually a Geonames URI, though, or that the label and URI you give match, etc. All it would do is make the saved type change.

As an aside, does the tool you’re using really need to look for the “valuesuggest:geonames:geonames” type? That’s specific to the ValueSuggest module, so this is clearly something with some Omeka S “knowledge” built in… it seems like just looking for values with @id starting http://www.geonames.org/ would avoid you having to mess with this at all.

1 Like

Thank you - this worked and resolved our issue. This will save us a lot of time now - thank you!

I changed the config file of the csv module. The development of the viz tool is out of our hands, so I had to try to bring the data in the way they have set it up.