WE HAVE SUNSET THIS LISTSERV - Join us at collectionspace@lyrasislists.org
View all threadsHi everyone,
I'm setting up an import.xml file for bulk importing. However I have two
records (one type cataloging, and one type valuation control) which are
related. I created a test sample of these on the collectionspace server
(from the UI) and set them as related. With this I was looking in their
schema (using the CSID as instructed here:
https://wiki.collectionspace.org/display/DOC/Imports+Service+Home ) to
see how they reference each other as 'related'. But from looking at both
the schemas for the cataloging record and the valuation control record,
I couldn't find anything that references either of them.
So my main question is when setting up the import xml file, what do you
need to insert to say "set record with this CSID as related"?
Thank you,
Peter
Peter,
Most of the links between cataloging records and their corresponding procedures are made via the Relationship service -see here for details https://wiki.collectionspace.org/display/DOC/Relationship+Service+RESTful+APIs. For what you're describing, you'll need to create and import relationship records.
Here is an example XML record for a relationship between a cataloging record and a valuation record:
<?xml version="1.0" encoding="UTF-8"?> <document name="relations"> <ns2:relations_common> <objectRefName>urn:cspace:core.collectionspace.org:valuationcontrols:id(4373386e-911f-48d7-a3d5)</objectRefName> <subjectDocumentType>CollectionObject</subjectDocumentType> <relationshipType>affects</relationshipType> <subjectRefName>urn:cspace:core.collectionspace.org:collectionobjects:id(98adeab5-3926-4c91-8db3)'2016.04.11'</subjectRefName> <objectCsid>4373386e-911f-48d7-a3d5</objectCsid> <subjectCsid>98adeab5-3926-4c91-8db3</subjectCsid> <objectUri>/valuationcontrols/4373386e-911f-48d7-a3d5</objectUri> <subjectUri>/collectionobjects/98adeab5-3926-4c91-8db3</subjectUri> <objectDocumentType>Valuationcontrol</objectDocumentType> </ns2:relations_common> </document>You can see more example relationship records via the Relationship REST API. For example,
http://core.collectionspace.org:8180/cspace-services/relations
-Richard
From: Talk talk-bounces@lists.collectionspace.org on behalf of Peter Tucker peter.tucker@granitehorizon.com
Sent: Tuesday, April 12, 2016 2:06 PM
To: talk@lists.collectionspace.org
Subject: [Talk] Importing related records
Hi everyone,
I'm setting up an import.xml file for bulk importing. However I have two
records (one type cataloging, and one type valuation control) which are
related. I created a test sample of these on the collectionspace server
(from the UI) and set them as related. With this I was looking in their
schema (using the CSID as instructed here:
https://wiki.collectionspace.org/display/DOC/Imports+Service+Home ) to
see how they reference each other as 'related'. But from looking at both
the schemas for the cataloging record and the valuation control record,
I couldn't find anything that references either of them.
So my main question is when setting up the import xml file, what do you
need to insert to say "set record with this CSID as related"?
Thank you,
Peter
Talk mailing list
Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org
And just in case it’s not obvious, you need to create relationship records that work in both directions. The example Richard provides is CollectionObject-affects-Valuationcontrol. You also need the Valuationcontrol-affects-CollectionObject relationship record.
Chris
On Apr 12, 2016, at 2:28 PM, Richard Millet richard.millet@lyrasis.org wrote:
Peter,
Most of the links between cataloging records and their corresponding procedures are made via the Relationship service -see here for details https://wiki.collectionspace.org/display/DOC/Relationship+Service+RESTful+APIs. For what you're describing, you'll need to create and import relationship records.
Here is an example XML record for a relationship between a cataloging record and a valuation record:
<?xml version="1.0" encoding="UTF-8"?> <document name="relations"> <ns2:relations_common> <objectRefName>urn:cspace:core.collectionspace.org:valuationcontrols:id(4373386e-911f-48d7-a3d5)</objectRefName> <subjectDocumentType>CollectionObject</subjectDocumentType> <relationshipType>affects</relationshipType> <subjectRefName>urn:cspace:core.collectionspace.org:collectionobjects:id(98adeab5-3926-4c91-8db3)'2016.04.11'</subjectRefName> <objectCsid>4373386e-911f-48d7-a3d5</objectCsid> <subjectCsid>98adeab5-3926-4c91-8db3</subjectCsid> <objectUri>/valuationcontrols/4373386e-911f-48d7-a3d5</objectUri> <subjectUri>/collectionobjects/98adeab5-3926-4c91-8db3</subjectUri> <objectDocumentType>Valuationcontrol</objectDocumentType> </ns2:relations_common> </document>You can see more example relationship records via the Relationship REST API. For example,
http://core.collectionspace.org:8180/cspace-services/relations
-Richard
From: Talk talk-bounces@lists.collectionspace.org on behalf of Peter Tucker peter.tucker@granitehorizon.com
Sent: Tuesday, April 12, 2016 2:06 PM
To: talk@lists.collectionspace.org
Subject: [Talk] Importing related records
Hi everyone,
I'm setting up an import.xml file for bulk importing. However I have two
records (one type cataloging, and one type valuation control) which are
related. I created a test sample of these on the collectionspace server
(from the UI) and set them as related. With this I was looking in their
schema (using the CSID as instructed here:
https://wiki.collectionspace.org/display/DOC/Imports+Service+Home ) to
see how they reference each other as 'related'. But from looking at both
the schemas for the cataloging record and the valuation control record,
I couldn't find anything that references either of them.
So my main question is when setting up the import xml file, what do you
need to insert to say "set record with this CSID as related"?
Thank you,
Peter
Talk mailing list
Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org
Talk mailing list
Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org
In addition to what Richard and Chris said, when I was doing this I found it easiest to create the relation records in the GUI and then query the Relationship Service REST API to see what the system did. As one gets into record hierarchies, the relationships change (and are one-way).
Peter
On Apr 12, 2016, at 5:45 PM, Chris Hoffman chris_h@berkeley.edu wrote:
And just in case it’s not obvious, you need to create relationship records that work in both directions. The example Richard provides is CollectionObject-affects-Valuationcontrol. You also need the Valuationcontrol-affects-CollectionObject relationship record.
Chris
On Apr 12, 2016, at 2:28 PM, Richard Millet richard.millet@lyrasis.org wrote:
Peter,
Most of the links between cataloging records and their corresponding procedures are made via the Relationship service -see here for details https://wiki.collectionspace.org/display/DOC/Relationship+Service+RESTful+APIs. For what you're describing, you'll need to create and import relationship records.
Here is an example XML record for a relationship between a cataloging record and a valuation record:
<?xml version="1.0" encoding="UTF-8"?> <document name="relations"> <ns2:relations_common> <objectRefName>urn:cspace:core.collectionspace.org:valuationcontrols:id(4373386e-911f-48d7-a3d5)</objectRefName> <subjectDocumentType>CollectionObject</subjectDocumentType> <relationshipType>affects</relationshipType> <subjectRefName>urn:cspace:core.collectionspace.org:collectionobjects:id(98adeab5-3926-4c91-8db3)'2016.04.11'</subjectRefName> <objectCsid>4373386e-911f-48d7-a3d5</objectCsid> <subjectCsid>98adeab5-3926-4c91-8db3</subjectCsid> <objectUri>/valuationcontrols/4373386e-911f-48d7-a3d5</objectUri> <subjectUri>/collectionobjects/98adeab5-3926-4c91-8db3</subjectUri> <objectDocumentType>Valuationcontrol</objectDocumentType> </ns2:relations_common> </document>You can see more example relationship records via the Relationship REST API. For example,
http://core.collectionspace.org:8180/cspace-services/relations
-Richard
From: Talk talk-bounces@lists.collectionspace.org on behalf of Peter Tucker peter.tucker@granitehorizon.com
Sent: Tuesday, April 12, 2016 2:06 PM
To: talk@lists.collectionspace.org
Subject: [Talk] Importing related records
Hi everyone,
I'm setting up an import.xml file for bulk importing. However I have two
records (one type cataloging, and one type valuation control) which are
related. I created a test sample of these on the collectionspace server
(from the UI) and set them as related. With this I was looking in their
schema (using the CSID as instructed here:
https://wiki.collectionspace.org/display/DOC/Imports+Service+Home ) to
see how they reference each other as 'related'. But from looking at both
the schemas for the cataloging record and the valuation control record,
I couldn't find anything that references either of them.
So my main question is when setting up the import xml file, what do you
need to insert to say "set record with this CSID as related"?
Thank you,
Peter
Talk mailing list
Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org
Talk mailing list
Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org
--
Peter Murray
Dev/Ops Lead and Project Manager
Cherry Hill Company
Thank you everyone for the feedback. This definitely helps out!
-Peter
On 04/12/2016 03:04 PM, Peter Murray wrote:
In addition to what Richard and Chris said, when I was doing this I found it easiest to create the relation records in the GUI and then query the Relationship Service REST API to see what the system did. As one gets into record hierarchies, the relationships change (and are one-way).
Peter
On Apr 12, 2016, at 5:45 PM, Chris Hoffman chris_h@berkeley.edu wrote:
And just in case it’s not obvious, you need to create relationship records that work in both directions. The example Richard provides is CollectionObject-affects-Valuationcontrol. You also need the Valuationcontrol-affects-CollectionObject relationship record.
Chris
On Apr 12, 2016, at 2:28 PM, Richard Millet richard.millet@lyrasis.org wrote:
Peter,
Most of the links between cataloging records and their corresponding procedures are made via the Relationship service -see here for details https://wiki.collectionspace.org/display/DOC/Relationship+Service+RESTful+APIs. For what you're describing, you'll need to create and import relationship records.
Here is an example XML record for a relationship between a cataloging record and a valuation record:
<?xml version="1.0" encoding="UTF-8"?> <document name="relations"> <ns2:relations_common> <objectRefName>urn:cspace:core.collectionspace.org:valuationcontrols:id(4373386e-911f-48d7-a3d5)</objectRefName> <subjectDocumentType>CollectionObject</subjectDocumentType> <relationshipType>affects</relationshipType> <subjectRefName>urn:cspace:core.collectionspace.org:collectionobjects:id(98adeab5-3926-4c91-8db3)'2016.04.11'</subjectRefName> <objectCsid>4373386e-911f-48d7-a3d5</objectCsid> <subjectCsid>98adeab5-3926-4c91-8db3</subjectCsid> <objectUri>/valuationcontrols/4373386e-911f-48d7-a3d5</objectUri> <subjectUri>/collectionobjects/98adeab5-3926-4c91-8db3</subjectUri> <objectDocumentType>Valuationcontrol</objectDocumentType> </ns2:relations_common> </document>You can see more example relationship records via the Relationship REST API. For example,
http://core.collectionspace.org:8180/cspace-services/relations
-Richard
From: Talk talk-bounces@lists.collectionspace.org on behalf of Peter Tucker peter.tucker@granitehorizon.com
Sent: Tuesday, April 12, 2016 2:06 PM
To: talk@lists.collectionspace.org
Subject: [Talk] Importing related records
Hi everyone,
I'm setting up an import.xml file for bulk importing. However I have two
records (one type cataloging, and one type valuation control) which are
related. I created a test sample of these on the collectionspace server
(from the UI) and set them as related. With this I was looking in their
schema (using the CSID as instructed here:
https://wiki.collectionspace.org/display/DOC/Imports+Service+Home ) to
see how they reference each other as 'related'. But from looking at both
the schemas for the cataloging record and the valuation control record,
I couldn't find anything that references either of them.
So my main question is when setting up the import xml file, what do you
need to insert to say "set record with this CSID as related"?
Thank you,
Peter
Talk mailing list
Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org
Talk mailing list
Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org