Graph Structure and Server-API




GRAPH STRUCTURE



The graph attributes consist of nodes and edges.


Graph Nodes


Each node in the graph has the following attributes:

1- Node identifier: The name follows this pattern: "[country]/[state]/[city]/[community]", e.g., "US", "US/New Jersey", or "US/New Jersey/Middlesex". No information for the community level yet.
2- Node position info: The latitude and longitude of the node (if missing, the values would be None). Cartesian coordinates (x, y, z) based on GRS80/WGS84 model.
3- Disease information, sorted by day: Number of infectious, recovered, dead, susceptible, and population. Disease spread parameters, such as , γ, and d.
4- Other attributes, including ferry ports and train stations, etc.
5- A list of containing nodes of the next level: For instance, the nodes contained in "US" are ["US/New Jersey", "US/New York", ...].
6- There is one special node called metadata in the graph to store some graph attributes. This node is not connected to any other node. The attributes of this node are: Maximunm date in JHU's reports and Minimum date in JHU's reports.

Graph Edges


Each edge in the graph has the following attributes:

1- The edge identifier by joining source node and destination node with "->", e.g., "US->GB";
2- The calculated weight between the nodes as a floating point number;
3- For now, no duplicated edges are allowed between the same pair of nodes;
4- The edges are always between nodes of the same scale, e.g., "US->GB", "US/New Jerse->GB/Anguilla", or "US/New Jersey/Edison->US/New Jersey/Piscataway".


Simulation



Simulation is a feature to predict future COVID-19 outbreaks. The current model using is the Susceptible-Infectious-Recovered-Dead model. JHU doesn’t provide recovered and susceptible information.

Simulation Mechanism


A simulation session is invoked on-demand. If the to_date value in the query is greater than the max_date value of the metadata node, data between these two days are generated by simualtion. For a given node n in the graph, the simulation will only be applied to its sibling nodes and nodes connected the same scale. For example, if n="US/New York", it’s siblings are "US/New Jersey", "US/California" and all the states in the USA, plus a few more nodes connected overseas like "CA/Toronto". For each node shown above, the simulation is executed with the simulation-tranportation order. For example:

1- Starting from the first date after max_date, the SIRS model is applied to each node
2- Also, a simulation step is applied to all country-level nodes
3- Then population transportation is applied to each node according to the edges
4- Also, a transportation step is applied to all country-level nodes


SERVER API



Currently the server accepts the following GET calls. The server is hosted on https://128.6.23.29:1919/. Note that if no data is being returned by the server, that is because the server machine in the academic facility is turned off. We are working on hosting the server on a third-party (e.g., cloud) platform to keep it running for public use.

  • Initilization: ?mode=init
  • Getting uncropped view near some node: ?mode=get&node=US
  • Specifying end date for simulation: ?mode=get&node=US/New Jersey&to_date=04-15-2020
  • Specifying nodes and edges to be disabled in the graph and then observe the updated nodes (e.g., implications after enforcing policies): ?mode=set&attr={"disable_nodes":["US/New York|04-15-2020","CA/Ontario|04-20-2020"],"disable_edges":["US/New York->CA/British Columbia|04-22-2020"]}&node=US&to_date=05-10-2020


For the last query, there are a few things to note. The attr parameter is a json dictionary containing 2 key-value pairs: disable_nodes and disable_edges, and the value for each pair is an array of nodes/edges respectively joined by the target date that needs to be disabled. The nodes and edges to be disabled can be any node or edge in the graph (but it’s more reasonable to include nodes and edges that are related). Here is a print-friendly version of this query:

?mode=set
&attr={
  "disable_nodes":[
    "US/New York|04-15-2020",
    "CA/Ontario|04-20-2020"
  ],
  "disable_edges":[
    "US/New York->CA/British Columbia|04-22-2020" 
  ]
}
&node=US
&to_date=05-10-2020


The server will return a text file on a success query. An example of the result is shown below.

id,s,i,r,d,population,long,lat,date
US,0,308850,14652,8407,0,-82.46170658,34.22333378,04-04-2020
US,0,275586,9707,7087,0,-82.46170658,34.22333378,04-03-2020
US,0,33746,0,427,0,-82.46170658,34.22333378,03-22-2020
----- (This string is the separator)
id,weight
US->GB,1237.0
GB->US,836.0