✅ Prefix for keywords Tag

select _path from Tag where parentId is null

When
fs
Camera
Lens
Type
!My Keywords

Here !My Keywords is the root keyword I have in all my assets so I can easily filter our keywords I didn’t organize yet.

But in my opinion, you should not have user-defined tags (from EXIF) on top level of the tags hierarchy. I think for the consistency purposes you should have your own tag like Keywords and put all user-defined tags inside

Actually I found it’s not only internal representation concern. It’s actually a bug. Because View by keywords goes to http://localhost:1787/tag/Keywords which now has zero of my assets. But if I manually go to http://localhost:1787/tag/!My%20Keywords , I see all my assets

...
!My Keywords

Any keyword that is found to be hierarchical is added as it’s own root, so this is behaving as expected.

If you have tags you don’t want to import, and they are part of a hierarchy, you can use this setting:

# +--------------------+
# |  excludedRootTags  |
# +--------------------+
#
# Keywords starting with the given roots will be omitted from your
# PhotoStructure library.
# (env: "PS_EXCLUDED_ROOT_TAGS")
#
excludedRootTags = [
  "http:",
  "https:"
]

Does that suffice?

No it doesn’t suffice. Please see my previous message that explains why you should have to put all library keywords under PhotoStructure's Keywords tag

I’m afraid I don’t get what you’re asking.

Do you want to

A) be able to configure PhotoStructure to ignore all keywords that start with !My Keywords?

B) be able to force all keywords to live under the keywords root tag?

C) something else altogether?

Of course not :slight_smile:

I need !My Keywords to be a child tag to Keywords

Ah! Got it. I’ll think about that tonight.

So what I see are three “keyword modes”:

  1. What you’re asking, which is to simply root all encountered keywords to the Keywords/ tag

  2. What I’ve implemented, which is to try to root keywords under Who/ or Where/ when I can infer what those keywords mean, and if I can’t, just put the keyword under Keywords/

  3. What is being asked by "Who" tags are incorrectly excluded from "Keywords" which is, I believe, to do both 1. and 2.

Does this match what you’re thinking?

1 Like

Note that there is a rootTagKeywordsAliases setting that you can add !My Keywords to: setting this would put !My Keywords|nature|tree into Keywords/nature/tree within PhotoStructure.

Also: just added this new setting to beta.10:

# +----------------------+
# |  keywordReparenting  |
# +----------------------+
#
# How should PhotoStructure handle hierarchical keywords?
#
# If this is set to "move," PhotoStructure will try to put hierarchical
# keywords into their "correct" root tag, like "Who," "Album," or "Where."
#
# If this is set to "retain," PhotoStructure will always place hierarchical
# keywords under the "Keyword" root tag.
#
# If this is set to "copy," PhotoStructure will add both the "correct" root
# tag _and_ the "Keyword" tag. For example, "Person|Doe|Jane" will be tagged
# as "Who|Doe|Jane" as well as "Keyword|Person|Doe|Jane".
#
# Valid values: move,copy,retain
#
# PS_KEYWORD_REPARENTING="move"

Here’s an example:

 exiftool -j -Keywords example.jpg 
[{
  "SourceFile": "example.jpg",
  "Keywords": "Where|Dunes beach,Tag|Panorama,!My Keywords|Bunny loop,Trail"
}]

move

Here’s the tags with move (the default):

  "!My Keywords|Bunny loop",
  "Keywords|Panorama",
  "Keywords|Trail",
  "Where|Dunes beach",

(Notice that “Tag|Panorama” got moved into the Keywords root because “Tag” is an alias for 'Keywords" (as per rootTagKeywordsAliases)

copy

Here are the tags with copy:

  "!My Keywords|Bunny loop",
  "Keywords|!My Keywords|Bunny loop",
  "Keywords|Panorama",
  "Keywords|Trail",
  "Keywords|Where|Dunes beach",
  "Where|Dunes beach",

retain

@mnaoumov here’s what I (hope) you asked for:

  "Keywords|!My Keywords|Bunny loop",
  "Keywords|Panorama",
  "Keywords|Trail",
  "Keywords|Where|Dunes beach",
2 Likes

Thanks, this will work. However, what I meant was more like combination of retain and copy. Because I want to preserve all keywords as is under Keywords and copy only explicitly defined aliases such as Keywords/!My keywords/People to be copied to Who

Hmm, ok. I’ll think about how to make that happen.