rzhu1999 / 2K-KG

Course Project of DSCI558: Knowledge Graph
0 stars 0 forks source link

2K-KG

Course Project of DSCI558: Knowledge Graph

Overview

2KKG is a simple knowledge graph applications using JSON data managed entirely via a GraphQL layer called Staple API. It involves:

  1. JSON & CSV data (from 2KDB, NBA Official, Wikipedia, ____) stored in a free-tire MongoDB Atlas instance.

  1. Staple API -- a lightweight GraphQL-based API for managing knowledge graphs on top of different data storage back-ends.
  1. vis.js -- a front-end graph visualization tool.
  1. A query engine that enables our user to directly query data base using Graphql.
  1. Repl.it IDE environment -- to deploy the 2KKG app (optional).

To build 2K-KG:

  1. Change MongoDB Config inside demo.js

    create a file named secret.js and type

    function define(name, value) {
        Object.defineProperty(exports, name, {
            value: value,
            enumerable: true,
        });
    }
    
    define('mongoDBPassword', 'CHANGE_TO_YOUR_OWN_PASSWORD');
  2. npm install

  3. node demo.js

    Warning: if run first time, need to npm dedupe when saw error "Error: Cannot use GraphQLSchema "[object GraphQLSchema]" from another module or realm." then node demo.js again.

To visit Graphql Query Engine

simply add /graphql at the end of your local server address

Deployment

  1. Go to Repl.

  2. Create a Repl with node.js or click import from github with link https://github.com/rzhu1999/2K-KG npm install

  3. Click Run

    Warning: if run first time, need to npm dedupe when saw error "Error: Cannot use GraphQLSchema "[object GraphQLSchema]" from another module or realm." then click Run again.

Domain

NBA 2K is a sports simulation game for basketball and has been the Sports Game of the Year for a couple of years. It uses real-life NBA players' data plus some unique features such as 2K ratings & skill badges of each player. Badges are an attribute of a player’s signature skills, personality, special abilities, and advantages.

The purpose of making this knowledge graph is to aggregate and collect information both in reality and in the 2K game about NBA players. This knowledge graph allows users to understand players' characteristics and performances better.

2. Staple API

Staple API takes a specified RDF ontology, a configuration of the back-end source, and automatically spins-up a ready GraphQL service, with a a corresponding schema and resolvers.