A No-Code Method of Mapping UFO Sightings with TigerGraph’s Geospatial Layout Feature
Using TigerGraph’s Geospatial Layout Feature with a Custom Dataset
Introduction
Overview
In the previous blog, we leveraged TigerGraph’s COVID-19 Starter Kit to map TravelEvents with the geospatial layout feature. Let’s now see how to use the geospatial layout feature for a custom dataset. In this case, we will be used Kaggle’s UFO sighting dataset. Let’s jump into it!
Itinerary
- Introduction
- Set Up a TigerGraph 3.2 Solution
- Create the Schema
- Prepare and Load the Data
- Map the Sightings
- Next Steps
Tools and Resources
- TigerGraph Cloud
- Kaggle (specifically the UFO dataset)
Step I: Set Up a TigerGraph 3.2 Solution
First, we’ll spin up a free TigerGraph 3.2 Cloud solution. To do so, navigate to https://tgcloud.io/ and log in or register.
On the left-hand sidebar, select “My Solutions” then press the blue “Create Solution” button.
On the first page, ensure your version is 3.2 and select the Blank starter kit. Press Next.
Don’t change anything on the second page. This is, in essence, just creating a free solution for you.
On the third page, update the information for your specific solution.
Finally, on the fourth step, verify that everything looks good then press “Submit.”
Wait till your status turns green then launch GraphStudio by pressing the four squares and selecting “GraphStudio” from the dropdown.
Perfect! You’re now ready to create your schema.
Step II: Create the Schema
Let’s first create the schema based on the data. To do so, click “Global View” then create a new graph (which I called UFO).
To start designing the schema, press the “Design Schema” tab.
To add (local) vertices, press the plus button on the top and edit the attributes appropriately.
To add edges, click on the arrow and then click the two vertices you wish to connect.
As for the schema design, while we could make it far more complicated, I opted to break apart the country, state, and city into vertices (with their values as the primary id and the attribute) and add the rest of the data into a Sighting vertex with a primary id of the DateTime.
Once the schema is created, press the up arrow to publish the schema, and you’re ready to progress to the next step!
Step III: Prepare and Load the Data
Next, I downloaded the complete.csv file from Kaggle UFO Sighting Dataset and uploaded it into GraphStudio. To do so, navigate to the “Map Data to Graph” tab and click the “Add data file” option.
Press the plus, upload the CSV, then add it.
I then mapped the CSV to the appropriate vertices and edges. You can do so by clicking the CSV, pressing the crossing arrows with the hover data of “Map data file to vertex or edge,” and then mapping the data appropriately.
Finally, I loaded the data into the graph by navigating to “Load Data” and pressing the play button.
Afterward, in graph statistics, you should see all of the vertices and edges now in the graph.
Perfect! Now we can map the data.
Step IV: Map the Sightings
Finally, using the “Explore Graph” tab, I mapped the data. I first selected 100 Sightings.
Next, I clicked force and chose the geospatial map option. And, with that, the vertices were in place!
From this, I can tell that the majority of the UFO sightings, at least from this sample, is from the USA. I explored more of the data and zoomed in on the USA to learn more about those sightings in particular.
From here, I can finetune my data explorations and more, all in GraphStudio without writing a single line of code.
Step V: Next Steps
Perfect! Now that you used the geospatial mapping feature on this custom graph, you can now easily use it in your own projects. If you have any questions or run into any errors, feel free to post them in the community forum.
Additionally, you can chat with more TigerGraph developers on the community Discord.
Good luck with using the maps in your projects, and I can’t wait to see what awesome projects you create!
Data Source
The data used was from Kaggle here, and the license is not specified. This dataset was scraped, geolocated, and time standardized from NUFORC data by Sigmond Axel here.