opencivicdata / python-opencivicdata

python utilities for Open Civic Data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why require a Jurisdiction for each Event?

gordonje opened this issue · comments

The Event Django model currently has a jurisdiction foreign key field with a not null constraint. However, this field is not mentioned in the OCD Event format or in the Event OCDEP.

Assuming the typical use case is to model meetings of various public agencies (e.g., a state legislative committee or city council), couldn't that be handled via an Organization as an event participant?

I think the main reason is for scoping Events & deduplication. At present, I believe everyone using these models have a single DB that is multi-jurisdiction- as such there needs to be an easy way to separate Jurisdiction's organizations/events/etc.

https://github.com/opencivicdata/pupa/blob/master/pupa/importers/events.py#L40 is an example of where this is done, we consider the unique set of attributes for an Event to be {name,description,start,end,timezone,jurisdiction}

& because participants aren't stored on the Event object we can't easily use them like this

(for a single-jurisdiction instance Jurisdiction is likely to be an implementation detail that can be essentially ignored)

How about having an Event class without this attribute, and then having a LegislativeEvent subclass with this attribute that pupa would use?

I don't think I understand your question. The LegislativeEvent would be the exact same thing as the current Event. The new Event would be compliant with the OCD spec and ready to be used for non pupa purposes where jurisdiction is not an appropriate scope.

Hmm.. interesting. Political campaigns organizations don't really have jurisdictions and we are going to want to model those. I can't think of a governmental organization that doesn't have a jurisdiction.

I think we will need to have a conversation of jurisdiction-less organizations, but that should probably happen on https://github.com/opencivicdata/docs.opencivicdata.org/, since the current OCD spec does require jurisdictions.

In any case, as you have said, the case for Events is different. We are not saying that Events truly have or are associated with jurisdictions, but we have used jurisdictions as convenient scoping mechanism.

FWIW, I feel like Event missing Jurisdiction on docs.opencivicdata.org was an accident, not an intentional choice. If you had an Event that wasn't tied to a Jurisdiction how would you deduplicate it?

Well, the spec is the spec. We should go through OCDEP process either way.

Right now pupa uses name, description, start_time, end_time, timezone, and jurisdiction_id. I think if you added location and removed jurisdiction, you would have something just as deduplicable.

If that's not sufficient, we can create a subclass with an appropriate scoping value.

Also, for pupa, you can continue to use jurisdiction_id. You'll just use a subclass of an Event

Conversation has moved here.