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/01 15:47]
jelte Introduced link to templates
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 118: Line 118:
  
 ==== Read/List Metadata  ==== ==== Read/List Metadata  ====
 +<hidden>
 To list the metadata that is currently added to data that resides in the RDMS, the following command is used: To list the metadata that is currently added to data that resides in the RDMS, the following command is used:
  
Line 209: Line 209:
 units:  units: 
 </code> </code>
 +</hidden>
 ==== Adding Metadata  ==== ==== Adding Metadata  ====
 +<hidden>
 To add metadata to a file/folder, the following command is used: To add metadata to a file/folder, the following command is used:
  
Line 283: Line 283:
 units:  units: 
 </code> </code>
 +</hidden>
 ==== Modifying Metadata  ==== ==== Modifying Metadata  ====
 +<hidden>
 To modify metadata to a file/folder, the following commands are used: To modify metadata to a file/folder, the following commands are used:
  
Line 355: Line 355:
 units: miles units: miles
 </code> </code>
 +</hidden>
 ==== Set Metadata  ==== ==== Set Metadata  ====
 +<hidden>
 Alternatively to ''imeta mod'', it is also possible to use ''imeta set'' which sets the value(s) that are currently set for AVU triple to one (!) new value. The general syntax for this sub-command is: Alternatively to ''imeta mod'', it is also possible to use ''imeta set'' which sets the value(s) that are currently set for AVU triple to one (!) new value. The general syntax for this sub-command is:
  
Line 410: Line 410:
 units:  units: 
 </code> </code>
 +</hidden>
  
 ==== Removing Metadata  ==== ==== Removing Metadata  ====
 +<hidden>
 To remove metadata to a file/folder, the following commands is used: To remove metadata to a file/folder, the following commands is used:
  
Line 449: Line 449:
 units:  units: 
 </code> </code>
 +</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 460: 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>
 To query for metadata, the following command is used: To query for metadata, the following command is used:
  
Line 640: Line 642:
 dataObj: example_file_9 dataObj: example_file_9
 </code> </code>
 +</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.
  
 You can see that you are in the interactive mode of ''imeta'' when the ''imeta>'' is displayed in your terminal.  You can see that you are in the interactive mode of ''imeta'' when the ''imeta>'' is displayed in your terminal. 
  
-Once in the interactive mod, subsequent commands can be added after each other. If you want to leave the interactive mode again, type ''q'' or ''quit'' and confirm. +Once in the interactive mode, subsequent commands can be added after each other. If you want to leave the interactive mode again, type ''q'' or ''quit'' and confirm. 
  
 **Examples:** **Examples:**
Line 669: 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 683: Line 686:
 units:  units: 
 </code> </code>
 +</hidden>
 ==== Further Tips  ==== ==== Further Tips  ====
  
-This sections contains some further important and helpful tips for the working with metadata from the CLI.+This section contains some further important and helpful tips for the working with metadata from the CLI.
  
  
Line 727: 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>