Faceted browse: date interval questions

Hi :slight_smile:

I have Items with a property “date of recording”, entered as “Interval” (from/to) using the Omeka built-in interval date-picker UI widget.

What’s the right syntax to add a facet filter for decades, like “1930s”?
I’ve tried 1930/1939 1930s in the facet configuration text field - but then this option does not show up.

When I simply type 1930 1930s I get the option shown “1930s” - which somewhat matches, but not exactly.
Example:

  • matches: 1928-1934 (correct)
  • misses: 1939-1945 (why?)

When I check “show all available values”, I get this:

Available Count
1928/1934 1
1939/1945 2
1940/1945 1
1949/1958 1
1950/1959 1
1970-01-17/1970-01-18 1

I found this (from 2023):

Which says “not possible, unless using a custom facet” :cry:

Is this still so?
And why can I add a “Date in Interval” facet, if this is not an option?

Grateful for insights and suggestions :slight_smile:

Since faceted-browse is on top of “Advanced Search”, I’m wondering:

The option to search for “date in interval” (exists by default) offers no interval, but only a single date-selection.

How is this option intended to be used correctly? :thinking:

Thanks for the detailed report, and for finding the earlier thread. That answer still holds. What you want is an overlap filter, matching any interval that intersects the 1930s, and there’s an open issue for it: #8. I’ll link this thread there. Today it would need custom code.

First though, on your 1930/1939 line not appearing: the facet silently discards any line it can’t read. Worse, “Show all available values” and “Add all” fill that field with your stored intervals, which are precisely the lines it discards. That’s a bug on our side, and it leaves you with an empty facet.

What the facet accepts is one ISO 8601 date per line, like 1930 or 1935-06-15, and it treats that date as a single moment. Entering 1930 searches on 1 January 1930 at midnight and returns items whose interval was underway at that instant. That’s why 1928-1934 matches, since it was in progress then, and 1939-1945 doesn’t, since it hadn’t started yet.

That’s also why the Advanced Search field offers a single date rather than an interval picker. It’s for finding what was ongoing at a given moment, which is a narrower question than yours, and I can see why the label suggests otherwise.

It won’t work reliably for single years either. An item dated 1930-06/1930-08 misses the 1930 option because summer 1930 doesn’t include New Year’s Day, even though it sits entirely within the year. So no set of values will give you dependable decade buckets.

What does work today, without custom code, is to record the decades as plain text on a separate property, say dcterms:Coverage, and facet on that instead of on the dates. Give your 1928-1934 item two values, 1920s and 1930s, then put an ordinary Value facet on that property. Picking 1930s returns every item with that value, which is the bucket you’re after. The catch is entering them: each item needs a value for every decade it touches, two for both of your examples and more for anything longer-running. Repeated values on a property are fine in Omeka, so it works, but it’s data entry rather than a batch edit.

1 Like

Thank you for the detailed explanation, and thanks for clearing this up! :smile:

You’ve done an amazing job with Omeka S, btw!
I’m still wrapping my head around the internal mechanisms, so I can understand what it’s doing, so I can tweak and adjust it to our needs.