Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe how to link people to posts without implying membership in organizations #125

Open
jpmckinney opened this issue Jan 27, 2017 · 19 comments

Comments

@jpmckinney
Copy link
Member

jpmckinney commented Jan 27, 2017

The original W3C ORG standard didn’t have a post_id on Membership, but it also didn’t have a means of having start/end dates for holding a Post. With mySociety and Sunlight, we decided to add post_id to Membership, which has the side effect of a Person having multiple Memberships if they hold multiple Posts, which isn’t reality, but was considered acceptable.

One way to have a single membership but multiple posts is to make post_id an array, but that complicates the very common case of a Person only holding 0 or 1 Posts per Membership.

Another way is to create a new Appointment class, to hold the dates during which additional posts are held.

Example: Morgan is a member of House for District 1 from 2010 to 2014, and is also appointed Speaker from 2012 to 2013:

{
  "type": "Membership",
  "person_id": "morgan",
  "organization_id": "house",
  "post_id": "district_1",
  "start_date": "2010",
  "end_date": "2014"
}
{
  "type": "Appointment",
  "person_id": "morgan",
  "post_id": "house_speaker",
  "start_date": "2012",
  "end_date": "2013"
}
@jpmckinney
Copy link
Member Author

/cc @fgregg

@fgregg
Copy link

fgregg commented Jan 27, 2017

I really like this idea, but we need a really clear distinction between a membership and an appointment.

Particularly since many people are members of a body because they are "appointed" by someone else, people might get confused about what we are really talking about here.

It seems like a key thing that we are trying to get at is that there are posts or roles that do not confer membership in a body. Is that right?

If so, could that just be an attribute of a post?

@jpmckinney
Copy link
Member Author

So, an attribute of the Post would indicate whether being appointed to that post confers membership?

I suppose we could then run validations to ensure there is no Membership is associated to that Post.

And alternately, run validations to ensure that no Appointment is used if a Post confers membership;

@fgregg
Copy link

fgregg commented Jan 27, 2017

My current use cases would be satisfied, if posts had this confers_membership attribute. I wouldn't need the appointment class, because I can easily get a full list of all current posts.

@jpmckinney
Copy link
Member Author

If there's no Appointment class, then you're okay using Memberships to make the link between People and Posts (with some Posts conferring membership and some not)?

@fgregg
Copy link

fgregg commented Feb 3, 2017 via email

@patcon
Copy link

patcon commented Feb 5, 2017

If I'm understanding correction, putting confers_membership on Post and adding validation seems it could be simplified.

Could Membership and Appointment be generalized to another object (like Association), and then have an association_type that's either "appointment" or "membership" (or some other future type)? Then there's not need for validation logic to ensure consistency, and filtering on "membership" allows a clear "get roles for board posts that are memberships" (rather than "get roles for board members").

(I may be missing some underlying requirement, so please feel free to disregard if so!)

@jpmckinney
Copy link
Member Author

In terms of modeling, that's the same as having an Appointment class, except we're using a type property to distinguish between classes instead of using the class name.

@patcon
Copy link

patcon commented Feb 5, 2017

I think I'm operating under the assumption that more classes are less desirable as increased complexity, but perhaps not true. Memberships were always a "linkage" sort of class in my mind. As proposed, introduceing the idea of now having n types of linkages makes the spec a little harder to grok imho

@jpmckinney
Copy link
Member Author

jpmckinney commented Feb 5, 2017

Hmm, I'm remembering a pattern from the UK's electoral candidates project. For candidacy (#104 #43), they had people hold memberships that were linked to posts but not to organizations. You could still get the organization in which the post exists through the post, but by leaving the organization blank on the membership, normal system logic wouldn't count that person as a member of that organization.

@fgregg What if Pupa allowed creating memberships without setting the organization?

@patcon Not setting organization would effectively be the same as having a type flag.

@jpmckinney jpmckinney changed the title Consider an Appointment class Describe how to link people to posts without implying membership in organizations Feb 5, 2017
@fgregg
Copy link

fgregg commented Feb 7, 2017

@jpmckinney, for the UK project, I understand the steps that led to having memberships that were not linked to organizations. I think that this was a reasonable technical solution, but it violates my understanding of what a membership means. For me, a membership means that you are part of a body, so not having a body doesn't make sense.

@jpmckinney
Copy link
Member Author

jpmckinney commented Feb 7, 2017 via email

@fgregg
Copy link

fgregg commented Feb 7, 2017

My proposal is that a a post with a confers_membership=False would not have a related Membership

@fgregg
Copy link

fgregg commented Feb 7, 2017

actually, if it is valid for posts to not have related memberships, then I think we would be good. pupa and other downstream tools would need to handle a confers_membership logic, but the Post class need not.

@jpmckinney
Copy link
Member Author

How do you relate a person to a post if not through a membership?

@fgregg
Copy link

fgregg commented Feb 7, 2017

ah, I see. Now I think I finally fully understand the distinction you were trying to make between Appointment and Membership

Would be it be accurate that you see an appointment as a relation between a person and a post, and a membership as a relation between a person and a body?

@jpmckinney
Copy link
Member Author

Membership is currently a relation between a Person, Post and Organization. Post is optional. See diagram: http://www.popoloproject.com/specs/membership.html

An Appointment would likely just be between a Person and a Post.

Posts are always related to Organizations. There are no free-floating Posts.

@fgregg
Copy link

fgregg commented Nov 7, 2019

Reading through this thread again, I think your Appointment class idea is very good.

I think we need a different name than Appointment, though, as it improperly draws attention to the means by which a person comes to hold an office.

some ideas for names, none of which I really love:

  • OfficeHolding
  • PostHolding
  • PostTerm
  • Term (I think I like this one the best)

I also think it might have nice to an optional attribute on the Appointment class that can refer to the membership that is a necessary condition for an appointment.

@jpmckinney
Copy link
Member Author

Term sounds good, though (in isolation) it could be confused with the term of the legislature (see #93 where the modelling of legislative periods are discussed)… But if we aren't using Term anywhere else, I think it's fine to use for this purpose, as I can't think of anything better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants