Skip to main content
. 2021 Jan 22;9(1):e26836. doi: 10.2196/26836

Table 2.

Hainan provincial digital contact tracing core algorithm based on a graph database.

Algorithm function Specific algorithm Algorithm description
Tracing the travel companions of confirmed, suspected, and asymptomatic infected individuals MATCH p=(n:Individual)-[r:'sameTransportation']-(n1)-[rr:'sameTransportation']-(n2)
where n.name<>n2.name
and upper(n.ID) in ['ID1','ID2','ID3','ID4','ID...']
RETURN distinct n.name,upper(n.ID),n.phoneNo,n1.name,upper(n1.ID),n1.phoneNo,n2.name,upper(n2.ID),n2.phoneNo;
“Individual” means the individuals included in the analysis; “sameTransportation” means taking one mode of transportation at the same time; “Name” means the name of the analyzed objects; “ID” is the ID number, where “ID/ID1/ID2/ID3/ID4/ID...” are the ID numbers of confirmed, suspected and asymptomatic infected individuals;”phoneNo” is the mobile phone number.
Tracing individuals who have had contact with >2 confirmed infected individuals MATCH p=(n:'Individual')-[r1]->()<-[r2]-(nm)-[r21]->()<-[r22]-(m:'Individual')
where n.is_confirmedindividual in ['yes','sameID']
and m.is_confirmedindividual in ['yes','sameID']
and EXISTS(nm.is_confirmedindividual)=false
and n.ID<>m.ID
return p;
“confirmedindividual” means a confirmed individual; “sameID” means the same ID number.
Tracing contacts through transportation modes with high risk of infection match p=(n:Transportation)-[*..4]-() where n.name='CarNo1' return p; “Transportation” means the transportation included in the analysis (private car, train, airplane); “CarNo1” is the license plate number of a certain private car.