This is what we have adopted, and I'm using unit to denote
special iRODS values, this way when I want to sweep for items
marked up with HIVE vocabulary terms my genquery is just
looking for iRODSUserTagging:RDF:HIVE in units which makes a
nice efficient query, then I put the full uri for the resource
in attribute and overload the value with other additional
info. The delimited approach works though it is then hard to
query since it's so arbitrary.
2.Are there any design patterns or example rules for making some AVU units as read-only by end-users?
--
"iRODS: the Integrated Rule-Oriented Data-management System; A community driven, open source, data grid software solution" https://www.irods.org
iROD-Chat: http://groups.google.com/group/iROD-Chat
---
You received this message because you are subscribed to the Google Groups "iRODS-Chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to irod-chat+...@googlegroups.com.
266 # If an AVU is not protected, it sets the AVU to the given item
267 setAVUIfUnprotected(*ItemType, *ItemName, *A, *V, *U) {
268 if (!avuProtected(*A)) {
269 msiSetAVU(*ItemType, *ItemName, *A, *V, *U);
270 }
271 }
272
273 # Copies the unprotected AVUs from a given collection to the given item.
274 cpUnprotectedCollAVUs(*Coll, *TargetType, *TargetName) =
275 foreach (*avu in SELECT META_COLL_ATTR_NAME, META_COLL_ATTR_VALUE, META_COLL_ATTR_UNITS
276 WHERE COLL_NAME == *Coll) {
277 setAVUIfUnprotected(*TargetType, *TargetName, *avu.META_COLL_ATTR_NAME,
278 *avu.META_COLL_ATTR_VALUE, *avu.META_COLL_ATTR_UNITS);
279 }
280
281 # Copies the unprotected AVUs from a given data object to the given item.
282 cpUnprotectedDataObjAVUs(*ObjPath, *TargetType, *TargetName) {
283 msiSplitPath(*ObjPath, *parentColl, *objName);
284 foreach (*avu in SELECT META_DATA_ATTR_NAME, META_DATA_ATTR_VALUE, META_DATA_ATTR_UNITS
285 WHERE COLL_NAME == *parentColl AND DATA_NAME == *objName) {
286 setAVUIfUnprotected(*TargetType, *TargetName, *avu.META_DATA_ATTR_NAME,
287 *avu.META_DATA_ATTR_VALUE, *avu.META_DATA_ATTR_UNITS);
288 }
289 }
290
291 # Copies the unprotected AVUs from a given resource to the given item.
292 cpUnprotectedRescAVUs(*Resc, *TargetType, *TargetName) =
293 foreach (*avu in SELECT META_RESC_ATTR_NAME, META_RESC_ATTR_VALUE, META_RESC_ATTR_UNITS
294 WHERE RESC_NAME == *Resc) {
295 setAVUIfUnprotected(*TargetType, *TargetName, *avu.META_RESC_ATTR_NAME,
296 *avu.META_RESC_ATTR_VALUE, *avu.META_RESC_ATTR_UNITS);
297 }
298
299 # Copies the unprotected AVUs from a given resource group to the given item.
300 cpUnprotectedRescGrpAVUs(*Grp, *TargetType, *TargetName) =
301 foreach (*avu in SELECT META_RESC_GROUP_ATTR_NAME, META_RESC_GROUP_ATTR_VALUE,
302 META_RESC_GROUP_ATTR_UNITS
303 WHERE RESC_GROUP_NAME == *Grp) {
304 setAVUIfUnprotected(*TargetType, *TargetName, *avu.META_RESC_GROUP_ATTR_NAME,
305 *avu.META_RESC_GROUP_ATTR_VALUE, *avu.META_RESC_GROUP_ATTR_UNITS);
306 }
307
308 # Copies the unprotected AVUs from a given user to the given item.
309 cpUnprotectedUserAVUs(*User, *TargetType, *TargetName) =
310 foreach (*avu in SELECT META_USER_ATTR_NAME, META_USER_ATTR_VALUE, META_USER_ATTR_UNITS
311 WHERE USER_NAME == *User) {
312 setAVUIfUnprotected(*TargetType, *TargetName, *avu.META_RESC_ATTR_NAME,
313 *avu.META_RESC_ATTR_VALUE, *avu.META_RESC_ATTR_UNITS);
314 }
431 # This rule ensures that only the non-protected AVUs are copied from one item to another.
432 acPreProcForModifyAVUMetadata(*Option, *SourceItemType, *TargetItemType, *SourceItemName,
433 *TargetItemName) {
434 if (!isRodsAdmin($userNameClient)) {
435 if (*SourceItemType == '-c') {
436 cpUnprotectedCollAVUs(*SourceItemName, *TargetItemType, *TargetItemName);
437 } else if (*SourceItemType == '-d') {
438 cpUnprotectedDataObjAVUs(*SourceItemName, *TargetItemType, *TargetItemName);
439 } else if (*SourceItemType == '-g') {
440 cpUnprotectedRescGrpAVUs(*SourceItemName, *TargetItemType, *TargetItemName);
441 } else if (*SourceItemType == '-r') {
442 cpUnprotectedRescAVUs(*SourceItemName, *TargetItemType, *TargetItemName);
443 } else if (*SourceItemType == '-u') {
444 cpUnprotectedUserAVUs(*SourceItemName, *TargetItemType, *TargetItemName);
445 }
446
447 # fail to prevent iRODS from also copying the protected metadata
448 cut;
449 failmsg(0, "IPLANT SUCCESS: Successfully copied the unprotected metadata.");
450 }
451 }