Advanced query

Started by rienvanham, November 15, 2023, 11:21:22 AM

Previous topic - Next topic

rienvanham

Hi Mario,

Perhaps I'm looking over something but I can't find the right answer:

I would like to check the quality of the keywords by (e.g.)  the next query:

Show me all the photo's where person = XXXX AND XXXX is NOT present in keywords

or the other way round:

Show me all the photo's where XXXX is NOT present in keywords AND person = XXXX

I tried it with the filter panel but did not succeed so far.

Thanks in advance!

Greetings,
Rien.

Mario

Maybe

1. Select the Person in the People View

2. Select the keyword(s) in question in the Category Filter in the Filter Panel
This shows all images with the person and the keywords.

3. Invert the Filter Panel
Now you see images of the person without the selected keyword(s).
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rienvanham

I new it couldn't be difficult....

Thanks again Mario!

Mario

Quote from: rienvanham on November 15, 2023, 12:09:29 PMI new it couldn't be difficult....
As long as you have IMatch ;)
Not sure if something like this would be as easy in other DAM software.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rienvanham

#4
Haha, funny typo: new has to be knew...

On the other hand: what about a kind of SQL-query-possibility? You could do some very advanced queries with a lot of "OR"-'s and "AND"'s.

I have also a license for Photo Mechanic Plus. They have a kind of SQL-possibility, e.g.:
keyw "Rien van Ham" Pershown NOT "Rien van Ham"
(in keywords the name is present but not in persons).

Thanks in advance,

Rien.



Mario

You can do a lot of Boolean queries in IMatch via the search bar in the File Window and Metadata Search.
See The Search Engine
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rienvanham

Yes, off course...

I proved again that I was too lazy to RTFM.... ;-)

I think that answers my question.

Thanks again Mario!

Mario

Also: IMatch uses an object-relational database system with a SQL-based database as the storage layer. Many things are stored as binary blobs, not accessible via SQL at all.

Plus: I reserve the right to swap the database system used as the storage layer when I see a benefit. And that might not be an SQL database, but very likely a Post-SQL database system or a mix.

If you have such particular requirements that you want to use SQL, I recommend you use the IMatch API instead, which gives you access to metadata, attributes, files, folders, categories, collections from JavaScript or any programming language that supports REST (Python, PowerShell, C, C++, C#, PHP, curl, ...).

You can then build the most fancy search features without relying on running SQL statements.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rienvanham

#8
Hi Mario,

I'm not that experienced that I know how to work with API's so I have to do it with the desktop-version of iMatch.

I was just trying to see how easy/fast it is to retrieve photo's from the database.

Just an example:

Let's suppose I want to retrieve the following photo's/files:

- Files made in december (every year);
- Made between 16:00 and 18:00;
- "sunset" and "snow" in the keywords;
- Camera = Nikon D3400;
- ISO = 100
- Person on photo's = "Jack Idontknow"
- Country = Austria;
- State = Salzburg

(all just fake-values)

I know it sounds almost crazy (so much values in a query) but just so get an idea how to do it with iMatch. It would also be nice if queries could be saved (and edited) for later purposes.

It has to be "monkey-proof" so no changes in the database are allowed and userfriendly.

Thanks in advance!
Rien


Mario

This is all doable with the Filter Panel.
Date Filter.

Category filter for camera, iso, country and state (all available under the IMatch Standard Categories > Images hierarchy).
No need for searching, just click the categories you need.

Person filter to filter for persons.

Category filter for the Keywords.
Or use a metadata search or the file window search bar, whatever works best for you.

The Filter Panel applies your settings to the current scope, whatever is visible in the File Window.

Quoteit would also be nice if queries could be saved (and edited) for later purposes.

This is why the Filter Panel allows you to store any number of filters and to recall them later in the Filter Panel or the QuickFilter ribbon. You can also load stored filers back into the Filter Panel to edit them.

You can combine any number of stored filters. And combine that with the interactive filter.
Like, activating a stored filter for a specific county and then combine that with some keywords you enter.

If this is new to you, see The Filter Manager and, more general, Filtering and Searching


-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rienvanham

#10
Thanks Mario,

I overlooked the button with the green arrow in Filter. I thought it was a button to load a query from a textfile.

I will try to make this query step by step with valid values.

Have a nice evening and greetings from the Netherlands,

Rien.

=============
I tried it and it is much easier then I thought!

I could check most values in "Categories".

For the date time I made a regex in "Metadata Search":
\d{4}:12:\d{2} 1[67]:\d{2}:\d{2} (month = 12, hour = 16/17; rest not important)
(Date Subject Created).

Thanks again!

ubacher

QuoteThis is all doable with the Filter Panel.
Not quite: We can filter by date but not by hour. Right?
I missed this functionality before when I tried to distinguish sun-sets from sun-rises.

(Allowing to sort by time only would at least allow a simple manual selection.)

Mario

#12
You can sort by date and time of course.
I doubt many users will ever have a need for filtering by time. Feel free to add a feature request so we can see if this would be interesting for users.

If you want to tell sunset from sunrise, why not make a data-driven category based on the hour (based on a suitable timestamp tag, using part of value)? This gives you 12 or 24 categories you can use directly or in the category filter.

Image1.jpgImage2.jpg


If you want to have larger groups, you can use replace to e.g. replace 22,23,00,01,02,03,04,05 with "Night", 06...11 with Morning or whatever.

You could also base a data-driven category on a variable that groups files based on their hour value into categories like sunrise, morning, noon, afternoon, evening, sundown, night or whatever you need...
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rienvanham

Hi Mario,

Thanks!

Hi Ubacher,

"My" regex also filters bij hours (1[67] means: 16 or 17). 

\d{4}:12:\d{2} 1[67]:\d{2}:\d{2}

which means:
4 digits (year) : 12 (month) : 2 digits (day) space 16/17  (hours) :  2 digits (minutes) :  2 digits (seconds)

2022:12:01 16:00:00 (example)

ubacher

QuoteYou can sort by date and time of course
But for this case you would need to filter by time alone.

Rienvanham's search with a reg-ex will do the job just fine.
As Mario said one does not need this functionality often - so this rege-ex search will do.