oaregithub / oare_mono

1 stars 0 forks source link

Allow to search Person/Period in combination with Words In Texts #1683

Open edstratford opened 1 year ago

edstratford commented 1 year ago

Building out searching more... allow user to search for a particular person. The advantage is that one can search for person in connection with a word or number (or other person) via the search when this is added.

Auto complete? - will search first name in PN dictionary, followed by 'son', 'daughter', father of, mother of, etc. (can make this a drop-down that then converts to content to search in the 'relation' column, then autocomplete of the relation_name (which is also searched in the PN dictionary. This will then need to 'load' the persion.uuid for searching in the texts -- which it will need to find in the item_properties where the reference_uuid points to a uuid in one of the texts that the other hit is in...so it might be best to search for this one after the text list has been generated from other parameters, then generate a uuid list of all rows on those texts and then use that to filter the rows from item_properties table.

Same kind of option for period -- which will need to ask the user if they want to limmum/ month/ or hamuštum-week because the months will be very different than the limmum-years or ḫamuštum-weeks because these latter two are named according to people.

jbro-lab commented 1 year ago

Do you think you could give more explanation when it comes to the relation part?

edstratford commented 1 year ago

Each person ideally has a relation that defines them (this is because we don't have last names for them). So, Aššur-mālik is just a name that (more than 100 persons have) but Aššur-mālik son of (s.) Šu-Ḫubur is unique enough to be clear that such a reference in a text is a particular person.

The most common relations are "son of" (which shows up just as "s." when we display persons) and "father of" ("f."). But there are a few other possibilities, (daughter - d., etc.) - about a dozen.

SELECT DISTINCT relation from person;

This google sheet has all the relations with the text for the dropdown.

The relation_name, that comes after, i.e. the following name, is what comes after 'son of' and corresponds to the column by that name in the person table.

jbro-lab commented 1 year ago

Also, do you think you could explain more about this "which will need to ask the user if they want to limmum/ month/ or hamuštum-week because the months will be very different than the limmum-years or ḫamuštum-weeks because these latter two are named according to people". I'm sure there are overlaps in the names of years or weeks or months, so does it need to be searching for a specific month in a specific year (January 2023) or just a month (January)?

oaregithub commented 1 year ago

Good question!

Years and names are named after people. Months have consistent names, so if the user is looking for a particular point in time, then month has to be limited to year. There should be an option for date as point in time, or date as name. In the point in time version, the user would need to select year for a month, and also for week(hamuštum). In a date-as-name option the query returns all matches regardless of year.

jbro-lab commented 1 year ago

okay thank you, and how are years and months associated with the text? Are they connected in properties?

edstratford commented 1 year ago

So I imagine that you will query to find the period.uuid first, then associate it with the text.

Years, months and weeks are associated with individual texts through item_properties that have reference_uuid that are text_discourse.uuid and object_uuid is the period.uuid.

So, once you'd have the period.uuid - this query will get you the list of text_discourse.uuid matches:

SELECT uuid FROm text_discourse td INNER JOIN item_properties ip ON ip.reference_uuid = td.uuid AND ip.variable_uuid = 'cd76438c-3a82-11ed-b9d7-0282f921eac9' INNER JOIN period p ON ip.object_uuid = ;