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

on Raids #33

Open
mckennatim opened this issue Mar 7, 2017 · 4 comments
Open

on Raids #33

mckennatim opened this issue Mar 7, 2017 · 4 comments

Comments

@mckennatim
Copy link

It seems we are missing one level of data abstraction between a report of a raid and something we call a raid.

A report is what reporters create when they notice what looks like a raid

A raid is what is created from a having a number of reports that are in agreement and are from credible sources.

  • one raid can have one or more reports associated with it and one ore more reporters who each have a credibility rating.
  • it would seem to be the job of the algorithm in code to aggregate reports from the same area, combine information from different reporters who have a good credibility rating and then upon a certain threshold declare it a raid

Can I suggest modification to the api?

@celsom3
Copy link
Member

celsom3 commented Mar 9, 2017

I haven't thought of it this way before. Please do. And thanks @mckennatim!

@celsom3
Copy link
Member

celsom3 commented Mar 9, 2017

@mckennatim Are you familiar with swagger? We are sort of modeling the data through this documentation tool. But it is in the API repo: https://github.com/Cosecha/redadalertas-api

@mckennatim
Copy link
Author

mckennatim commented Mar 9, 2017

@celsom3 here is a swagger-like definitions section.

If we did use similar registration/ authentication for subscribers and reporters the there would be one user record type that has a boolean field for subscriber and reporter. They would join by userId to reporterId and subscriberId and the subscriber and reporter records. I'd suggest that email be the username since it would apply to a users multiple devices (phone/laptop).

Subscribers would have an array of regions they subscribe to

Reporters would have a rating, an array of reports they have made, an array of recommenders and an array of people they recommend.

A report would have a raid info, a reporterId and a report rating maybe based upon reporter's rating and completeness or speciificity.

A raid would combine information from all the highly rated reports for a location. It would also be joined to those reports via an array of reportIds, and to the reports via an array of reporterIds. Its confidence rating would be the threshold upon which the raid becomes an alert and could merely be some combination of the report ratings.

definitions:
  User:
    type: object
    properties:
      userId:
        type: string
      email:
        type: string
      apikey:
        type: string
      subscriber:
        type: boolean
      reporter:
        type: boolean    
      timestamp:
        type: string

  Subscriber:
    type: object
    properties:
      subscriberId:
        type: string
      phoneNumber:
        type: integer
        format: int32
      regions:
        type: array
          items:
            type: object
            properties:
              lat: 
                type: integer
              lon:
                type: integer
              city:
                type: string
              zip:
                type string  
              radius:
                type: integer  

  Reporter:
    type: object
    properties:
      reporterId:
        type: string     
      reports: 
        type: array
        items:
          type: string (raidIds)
      recommendedBy:
        type: array
        items: 
          type: object
          properties:
            colleagueId:
              type: string
            colleagueRating:
              type: integer 
      recommends:
        type: array
        items: 
          type: object
          properties:
            colleagueId:
              type: string
            rating: 
              type: integer                                 
      rating:
        type: integer 

  Report:
    type: object
    properties:
      id:
        type: string
      reporterId:
        type: string
      verifiedBy:
        type: array
        items: 
          type: reporterId     
      timestamp:
        type: string
      rating:
        type: integer  
      location:
        type: object
        properties:
          lat: 
            type: integer
          lon:
            type: integer
          address:
            type: object
            properties:
              street: 
                type: string
              city: 
                type: string
              zip: 
                type: string
      numOfIceMen: 
        type: integer
      iceIds: 
        type: array
        items:
          type: string
      images: 
        type: array
        items:
          type: image  
      other:
        type: array
        items:
          type: string 

  Raid:
    type: object
    properties:
      id:
        type: string
      reportersIds: 
        type: array
        items:
          type: string
      reportIds:
        type: array
        items:
          type: string 
      timestamp:
        type: string
      confidence:
        type: integer  
      location:
        type: object
        properties:
          lat: 
            type: integer
          lon:
            type: integer
          address:
            type: object
            properties:
              street: 
                type: string
              city: 
                type: string
              zip: 
                type: string
      numOfIceMen: 
        type: integer
      iceIds: 
        type: array
        items:
          type: string
      images: 
        type: array
        items:
          type: image  
      other:
        type: array
        items:
          type: string    

@celsom3
Copy link
Member

celsom3 commented Mar 10, 2017

Yeah, this is great. Thanks. I think maybe we can use the terms 'endorses' and 'endorsedBy', like LinkedIn. :-)

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

No branches or pull requests

2 participants