talk@lists.collectionspace.org

Targeted discussion among implementers and between implementers and the CollectionSpace development team

View all threads

schema and importing data

GJ
Gerry Johnson
Mon, Sep 2, 2019 9:38 AM

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

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
RL
Ray Lee
Sat, Sep 7, 2019 6:31 AM

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

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