Student with a fascination of CS and AI, especially in the health tech. Connect with me: https://www.linkedin.com/in/shreya-chaudhary-

Creating a Chat Bot to Answer TigerGraph Questions with Discord.py and pyTigerGraph

What is the Project and Why Complete it?

A potentially hot topic is creating chat bots with graph technology. While this is by no means an advanced chat bot, it’s a way to combine the power of TigerGraph and Discord to create a responsive bot for a Discord server.

Step 1: Create the Bot on Discord

First, you need to create the bot itself on Discord. For this project, we’ll be using Discord.py. To create bots, you’ll need a Discord account and to enable Developer Mode. You should then be able to access the applications page: https://discord.com/developers/applications

From here, on the top right corner, click “New Application.”

Image for post
Click on the blue “New Application” button.

Next, name your application at the prompt.


A Holiday Special and Introduction to a-frame

Objective

We are in the midst of the holidays and yet we are forced in our houses due to the pandemic. However, this year, I decided to start a new tradition: I created a VR card. While it’s far from being a place for interaction, like the Oasis or your choice of science-fiction universe, it’s been a nice way to create something small to share with my friends and family.

In this lesson, I’ll introduce the basics of a-frame to create a simple, in-browser holiday “winter wonderland” card using only primitive types (and text). …


Image for post
Image from Pixabay

Introduction to Beautiful Soup and Web Scraping

Objective

This blog will serve as an introduction to web scraping using Beautiful Soup. We will extract textual data from Wikipedia, and create a mini “Google” in which a user can ask for something and the result will be a paragraph-long description about the item searched.

Note that this is by no means a final product; rather, it’s an introduction to basic webscraping. Let’s begin!

Step 1: Import Libraries

First, we’ll need to import our libraries. The two libraries we’ll be using are BeautifulSoup4 to parse the HTML and requests to extract text from a website (which is, in our case, Wikipedia).

from bs4 import BeautifulSoup
import…


Image for post
Photo from Unsplash by Janis Fasel

How to Run a Linear Regression using Pokémon Data from a Graph in TigerGraph

(Note: This is a bonus blog based on a series. To obtain the data used, refer to the past blogs.)

Hello! Today, we’re going to learn how to run a linear regression using TigerGraph. In this example, we’ll be running a linear regression with the Pokémon’s height and weight. Let’s get to it!

Part I: Setup

To start, we’re going to need to import the necessary libraries and create a connection to our graph.

The libraries we’ll be using are pyTigerGraph, Plotly Express, and Pandas. You can import them using the following:

import pyTigerGraph as tgimport plotly.express as pximport pandas as…


Image for post
Image from Pixabay by Vinson Tan

How to Write Basic GSQL Commands

(Note: This is Part 3 of a series. Check out the past blog to load the data into your database: https://towardsdatascience.com/pok%C3%A9mon-lab-part-ii-adding-more-data-90cddd65ec46!)

Now that you have your data loaded, the next big step will be catching them all and extracting relevant information from your graph using queries. This blog will be using TigerGraph’s query language called GSQL.

Queries will help you extract meaningful results from the data. By now, you should have a lot of data in your graph; the major question is what you should do with the data? How can you manipulate your data to accomplish some sort of task or create some sort of analysis? …


Image for post
Photo from Unsplash by Gerd Altmann

Adding to the Schema and Adding More Data

(Note: This is a Part II of a series. Please check out Part I here: https://towardsdatascience.com/using-api-data-with-tigergraph-ef98cc9293d3)

In the last blog, we learned how to upsert API data into a graph for a basic schema. Now, we’re going to go deeper, making a more complex schema and adding more data.

The past blog was a proof-of-concept for loading API data into a graph in TigerGraph, and that graph only had two vertices connected with one edge. Contrary to the past blog which focused on loading data from an API, this blog will focus on creating a graph that will be more to-scale with what you might create for a project. Here, along with loading the Pokémon and Type data from the past blog, we’ll be loading Moves, Locations, etc. and adding more attributes to our vertices. …


How to Programmatically Create Graphs on TigerGraph

Image for post
Photo from Unsplash by Charl Durand

Why Use Giraffle?

Giraffle, created by Joshua Meekhof, is a way to programmatically create graphs in TigerGraph. When working on a graph project with many team members, having our graph in code makes it easier to collaborate. In addition, in a collaborative space, if someone accidentally drops all or part of the data, your schema and queries are all saved and reusable. Overall, by programmatically creating graphs, Giraffle can help ease collaboration with graphs in TigerGraph.

Steps to Get Started

In this blog, we will cover:

  1. Creating a Solution on TigerGraph
  2. Setting Up Giraffle
  3. Creating a Schema
  4. Loading Data
  5. Creating Queries

By the end of this blog, you will know enough to create your own project with Giraffle! If you ever get stuck or confused, the GitHub is linked at the very end of the blog for you to refer to. …


Image for post
Photo from Pixabay by Thor Deichmann

Pulling Data from PokéAPI and Build a Graph

Why Does This Matter?

Unfortunately, not all data on the Internet comes in nicely packaged CSV files. In fact, frequently, one might want to use data from popular APIs, but how does one load that in a graph?

Agenda

  • Look at the PokéAPI Dataset
  • Create a Graph
  • Load Data from the API to Your Graph

Step 0: Set Up

In this blog, we’ll be using Python 3 (more specifically Python 3.6.9), requests, json, and pyTigerGraph. You can either create a notebook on Colab or run it locally on your computer, but, for the purposes of this lesson, I’d recommend you to use Colab.

If you haven’t already, you’ll need to install pyTigerGraph. If you’re using Colab, here’s how to install…


Why and How to Add a TimeTree to Your Graph (in Giraffle and GraphStudio)

Why use a TimeTree? How do TimeTrees Work?

TimeTrees are useful if you are looking at data over time. It helps divide your data based on day, month, and year makes it easy to analyse over time. For TimeTrees, we create three new nodes: day, month, and year. Day is connected to month which is connected to year. From there, the existing data is connected to the nodes based on how specific the date is.

TimeTrees in TigerGraph GraphStudio

To create a TimeTree in GraphStudio, add three vertices called Year, Month, and Day. Connect Year and Month with an undirected edge YEAR_MONTH and connect Month and Day with another undirected edge MONTH_DAY. Finally, connect your data to those nodes. …


Using Conda to Create Virtual Python Environments

What is an Environment and Why Should I Care?

An environment allows one to keep all of their packages they use for a project together, isolated and not combined with all of the packages ever used on the machine. One potential benefit of keeping all your packages together is that it makes it much easier to deploy, for example in Heroku, as all of your dependencies are in one location. We can use conda to create environments to organise yours projects and the libraries you use.

Creating Your Environment

Step 1: Download Conda

You can figure out how to download conda based on your machine here.

Step 2: Create the Environment

In your terminal or console, type the following:

conda create -n…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store