WE HAVE SUNSET THIS LISTSERV - Join us at collectionspace@lyrasislists.org
View all threadsI need to import data into collection space. I have my own tenant running and I can update the system.
I need to import data from our existing system. I am having difficulty finding the information on the schema and how thing are organized. I need to be pointed to documentation that will help. I have my own tools and can view the data structure and tables.
Gerry Johnson
Chestervile and District Historical Society
Hi Gerry,
Imports are typically done through the REST API. For documentation, start here: https://collectionspace.atlassian.net/wiki/spaces/DOC/pages/701466725/Common+Services+REST+API+documentation
I suggest using the UI to create and save a record of the type you want to import, and retrieving that record through the REST API. That will give you a template to use for creating other records of the type. For example, If you create and save an Object record, the URL in the browser will end with the CSID of the record (a GUID), e.g. 15593391-d745-4e30-98a9. Use that CSID to retrieve the record through the API. For example, using curl:
curl -u admin@core.collectionspace.org http://localhost:8180/cspace-services/collectionobjects/15593391-d745-4e30-98a9 -o collectionobject.xml
(Replace localhost:8180 with the hostname/port of your cspace server).
The collectionobject.xml file will then contain the XML representation of the record, which you can modify. Then use the REST API to create a new record, for example:
curl -i -u admin@core.collectionspace.org -X POST http://localhost:8180/cspace-services/collectionobjects -T collectionobject.xml -H 'Content-type: application/xml'
Once you're comfortable with that, you may prefer to use the import service, which allows you to import many records of different types in a single request. Start with the documentation here: https://collectionspace.atlassian.net/wiki/spaces/DOC/pages/701466780/Imports+Service+Home
Let us know if you have any more questions.
Ray
Ray Lee
CollectionSpace Senior Developer
LYRASIS
ray.lee@lyrasis.org
From: Talk talk-bounces@lists.collectionspace.org on behalf of Gerry Johnson gjohnson_2003@hotmail.com
Sent: Monday, September 2, 2019 2:38 AM
To: talk@lists.collectionspace.org
Subject: [Talk] schema and importing data
I need to import data into collection space. I have my own tenant running and I can update the system.
I need to import data from our existing system. I am having difficulty finding the information on the schema and how thing are organized. I need to be pointed to documentation that will help. I have my own tools and can view the data structure and tables.
Gerry Johnson
Chestervile and District Historical Society