WE HAVE SUNSET THIS LISTSERV - Join us at collectionspace@lyrasislists.org
View all threadsI'm trying to batch load a group of archives records with their series-item hierarchy into CollectionSpace. To figure out the necessary record structure, I used the UI to create a relationship (at the bottom of the Collection Object screen there is the section for Object Hierarchy) then looked at the /cspace-services/relations API endpoint to see the results. At that endpoint I can see the relationship document with <relationshipType>hasBroader</relationshipType>
but what I can't find is relationship type identifier (from base-other-hierarchy.xml). It doesn't seem to be in the relationship document, nor in either of the collection object documents.
Some hints?
Peter Murray
Dev/Ops Lead and Project Manager, Cherry Hill Company
Blogger, Disruptive Library Technology Jester - http://dltj.org/
Peter,
A relation XML element of "relationshipMetaType" is what I think you're asking for. I think if you don't provide it in the relation part of the payload, there is an implied value of "Set"? I'm not 100% sure of that.
For example, I created two cataloging records in the UI, related them with type "Derivative" and when using this API URL:
I get back this payload:
<document name="collectionobjects"> <ns2:collectionspace_core xmlns:ns2="http://collectionspace.org/collectionspace_core/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">...</ns2:collectionspace_core> <ns2:collectionobjects_common xmlns:ns2="http://collectionspace.org/services/collectionobject" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">...</ns2:collectionobjects_common> <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb"> <pageNum>0</pageNum> <pageSize>40</pageSize> <itemsInPage>1</itemsInPage> <totalItems>1</totalItems> <fieldsReturned> subjectCsid|relationshipType|predicateDisplayName|relationshipMetaType|objectCsid|uri|csid|subject|object </fieldsReturned> <relation-list-item> <uri>/relations/bc84d263-6183-4d8c-af35</uri> <csid>bc84d263-6183-4d8c-af35</csid> <subjectCsid>f42442f2-d1e4-4258-ab4e</subjectCsid> <relationshipType>hasBroader</relationshipType> <predicate>hasBroader</predicate> <relationshipMetaType>derivative</relationshipMetaType> <objectCsid>70208419-7d8d-4b45-bfef</objectCsid> <subject> <uri>/collectionobjects/f42442f2-d1e4-4258-ab4e</uri> <csid>f42442f2-d1e4-4258-ab4e</csid> <refName> urn:cspace:core.collectionspace.org:collectionobjects:id(f42442f2-d1e4-4258-ab4e)'middle' </refName> <name/> <number>middle</number> <documentType>CollectionObject</documentType> </subject> <object> <uri>/collectionobjects/70208419-7d8d-4b45-bfef</uri> <csid>70208419-7d8d-4b45-bfef</csid> <refName> urn:cspace:core.collectionspace.org:collectionobjects:id(70208419-7d8d-4b45-bfef)'top' </refName> <name/> <number>top</number> <documentType>CollectionObject</documentType> </object> </relation-list-item> </ns3:relations-common-list> </document>-Richard
From: Talk talk-bounces@lists.collectionspace.org on behalf of Peter Murray jester@dltj.org
Sent: Thursday, May 19, 2016 12:58 PM
To: CollectionSpace Talk List
Subject: [Talk] Where is the predicate for hierarchical relationships stored?
I'm trying to batch load a group of archives records with their series-item hierarchy into CollectionSpace. To figure out the necessary record structure, I used the UI to create a relationship (at the bottom of the Collection Object screen there is the section for Object Hierarchy) then looked at the /cspace-services/relations API endpoint to see the results. At that endpoint I can see the relationship document with <relationshipType>hasBroader</relationshipType>
but what I can't find is relationship type identifier (from base-other-hierarchy.xml). It doesn't seem to be in the relationship document, nor in either of the collection object documents.
Some hints?
Peter
--
Peter Murray
Dev/Ops Lead and Project Manager, Cherry Hill Company
Blogger, Disruptive Library Technology Jester - http://dltj.org/
Talk mailing list
Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org
Ah! That 'set' is an implied value was the missing bit. If I use a different relationship, then the relationshipMetaType shows up in the the relation document when querying the /cspace-services/relations API. Thanks, Richard.
Peter
On May 19, 2016, at 6:42 PM, Richard Millet <richard.millet@lyrasis.org mailto:richard.millet@lyrasis.org> wrote:
Peter,
A relation XML element of "relationshipMetaType" is what I think you're asking for. I think if you don't provide it in the relation part of the payload, there is an implied value of "Set"? I'm not 100% sure of that.
For example, I created two cataloging records in the UI, related them with type "Derivative" and when using this API URL:
http://localhost:8180/cspace-services/collectionobjects/70208419-7d8d-4b45-bfef?showAllRelations=true http://localhost:8180/cspace-services/collectionobjects/70208419-7d8d-4b45-bfef?showAllRelations=true
I get back this payload:
<document name="collectionobjects">
<ns2:collectionspace_core xmlns:ns2="http://collectionspace.org/collectionspace_core/ http://collectionspace.org/collectionspace_core/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance">...</ns2:collectionspace_core>
<ns2:collectionobjects_common xmlns:ns2="http://collectionspace.org/services/collectionobject http://collectionspace.org/services/collectionobject" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance">...</ns2:collectionobjects_common>
<ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb http://collectionspace.org/services/jaxb">
<pageNum>0</pageNum>
<pageSize>40</pageSize>
<itemsInPage>1</itemsInPage>
<totalItems>1</totalItems>
<fieldsReturned>
subjectCsid|relationshipType|predicateDisplayName|relationshipMetaType|objectCsid|uri|csid|subject|object
</fieldsReturned>
<relation-list-item>
<uri>/relations/bc84d263-6183-4d8c-af35</uri>
<csid>bc84d263-6183-4d8c-af35</csid>
<subjectCsid>f42442f2-d1e4-4258-ab4e</subjectCsid>
<relationshipType>hasBroader</relationshipType>
<predicate>hasBroader</predicate>
<relationshipMetaType>derivative</relationshipMetaType>
<objectCsid>70208419-7d8d-4b45-bfef</objectCsid>
<subject>
<uri>/collectionobjects/f42442f2-d1e4-4258-ab4e</uri>
<csid>f42442f2-d1e4-4258-ab4e</csid>
<refName>
urn:cspace:core.collectionspace.org:collectionobjects:id(f42442f2-d1e4-4258-ab4e)'middle'
</refName>
<name/>
<number>middle</number>
<documentType>CollectionObject</documentType>
</subject>
<object>
<uri>/collectionobjects/70208419-7d8d-4b45-bfef</uri>
<csid>70208419-7d8d-4b45-bfef</csid>
<refName>
urn:cspace:core.collectionspace.org:collectionobjects:id(70208419-7d8d-4b45-bfef)'top'
</refName>
<name/>
<number>top</number>
<documentType>CollectionObject</documentType>
</object>
</relation-list-item>
</ns3:relations-common-list>
</document>
-Richard
From: Talk <talk-bounces@lists.collectionspace.org mailto:talk-bounces@lists.collectionspace.org> on behalf of Peter Murray <jester@dltj.org mailto:jester@dltj.org>
Sent: Thursday, May 19, 2016 12:58 PM
To: CollectionSpace Talk List
Subject: [Talk] Where is the predicate for hierarchical relationships stored?
I'm trying to batch load a group of archives records with their series-item hierarchy into CollectionSpace. To figure out the necessary record structure, I used the UI to create a relationship (at the bottom of the Collection Object screen there is the section for Object Hierarchy) then looked at the /cspace-services/relations API endpoint to see the results. At that endpoint I can see the relationship document with <relationshipType>hasBroader</relationshipType>
but what I can't find is relationship type identifier (from base-other-hierarchy.xml). It doesn't seem to be in the relationship document, nor in either of the collection object documents.
Some hints?
Peter
--
Peter Murray
Dev/Ops Lead and Project Manager, Cherry Hill Company
Blogger, Disruptive Library Technology Jester - http://dltj.org/ http://dltj.org/