Question #1780
closedLink multiple entities at import
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
Updated by Bernhard Koschiček-Krombholz about 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 about 2 years ago
- File links.csv links.csv added
- File places.csv places.csv added
- File bibliography.csv bibliography.csv added
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.
Updated by Alexander Watzinger almost 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.
Updated by Luke Günther almost 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.