Category Export imcsx file is empty

Started by henryS, June 06, 2021, 06:04:00 AM

Previous topic - Next topic

henryS

I don't understand what I am doing incorrectly: I highlight @keywords category and drag it onto the Category Export module. A window appears as in Help  with checked boxes for include child categories and include file assignments. A file name is provided. After pressing OK and program runs, the message is that 1 category was exported and 0 file assignments. The generated categories.imcsx file has no categories listed (see below). I tried expanding the categories, selecting all the expanded categories, and dragging the selection onto the module but while the message was that there were more categories, there were still 0 files assigned and the categories.imcsx file was still empty. What am I missing please? With thanks, henry
<?xml version="1.0" encoding="UTF-8" ?>
<category_schema xmlns:ptrm='http://schemas.photools.com/category_schema.xsd' vendor='photools.com' version='1.0'>
   <categories>
   </categories>

   <folders>
   </folders>

   <files>
   </files>
</category_schema>

Mario

@Keywords is a data-driven category. It is dynamically created from the actual keywords in your files.
IMatch does not export this category, it always exists in all databases.
Exporting @Keywords contents would do nothing, because it would be rebuilt anyway from the database contents after you've imported it into another database.

What are you trying to achieve?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

henryS

I am trying to export the tree of keywords in @keywords and the links to the associated files. What ultimately I want is to show how many files of a particular @keyword category there are and what are those files.   Is there a way to do this?  I am not doing this in the context of photography but as a way to annotate a dataset of data files.  Thank you very much for your response!

Mario

#3
IMatch does not contain a feature which exports statistical data about the files contained in a dynamically generated category (like @Keywords).
Or the list of files (in some form) or one or more categories.
This is only rarely needed.

Do you have some programming experience? In that case you can use any language (C, C#, PowerShell, Python, Visual Basic) to query information about the categories contained in your database and the files these contain.
Or just write a small IMatch app which retrieves the category list, the list of files in each category and then exports them in a format you can process.

For example, using the v1/categories endpoint, you can fetch a list of all @Keywords categories and the number of files they contain.
Copy and paste this into the address bar of your web browser:

http://127.0.0.1:50519/v1/categories?contains=%40Keywords&recursive=true&fields=path%2Cfilescount&auth_token=

(Assuming IMWS in IMatch runs on port 50519 on your machine, which is the default).

The result is a JSON-formatted data stream with one object per category. The full category path and the number of files in that category. You can save the result and process it as needed.

See The IMatch Developer Center for more information about the programming interfaces provided by IMatch.

How often do you need this?
How many categories do you have?

Tip: You can also just select all files in a category and press Ctrl+C.
This copies the fully qualified file names into the Windows Clipboard and you can then paste this data into Notepad or Excel.
If you need this only once, this can be faster than first writing an app.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

henryS

Thank you very much, Mario, for the explanation and for the one line code, which gave what I asked for! The pointer to the iMatch Developer Center is also very useful in allowing to accomplish my immediate task, which is to describe the attributes of my dataset being deposited in a public repository. As to the number of categories, it is close to 86000. I will need an interface to search and retrieve files from that repository, but that will be a next stage. With many thanks and best wishes, henry