How to count files using unique metadata/keywords?

Started by dnovak, January 08, 2019, 08:05:03 AM

Previous topic - Next topic

dnovak

Is there any way to get a list of all unique values of a metadata tag over all files, with the use count for each?

Something similar to what the Preview option shows for a data driven category.

I couldn't find anything suitable in the API.

I'm using this to generate a controlled vocabulary/thesaurus based on raw data, not knowing what the "correct" value is an advance.  This is roughly similar in concept to the alias/implication system in imageboards like Danbooru, but here I'm trying to identify the 'canonical' values based on use counts/patterns.

Thanks,

Dan Novak

Mario

#1
i'm not sure that I understand what you want to achieve.

Quote(...) unique values of a metadata tag over all files, with the use count for each?

You mean, for example, the distinct values of all title tags, with counts? Or maybe all unique keywords with a count for each keyword?
There is no such feature in IMatch. I would say that such statistical information is of very little use for most users. The Statistics panel and the Statistics app are among the least used features in IMatch, based on telemetry...

Data-driven categories do what you want. The group files based on distinct metadata tag values and then count them. The @Keyword category shows you all keywords used in your database and how often each keyword is used, for example.

The Statistics panel shows you the 50 most often used keywords. If you want to write an app yourself, the Statistics app would be a good place to start from.
It shows which IMWS endpoints can be used to group files by tag values. These endpoints return the distinct tag values and counts.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

dnovak

#2
Thanks, I'd forgotten about the statistics app. 

>>i'm not sure that I understand what you want to achieve.

It's probably a niche use case; playing around with and learning app development in IMatch has become one of my primary hobbies. :)

For example, I'd like to build an autosuggest text field for metadata values, showing the most frequently used values at the top.

I'd actually love an Export feature or copy/paste from in the Preview window (I don't know if it makes sense to copy a treeview to the clipboard); I frequently use that to test data driven category expressions/filters/settings and exporting the data will let me review against other data sources.

I got close to what I needed using NirSoft's SysExporter to dump text from the treeview in the data-driven category window.

dnovak

The statistics app was EXACTLY the starting point I needed.  Thank you very much!