Skip to content

shreyash2002/Integrated-Personal-Data-Store

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aries Personal Data Store

Introduction

This is an architecture for a database designed to store verifyable credentials and other miscellanious information associated with an Aries agent. It is intended to run on the cloud, and can serve several users while still guaranteeing that only the user can access their data. Data would be stored as an RDF graph using turtle, XML, or similar. The data would be standardized using the classes provided in the My Data Ontology, build on the Common Core Ontolgy, which is an extension of the Basic Formal Ontology.

What's included

./pds-middleware

 Containers the node server for the middleware. This folder is also a docker volume for the node container.

./pds-middlware/backend   An Express Typescript server that host the api for the personal data store. The server's purpose is to interface with the triple store by crafting sparql queries.

./pds-middlware/frontend   A React Webapp that displays a person's data and credentials. The front end sends http requests when it needs to Create, Udpate, Read, Destroy data.

./triple-store

 The Docker Volume for the Apache Jena Fuseki. Do not edit this file unless you want to directly modify the Fuseki backup

./docker-compose.yml

 The docker-compose file that defines a docker network and 2 containers - Triple Store and Middleware

Getting Started

What to install

All the components of the Aries PDS run inside docker containers. Use the links provided below to install docker and docker-compose

  1. Install docker here
  2. Install docker-compose here

How to Run

  1. Decide what mode you want to run the server in.
  • Production Mode: Run the platform over https at the address: https://iamtestingbed.com/
  • Testing Mode: Run the platform over http at :80

To set the different mode, navigate to the file ./pds-middleware/backend/serverConfig.ts and send the value for production

  1. docker-compose up -d

Docker-compose creates two docker containers. The first container is an apache jena fuseki triple store. The seconds is a node server that runs a middleware.

  1. docker-compose down

To stop all the containers

How to Access the triple store Web Interface

Jena fuseki runs a web interface that allows developers to run queries and input data. To access the web interface locally visit http://localhost:3030/ in your internet browser

Middleware API

My Wallet Endpoints

  1. listAllConnections
/**
 *  Sends a request to the Trinsic API to list all the credentials. 
 *  @param {string} walletId: The Wallet Id
 *  Status: Done
 *  @CR
 */
app.post('/api/listAllConnections', async (request: Request<string, any>, response: Response)
  1. listCredentialsInWallet
/**
 * Sends a request to Trinisc API to list all the credential in a wallet
 * @param {string} walletId: The Wallet Id
 * Status: Done
 * @CR
 */
app.post('/api/listCredentialsInWallet', async (request: Request<string, any>, response: Response)
  1. getCredentialsInWallet
/**
 *  Sends a request to Trinisc API to get a specific credential given a credential Id
 * @param {string} walletId: The Wallet Id
 * @param {string} credentialId: The credential Id
 * Status: Done
 * @CR
 */
app.post('/api/getCredentialInWallet', async (request: Request<string, any>, response: Response)
  1. deleteCredential
/**
 * Sends a request to the Trinsic API to delete a given credential given a credential Id
 * @param {string} walletId: The Wallet Id
 * @param {string} credentialId: The credential Id
 * Status: Done
 * @CR
 */
app.delete('/api/deleteCredential', async (request: Request<string, any>, response: Response)
  1. AcceptCredential
/**
 * Sends a request to the Trinsic API to delete a given credential given a credential Id
 * @param {string} walletId: The Wallet Id
 * @param {string} credentialData: The url for the Credn
 * Status: Done
 * @CR
 */
app.post('/api/AcceptCredential', async (request: Request<string, any>, response: Response)
  1. createWallet
/**
 * Sends a request to the Trinsic Wallet to create a digital Wallet. If there already is a wallet,
 * sends a response indicating the current wallet
 * Status: Done
 * @CR
 */
app.put('/api/createWallet', async (request: Request<string, any>, response: Response)
  1. DeleteCloudWallet
/**
 * Sends a request to the Trinsic API to delete a cloud wallet 
 * @param {string} walletId: The ID for the digital Wallet
 * Status: Update the triples 
 * @CR
 */
app.delete('/api/DeleteCloudWallet', async (request: Request<string, any>, response: Response)
  1. DeleteAllCloudWallet
/**
 * Sends a request to the Trinsic API to delete ALL cloud wallet 
 * Status: Update the triples 
 * @CR
 */
app.delete('/api/DeleteAllCloudWallet', async (request: Request<string, any>, response: Response)
  1. getWallet
/**
 * Sends a request to the Trinsic API to get the current wallet
 * Status: Done
 * @CR
 */
app.get('/api/getWallet', async (request: Request<string, any>, response: Response)

My Data Endpoints

  1. getPersonIRI
/**
 * Sends a query to the triple store to get the IRI for the Person
 * Status: Done
 * @CR
 */
app.get('/api/getPersonIRI', (request: Request<string, any>, response: Response)
  1. createNewUser
/**
 * Creates a new user in the triple store. If there is already a user, sends the IRI 
 * of the current person
 * Status: Done 
 * @CE 
 */
app.put('/api/createNewUser', (request: Request<string, any>, response: Response)
  1. createMyData
/**
 * Creates triples for the an attribute in the Verifiable Credential and uploads the data into the triple store
 * @param {string} person: The IRI of the person 
 * @param {string} attribute: The attribte that you want to create
 * @param {string} value: The value of the attribute
 * @param {string} verifiableCredentialId: The id for the Verifiable Credential
 * Status: In Progress Fix createMyDataFunction and test
 * @CR
 */
app.put('/api/createMyData', (request: Request<string, any>, response: Response)

4.readMappedAttributes

/**
 * Sends the current attribute that have been mapped in the My Data Ontology
 * Status: Done 
 * @Cr
 */
app.get('/api/readMappedAttributes', (request: Request, response: Response)
  1. readMyData
/**
 * Queries the triple store to get all a person's data 
 * Status: Done
 * @CR
 */
app.get('/api/readMyData', (request: Request, response: Response)

6.readTriples

/**
 * Reads triples from triple store
 * Status: Unknown
 */
app.post('/dev/readTriples', (request: Request, response: Response)
  1. getOntologyMapping
/**
 * Returns Onotology Mapping
 * Status: Unknown
 */
app.get('/dev/getOntologyMapping', (request: Request, response: Response)
  1. createTriples
/**
 * Creates Triples inside triple store
 * Status: In Process
 */
app.post('/dev/createTriples', (request: Request, response: Response)

Testing Issues

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 66.1%
  • JavaScript 31.9%
  • HTML 1.5%
  • CSS 0.5%