Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rdms:metadata:cli [2023/09/05 11:34]
jelte [Using the Interactive Mode]
rdms:metadata:cli [2024/03/26 10:11] (current)
jelte ↷ Links adapted because of a move operation
Line 11: Line 11:
   * Query metadata   * Query metadata
  
-While the [[rdms:access:linux:createprofile|iCommands Wiki section]] contains the information to get you started using the ''iCommands'' and also lists the commands that can be used for metadata management, the current section will further built on top of this by providing more detailed examples. +While the [[rdms:access:linux:icommands|iCommands Wiki section]] contains the information to get you started using the ''iCommands'' and also lists the commands that can be used for metadata management, the current section will further built on top of this by providing more detailed examples. 
  
 **Notes:**\\ **Notes:**\\
Line 672: Line 672:
 # Check again to see if all tasks were executed. # Check again to see if all tasks were executed.
  
-$ imeta ls -d example_file_5+$ imeta ls -d example_file_5
 AVUs defined for dataObj /rug/home/rdms-testers@rug.nl/example_file_5: AVUs defined for dataObj /rug/home/rdms-testers@rug.nl/example_file_5:
 attribute: Author attribute: Author
Line 731: Line 731:
  
 <code> <code>
-# This example will first query for all files in the collection at '<path>' that have a name of the type 'TEST%' (e.g. 'TEST_Sample', 'TEST_Reaction', etc.).+iquest 'set -d %s/%s <attribute> <value> <unit>' "select COLL_NAME, DATA_NAME where COLL_NAME like '<path>' and DATA_NAME like 'TEST%'" | imeta 
 + 
 +# This example will first query for all files in the collection '<path>' and its sub-collections that have a name of the type 'TEST%' (e.g. 'TEST_Sample', 'TEST_Reaction', etc.). 
 + 
 +$ iquest 'set -d %s/%s Author "Name Surnmane"' "select COLL_NAME, DATA_NAME where COLL_NAME like '/rug/home/rdms-testers@rug.nl%' and DATA_NAME like 'TEST%'" 
 + 
 # It will then use this query result and use them for the 'set -d <path>/<filename> <attribute> <value> <unit>' statement. # It will then use this query result and use them for the 'set -d <path>/<filename> <attribute> <value> <unit>' statement.
 +
 +set -d /rug/home/rdms-testers@rug.nl/TEST123.png Author "Name Surnmane"
 +set -d /rug/home/rdms-testers@rug.nl/another_folder/TEST_File Author "Name Surnmane"
 +set -d /rug/home/rdms-testers@rug.nl/another_folder/example_folder_4/TESTERS.pptx Author "Name Surnmane"
 +set -d /rug/home/rdms-testers@rug.nl/another_folder/example_folder_6/TESTing_stuff.txt Author "Name Surnmane"
 +
 +
 # This will then be piped into 'imeta'. As a result the AVUs specified in the 'set' statement will be added to all files that met the query condition. # This will then be piped into 'imeta'. As a result the AVUs specified in the 'set' statement will be added to all files that met the query condition.
  
-iquest 'set -d %s/%s <attribute> <value> <unit>' "select COLL_NAME, DATA_NAME where COLL_NAME '<path>' and DATA_NAME like 'TEST%'" | imeta +iquest 'set -d %s/%s Author "Name Surnmane"' "select COLL_NAME, DATA_NAME where COLL_NAME like '/rug/home/rdms-testers@rug.nl%' and DATA_NAME like 'TEST%'" | imeta 
-</code>+imeta>imeta>imeta>imeta>imeta>
  
 +
 +# As a result, the metadata was added to all the files that were found in a single command
 +
 +$ imeta ls -d /rug/home/rdms-testers@rug.nl/TEST123.png
 +AVUs defined for dataObj /rug/home/rdms-testers@rug.nl/TEST123.png:
 +attribute: Author
 +value: Name Surnmane
 +units: 
 +
 +$ imeta ls -d /rug/home/rdms-testers@rug.nl/another_folder/TEST_File
 +AVUs defined for dataObj /rug/home/rdms-testers@rug.nl/another_folder/TEST_File:
 +attribute: Author
 +value: Name Surnmane
 +units: 
 +
 +$ imeta ls -d /rug/home/rdms-testers@rug.nl/another_folder/example_folder_4/TESTERS.pptx
 +AVUs defined for dataObj /rug/home/rdms-testers@rug.nl/another_folder/example_folder_4/TESTERS.pptx:
 +attribute: Author
 +value: Name Surnmane
 +units: 
 +
 +$ imeta ls -d /rug/home/rdms-testers@rug.nl/another_folder/example_folder_6/TESTing_stuff.txt
 +AVUs defined for dataObj /rug/home/rdms-testers@rug.nl/another_folder/example_folder_6/TESTing_stuff.txt:
 +attribute: Author
 +value: Name Surnmane
 +units: 
 +</code>