buda-base / public-digital-library

http://library.bdrc.io
4 stars 6 forks source link

search by date #407

Closed eroux closed 3 years ago

eroux commented 3 years ago

When the user types 3 or 4 digits (and only that) in the search box, a new option "date" should be available. It uses the same system as other types of queries, there's a type count, and the per-entity requests for instance works associated with 1747

eroux commented 3 years ago

(note that when there are 3 digits, a 0 should be added on the left of the query (years always have 4 digits in xml for some reason)

berger-n commented 3 years ago

seems to be workign fine! http://library-dev.bdrc.io/search?date=%221747%22&t=Person&pg=1&f=relation,inc,bdo:PersonBirth (had to use ldspdi not ldspdi-dev to make it work here though)

image


image

eroux commented 3 years ago

Very cool, thanks a lot!! There's an issue where the BDRC and TOL records of the same person are presented as different, but it's probably in the data or SPARQL query, I'll take a look tomorrow

eroux commented 3 years ago

well, here the results from the query look correct actually... @berger-n any idea why they are not merged? The merging seems to work just fine for the search on name for instance

eroux commented 3 years ago

also, let's slightly refine the search bar:

berger-n commented 3 years ago

everything's fine now: http://library-dev.bdrc.io/search?date=%221747%22&t=Person&pg=1&f=relation,inc,bdo:PersonBirth putting date (if <2100) first

image

eroux commented 3 years ago

Wonderful, thanks a lot! Let's put that in prod

berger-n commented 3 years ago

done https://library.bdrc.io/search?date=%221892%22&t=Person https://library.bdrc.io/search?id=%22NGMPP%20E%2F797%2F2%22&t=Instance&s=title

berger-n commented 3 years ago

having a closer looker at http://purl.bdrc.io/lib/datePersons?GY_RES=1892&format=json some events data seem to be missing (like https://purl.bdrc.io/resource/EVFE776E25CE86AF85.ttl regarding death for https://library.bdrc.io/show/bdr:P258) resulting in birth/death date not displayed on https://library.bdrc.io/search?date=%221892%22&t=Person&pg=1&f=relation,inc,bdo:PersonDeath

eroux commented 3 years ago

Great, thanks a lot! I'll look at the data and query, I noticed that in the general query about persons too

eroux commented 3 years ago

so, the story is that some events don't reach the results because of the limit of 500 triples we put in the SPARQL query results. I've changed the query a bit so that it sends less useless triples. The dates for this query are back so that's good, but I suspect that for some queries with a bigger number of results we will still encounter the same issue. I think we allow some queries to have a much bigger amount of results, I'm wondering if we pass these queries the ?I_LIM=xxx argument in the JavaScript code?

berger-n commented 3 years ago

I've added I_LIM=700 to data/id queries

berger-n commented 3 years ago

one minor bug to fix here:

berger-n commented 3 years ago

fixed: https://library.bdrc.io/

Kazam_screencast_00012 mp4


Kazam_screencast_00013 mp4

eroux commented 3 years ago

great, thanks!