Question to structures / structure syntax

Started by herb, June 03, 2018, 06:10:06 AM

Previous topic - Next topic

herb

Hello Phil,

When I started to work/test with structures I thought that it is only possible to delete a structure (tag) or to write it as given at commandline.
Here I do not talk about usage of flattened tag-names which allow to address each object/element of a structure.
Here I talk only about structure syntax -tag=[{... or -tag={...

Playing with structure -NewXMPxxxStruct which is part of the example.config file I was astonished
that it is also possible to add/remove an object to/from a structure list with:
-NewXMPxxxStruct+={Things={What=new_what}} or
-NewXMPxxxStruct-={Things={What=old_what}}

It seems that the removing of an object only works in case of the entered value (here: {Things={What=old_what}}) matches exactly an stored object.
Is this true?


Playing with structure DCEvent of DarwinCore tags I have seen that e.g.:
- exiftool.exe -xmp-dwc:DCEvent-={EventID=value-store-in file} does delete the whole tag DCEvent and
- exiftool.exe -xmp-dwc:DCEvent-={EventID=value-different-to-stored-value} does nothing (and gives an error message).
Here I ask: is this really the designed behaviour?

Now I am very unsure what is/should be possible in case of write or modify structures (using structure-syntax only).
Where can I find an answer?
I do not ask because of a feature request, I only want to get an overview.

Thanks for your help in advance.
Best regards
Herb

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

herb

Hello Phil,

Sorry for my (very) late reply. Your hint is very useful.
And yes I have read it a long time ago when I was interested only in flattened tags.

Please allow an additional question to copying structured information:
By default, tags are copied as structures, which means that the whole structure is replaced inside the destination file.
Disabling the copy-as-structure feature with option --struct means that e.g. an object (represented by a flattened tag) can be added to the structure in destination file.

Are there more differences copying structures?

Thanks for your help in advance
Best regards
Herb

Phil Harvey

Hi Herb,

Quote from: herb on June 15, 2018, 06:43:05 AM
Disabling the copy-as-structure feature with option --struct means that e.g. an object (represented by a flattened tag) can be added to the structure in destination file.

Yes.  But if the structures are in a list then the flattened tags will be added to the first structure in the list that doesn't contain that element.

QuoteAre there more differences copying structures?

You just have to keep in mind what I just said.  The implication is that elements of structures in lists may move to different structures, which isn't usually desirable.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

herb

Hello Phil,

thanks for your quick reply and the detailed explanations.

Best regards
Herb