#1 2020-07-09 09:41:10

qusi
Member
2019-10-17
5

Import hierarchical keywords into the database

Hello/Hi/Greetings,

Our images have hierarchically organized keywords. Obviously, Piwigo did not take over the hierarchy while reading them, but I saw this should be possible. What is the latest, best way for Piwigo to read the keywords hierarchically into the database?

Why we need the hierarchical keywords: We want to build a template for Piwigo that displays the keywords hierarchically as they are in the images. This will help us and the users to search in a structured way.

See the planned side menu:
https://www.traumtreppe.ch/2020-07-09/01_Index%20Side%20Menu.jpg

Piwigo version: 2.10.2
PHP version: 7.2.31
MySQL version: 5.5.5-10.1.45-MariaDB
Piwigo URL: http://www.traumtreppe.ch

Offline

 

#2 2020-08-25 12:16:53

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13875

Re: Import hierarchical keywords into the database

Tags are not hierarchical. With [extension by plg] Tag Groups you can simulate 2 levels, but not more.

Albums are hierarchical. You can use them quite the same way as tags if you want.

Offline

 

#3 2020-08-25 20:10:46

qusi
Member
2019-10-17
5

Re: Import hierarchical keywords into the database

Well, I tested the plugin. This does not help me to import the hierarchical keywords from the images as hierarchically recognizable keywords into the database. Is this possible, and how big would the effort be?
Actually we need 3 levels, but maybe we should start with 4 levels from the beginning, if that is not much more complicated. Let's think about.

Offline

 

#4 2020-08-29 16:51:05

Aevaris
Member
2020-08-23
13

Re: Import hierarchical keywords into the database

What are you trying to do?

If you need a structured hierarchy, you could use the galleries synchronize feature since that will import the images as albums as defined by your folder hierarchy wherever the images are stored. That will likely be the best/most maintainable method for a structured hierarchy.

Offline

 

#5 2020-08-31 08:41:12

qusi
Member
2019-10-17
5

Re: Import hierarchical keywords into the database

We are not looking for a hierarchical folder structure, we want to be able to display the keywords for the user not only in a cloud, but structured as they are captured in the images. Let me explain:
The keywords are captured hierarchically in the images. In Digikam it looks like this:
https://www.traumtreppe.ch/2020-07-09/hierarchical-keywords-digikam.jpg
From this we want to create a menu that has the same hierarchy. The user can open and collapse the menu items, and select the keywords of his choice. This gives him a much better overview of the choices he has. But this requires that the keywords are stored in the database in a way that the hierarchy remains recognizable without confusing the whole logic of the piwigo database.
Here the draft of this menu:
https://www.traumtreppe.ch/2020-07-09/01_Index%20Side%20Menu.jpg
We are also happy to share the extension with the community if it ever works and proves itself. I am convinced that it will be a very useful extension, not only for us.

Hence the key question: what is the best way to write the hierarchy of the keywords to the database?
thanks in advance for all input.

Last edited by qusi (2020-08-31 08:44:13)

Offline

 

#6 2020-10-28 12:08:50

quovadit
Member
2013-11-03
2

Re: Import hierarchical keywords into the database

I would love to have this feature, it's the one missing thing I always wanted to have in piwigo!

As an input: darktable stores hierarchical tags as 'hierarchicalSubject' in the form 'One|Two|Three|Four'

So I would use the existing 'keywords' field in the table 'meta' and simply fill it with the pipe-separated string 'One|Two|Three|Four''.

The plugin could then parse this string and show a hierarchy level for every pipe.

Please let me know if I can help in any way (I have very limited programming skills but could test or design)

Offline

 

#7 2021-08-23 14:10:34

parag
Member
2021-05-29
10

Re: Import hierarchical keywords into the database

I am looking for a solution to this exact problem. Has anyone found any solutions?
I also want to create an expandable and multi-selectable menu for keywords in an hierarchy.
PLease guide me.

Gallery: photos.lagubandhu.com
Version: Piwigo 11.5.0

Offline

 

#8 2021-10-14 14:34:31

Crythes
Member
2020-01-23
120

Re: Import hierarchical keywords into the database

I just wanted to say that having this feature would be great. I think it's much better to prioritize improving the functionality of such an important system as keywords, than trying to make the admin page look "pretty"....

Last edited by Crythes (2021-10-14 14:34:50)

Offline

 

#9 2021-10-14 16:11:49

TOnin
Member
1970-01-01
109

Re: Import hierarchical keywords into the database

Hi, I feel concerned by this tag tree question.
On my way, I'm still using jBrout to tag pictures. I have translated the jBrout xml categories/tags tree into a static page incorporated in the menu with Additional Pages plugin https://piwigo.org/ext/extension_view.php?eid=153
[extension by P@t] Additional Pages
The translation is made, once in a while, with a PHP script, which gets each tag url from piwigo tags list page tags.php?display_mode=letters ; and builds an html tree from the xml file.
This still experimental categories/tags tree structure is very bushy (about 1 000 tags and 100 nested categories, 6 levels), consider it as a draft. You can have a look here: http://antonin.roussel.free.fr/g/?path= … etiquettes

Notice jBrout is not storing all the branches (tag categories) leading from the root category to a leaf (tag), it only stores the leaves (tags) in the image file. So this is still partially tricky to make it store all the categories (branch path) leading to a tag (leaf).

Last edited by TOnin (2021-10-14 16:42:04)

Offline

 

#10 2021-10-14 16:18:55

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7261

Re: Import hierarchical keywords into the database


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#11 2021-10-14 16:41:08

TOnin
Member
1970-01-01
109

Re: Import hierarchical keywords into the database

Some may try to extend the 2 levels depth to 3 or 4.

Offline

 

#12 2021-10-14 20:34:02

MIDId
Member
2021-09-16
5

Re: Import hierarchical keywords into the database

Where does the search results page get its content from? There's a redirect() in search.php but I don't quite understand how it knows what information to display in the results page. Is that what variable $msg is in redirect_html()? I am asking because I wonder if there might be a way to modify how Piwigo returns results so that I could implement some sort of a hierarchical based search system using keywords by adding a few if statements when Piwigo performs the search. However, I also noticed that the $search variable gets serialized when it's written into the database, I also wonder where unserialize() does its thing in this whole chain.

Last edited by MIDId (2021-10-14 20:36:50)

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact