@@ -839,8 +839,6 @@ def get_parent_activity_uuid_from_entity(neo4j_driver, entity_uuid):
839839 the uuid of the associated collection
840840"""
841841def link_publication_to_associated_collection (neo4j_driver , entity_uuid , associated_collection_uuid ):
842- # NOTE: As of 5/30/2025, the [:USES_DATA] workaround has been deprecated.
843- # Still keep it in the code until further decision - Zhou
844842 try :
845843 with neo4j_driver .session () as session :
846844 tx = session .begin_transaction ()
@@ -1109,9 +1107,6 @@ def get_next_revision_uuids(neo4j_driver, uuid):
11091107"""
11101108def get_collection_associated_datasets (neo4j_driver , uuid , property_key = None ):
11111109 results = []
1112-
1113- # NOTE: As of 5/30/2025, the [:USES_DATA] workaround has been deprecated.
1114- # Still keep it in the code until further decision - Zhou
11151110 if property_key :
11161111 query = (f"MATCH (e:Entity)-[:IN_COLLECTION|:USES_DATA]->(c:Collection) "
11171112 f"WHERE c.uuid = '{ uuid } ' "
@@ -1210,9 +1205,6 @@ def get_dataset_collections(neo4j_driver, uuid, property_key = None, properties_
12101205"""
12111206def get_publication_associated_collection (neo4j_driver , uuid ):
12121207 result = {}
1213-
1214- # NOTE: As of 5/30/2025, the [:USES_DATA] workaround has been deprecated.
1215- # Still keep it in the code until further decision - Zhou
12161208 query = (f"MATCH (p:Publication)-[:USES_DATA]->(c:Collection) "
12171209 f"WHERE p.uuid = '{ uuid } ' "
12181210 f"RETURN c as { record_field_name } " )
@@ -1229,6 +1221,41 @@ def get_publication_associated_collection(neo4j_driver, uuid):
12291221
12301222 return result
12311223
1224+
1225+ """
1226+ Get the associated collection for a given publication
1227+
1228+ Parameters
1229+ ----------
1230+ neo4j_driver : neo4j.Driver object
1231+ The neo4j database connection pool
1232+ uuid : str
1233+ The uuid of publication
1234+ property_key : str
1235+ A target property key for result filtering
1236+
1237+ Returns
1238+ -------
1239+ dict
1240+ A dictionary representation of the chosen values
1241+ """
1242+ def get_collection_associated_publication (neo4j_driver , uuid ):
1243+ result = {}
1244+ query = (f"MATCH (p:Publication)-[:USES_DATA]->(c:Collection) "
1245+ f"WHERE c.uuid = '{ uuid } ' "
1246+ f"RETURN {{uuid: p.uuid, hubmap_id: p.hubmap_id, title: p.title}} AS publication" )
1247+
1248+ logger .info ("=====get_collection_associated_publication() query======" )
1249+ logger .debug (query )
1250+
1251+ with neo4j_driver .session () as session :
1252+ record = session .run (query ).single ()
1253+ if record :
1254+ result = record ["publication" ]
1255+ return result
1256+
1257+
1258+
12321259"""
12331260Get the associated Upload for a given dataset
12341261
@@ -2057,8 +2084,6 @@ def delete_ancestor_linkages_tx(neo4j_driver, entity_uuid, ancestor_uuids):
20572084 The uuid to target publication
20582085"""
20592086def _delete_publication_associated_collection_linkages_tx (tx , uuid ):
2060- # NOTE: As of 5/30/2025, the [:USES_DATA] workaround has been deprecated.
2061- # Still keep it in the code until further decision - Zhou
20622087 query = (f"MATCH (p:Publication)-[r:USES_DATA]->(c:Collection) "
20632088 f"WHERE p.uuid = '{ uuid } ' "
20642089 f"DELETE r" )
0 commit comments