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:33]
jelte [Query Metadata] Hidden
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 451: Line 451:
 </hidden> </hidden>
 ==== Copy Metadata  ==== ==== Copy Metadata  ====
 +<hidden>
 To copy metadata to a file/folder from another, the following commands is used: To copy metadata to a file/folder from another, the following commands is used:
  
Line 461: Line 461:
  
 **Note**:\\ **Note**:\\
-This functionality is currently blocked on our system!  +This functionality is currently blocked on our system, but will soon be available!  
 +</hidden>
 ==== Query Metadata  ==== ==== Query Metadata  ====
 <hidden> <hidden>
Line 644: Line 644:
 </hidden> </hidden>
 ==== Using the Interactive Mode  ==== ==== Using the Interactive Mode  ====
 +<hidden>
 It is also possible to use the ''imeta'' command in an interactive mode. To enter the interactive mode, just type ''imeta'' without any additional subcommand. It is also possible to use the ''imeta'' command in an interactive mode. To enter the interactive mode, just type ''imeta'' without any additional subcommand.
  
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 686: Line 686:
 units:  units: 
 </code> </code>
 +</hidden>
 ==== Further Tips  ==== ==== Further Tips  ====
  
Line 730: 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>