Project

General

Profile

Actions

Question #1780

closed

Link multiple entities at import

Added by Luke Günther over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Data import/export
Target version:
-
Start date:
2022-08-10
Estimated time:

Description

Hello OpenAtlas team, I'm part of the Itinera Nova Project group at the CCEH in Cologne. We've been in contact with Bernhard to discuss our migration/import of toponym data into OpenAtlas.

Our data consists of toponym names, their aliases, in which district and what type of place (street, building etc) they are. Each toponym is linked to a source and external references. It would be immensely helpful to be able to both import and link multiple of these entities in one step.

Our idea is to build a table of links which includes all relevant other entities for each toponym/item, e.g. to link a place to its source document.


Files

links.csv (131 Bytes) links.csv Bernhard Koschiček-Krombholz, 2022-08-24 11:40
places.csv (274 Bytes) places.csv Bernhard Koschiček-Krombholz, 2022-08-24 11:40
bibliography.csv (98 Bytes) bibliography.csv Bernhard Koschiček-Krombholz, 2022-08-24 11:41
Actions #1

Updated by Bernhard Koschiček-Krombholz over 2 years ago

  • Category set to Data import/export
  • Status changed from New to In Progress
  • Assignee set to Bernhard Koschiček-Krombholz

Thank you for your interesting question. Currently, it is not possible to import links with the user interface.

One possibility to enter links between entities would be to use the import information stored in the database import schema. One important requirement is, that respective entities have a unique ID at the CSV import. You could then e.g. create a CSV file with the columns origin_domain_id, origin_range_id and property, and use that for an SQL. For example:

INSERT INTO model.link (domain_id, range_id, property_code) 
VALUES (
  (SELECT entity_id FROM import.entity WHERE origin_id = origin_domain_id),
  (SELECT entity_id FROM import.entity WHERE origin_id = origin_range_id),
  'P46'
);

This is just an example, and instead of P46 you have to choose the needed property. Maybe it would be easier with a script.

Feel free to contact us, in case you have more questions.

Updated by Bernhard Koschiček-Krombholz over 2 years ago

Here is an example, how the link table may look like.

The places.csv and bibliography.csv can be imported via the user interface in OpenAtlas. With a (python) script, using the SQL example, one can use the link.csv to link the entities.
I hope this will help you for the moment. Feel free to contact us, if more questions arise.

Actions #3

Updated by Alexander Watzinger about 2 years ago

This question hasn't received a feedback to the provided answer for quite some time but feel free to add some.
@ @Bernhard Koschiček-Krombholz: in case there are no updates, I would suggest you close this issue.

Actions #4

Updated by Luke Günther about 2 years ago

  • Status changed from In Progress to Closed

After speaking with Bernhard, I am going to close this issue for now. Thanks again for giving me the necessary hints. Your advice was really helpful and appreciated, hopefully I can still implement this at some point.

Actions

Also available in: Atom PDF