Crisismap / crisismap-backend

API: RESTful data accessor
0 stars 0 forks source link

Define data entities #5

Open zverev opened 7 years ago

zverev commented 7 years ago

entities

According to our excel entity table, I don't understand the meaning of news entity. Is it a media data from sources? Why not always use incident to store an object, that describes some kind of event? By the way I totally don't like the word news. It isn't clear, how to call a single object. news is always plural.

Here are possible data types for client (flowtype):

type Location = {
  id: Number,
  geometry: GeoJSON,
  population: Number
}

type Toponym = {
  id: Number,
  name: String,
  locationId: Number
}

type IncidentType = 'fire'|'flood'|'earthquake'

// what we get from workers
type Media = {
  title: String,
  description: String,
  sourceUrl: String
  // something else
}

type Incident = {
  id: Number,
  locations: Array<Location>,
  type: IncidentType,
  registeredAt: Date,
  media: Media
}

Can Incident have multiple types?

Godnik commented 7 years ago

I agree about news unconvincing definition - it's better to define this type of data as media, minding that the social media sources can be also represented as data suppliers. The incident is produced as a derivative layer on the top of this data. So I'd propose smth like this with an eye to the future:

type Incident = {
  id: Number,
  locations: Array<Location>,
  type: IncidentType,
  registeredAt: DateTime,
  media: Media,
  weatherAlerts: weatherAlerts,
  fireAlerts: fireAlerts,
  eqAlerts: eqAlerts,
  ecoAlerts: ecoAlerts,
  significant: Number,
  populationSum: Number,
  status: String
}
bkmy43 commented 7 years ago

Guys I agree, that news is not perfect term, because it has no singular form. But proposed media is in my humble opinion very misleading.

According to our definition news are items, which we get from our sources, they are messages with particular information which we get from different media. And "media" itself is just a channel like "newpaper x" or "website y", not the information we get.

So I would love to use any other term for news if we find something which is clear and has both singular and plural forms