Skip to content

Uploading and Downloading Schema

PuppyGraph supports uploading and downloading graph schemas in JSON format through both the Web UI and RESTful API. This allows you to save, share, and manage your graph schema configurations efficiently.

JSON Schema Overview

A PuppyGraph JSON schema contains the complete definition of your graph structure, including:

  • Catalogs: Data source connection configurations
  • Vertices (Nodes): Node types with their properties and identifiers
  • Edges: Relationship types connecting vertices with their properties

The JSON schema format follows the structure outlined in the Schema documentation, providing a portable and version-controllable way to manage your graph definitions.

Using Web UI

Uploading a JSON Schema

You can upload a pre-defined JSON schema file through the PuppyGraph Web UI:

  1. Navigate to the Schema page after logging into PuppyGraph
  2. Click on the Choose File button in the Upload Graph Schema JSON section
  3. Browse and select your JSON schema file from your local system
  4. Click the Upload button to load the schema into PuppyGraph
Schema Upload Interface
Schema page with upload option highlighted

Once uploaded successfully, PuppyGraph will display the schema visualization.

Loaded Schema View
Schema page showing uploaded schema with visualization and JSON view

Downloading a JSON Schema

To download your current graph schema as a JSON file:

  1. Go to the Schema section in the Web UI where your schema is loaded
  2. Find the View schema JSON section below the graph visualization
  3. Click on Download Schema button to download the JSON content.

The downloaded JSON file will contain the complete schema definition and can be used for:

  • Backup and version control
  • Template creation for similar graph structures
  • Migration between PuppyGraph instances

Using API

PuppyGraph provides a RESTful API endpoint for uploading the schema.

Authentication

API requests require authentication using HTTP Basic Authentication with:

  • Username: Your PuppyGraph username (default: puppygraph)
  • Password: Your PuppyGraph password (e.g., puppygraph123 in examples)

Upload Schema

Field Value
Method POST
Endpoint /schema
Headers Content-Type: application/json
Body JSON schema content

Here's a request example to upload a ./schema.json file using curl:

curl -XPOST -H "content-type: application/json" --data-binary @./schema.json --user "puppygraph:puppygraph123" localhost:8081/schema