masciugo / genealogy

Make ActiveRecord model act as a pedigree
MIT License
30 stars 17 forks source link

Spouse without children #15

Open stewartmckee opened 9 years ago

stewartmckee commented 9 years ago

Hi,

Great gem, no problems so far with it, but seem to have now hit a limitation which is setting up a spouse, or multiple without children. Had a look at the master code and doesnt look like this is supported, do you have any thoughts on this?

I was thinking about a join table, which could keep some additional metadata with it, like status of relationship, eg divorced, and others like wedding date, or anything else that makes sense.

In my app, i'll either just implement a hidden child, or a join table, but if you've got any idea of direction yourself, i could help out.

thanks, Stewart.

masciugo commented 9 years ago

Hi Stewart

first of all thanks for your interest and sorry for my late reply

The fact that this feature was not taken in consideration is due to the genetical origin of this project: there was no interest in couple without children. Having said that, I like to explore the possibility to add it even if it is not strictly about genealogy. For this reason I would keep it secondary and light. Actually this is what I tried to do with the current spouse which is a very minimal implementation of your idea (among other things it will need to be removed because implicitly included by this new feature)

Anyway, I think that it's not easy mostly because of the coherence that we need to keep with the other data. I'm going to put down some critical questions which I ask to myself too.

As a start: what's a couple? So far it has been a male and a female who are parents of the same child (let's call it offspring-couple). From your idea I guess a couple is built by declaration, a row in that join table (let's call it declared-couple) Do we have to deal with two kind of couple? If not, what if a child will be added to some parents? Would they become a declared-couple (new row in the join table)? If so, what if I later remove that child? Do their ex-parents' remain a declared-couple?

Keep all synchronised and meaningful is hard or at least ambitious.

The alternative is to keep them as two separated concepts but maybe it becomes someway redundant and hard to understand.

What do you think?

stewartmckee commented 8 years ago

Yes, agreed. It does get messy very quickly! :) I had actually been discussing the same thing last night with regard to what is a family tree, is it genetics based or is it relationship based, and both have merit. In my case it is relationship based, and so that quickly breaks form the genetical model, eg adoption, same sex parents etc. What I'm going to do in my case is probably start afresh from a relationship model, I don't think it would be the best solution to try to force in that to this model, because its nice and clean just now, and from a genetic standpoint, doesn't make sense to add non genetical relationships.

I'm going to start another gem for my project as the mother, father model that is used here doesn't work for my model without doing some really bad stuff (eg hidden children or big changes to the data model). I'll post a link here once its up and if there is anything you can take from it feel free.

Thanks.

rhannequin commented 8 years ago

Hi,

I would like to know if @stewartmckee created his gem for a non-genetic based genealogy project. I was interested in the genealogy subject from a development point a view, and your gem @masciugo is very interesting, thank you for this work. I'm looking forward for what we can create with it. If I can help, don't hesitate. Thanks.

jasonfb commented 8 years ago

I've been thinking about this subject recently (and followed my research to this Issue). I feel like the ultimate family tree software could allow the user to choose how to interpret genetic and non-genetic relations. Same sex couples, adopted children, children out of wedlock, for example, all do not fit into this genetic-only data model, especially when those individuals are trying to research the roots of the people who raised them, regardless of their genetic ties to those people.

Obviously there are issues of sociology and history at play here, but speaking as a software developer, it seems to me that the software itself should bend to our changing world and not ask us to conform our ideas to its strict model. Having said that, I do acknowledge there is value in looking at one's genetic family tree exclusively (for example, when one is researching for medical history reasons).

SO it seems to me that the software should offer the choice of how to perceive and/or indicators of non-biological relations.

I would propose mother_id and father_id be renamed biological_mother_id and biological_father_id. In addition, a join table would need to keep track of non-biological dependents, allowing for 2 or mothers, 2 or more fathers, or non-biological caretakers (as is the case with a step parent or adoptive parent). Yes, I know this pretty much explodes the existing concept but it seems like the direction to go in.

stewartmckee commented 8 years ago

I switched to a graph database (neo4j) in order to model the data. You can associate metadata with each relationship so are able to define as many relationships as you need. Also navigating around a family tree (eg give me all cousins) is a simple query to make. I have some performance issues I haven't ironed out yet, but think its just my lack of understanding. I think this gem is great for its purpose which is a genetic model, but for the multitude of family situations to represent a graph database is much easier to model your data in.