Import from CSV
Load bulk data from CSV files.
Load structured and nested data from JSON files with support for complex hierarchies.
This tutorial covers importing data from JSON (JavaScript Object Notation) files into your ResearchArcade graph database. You'll learn how to handle nested structures, map JSON objects to graph entities, process arrays and hierarchies, validate schemas, and efficiently import both simple and complex JSON documents.
Understand the JSON structures compatible with ResearchArcade:
{
"papers": [
{
"paper_id": 1,
"title": "Deep Learning Fundamentals",
"authors": [
{"name": "Smith, J.", "affiliation": "MIT"},
{"name": "Jones, A.", "affiliation": "Stanford"}
],
"year": 2023,
"abstract": "This paper explores...",
"citations": [2, 3, 5]
},
{
"paper_id": 2,
"title": "Graph Neural Networks",
"authors": [
{"name": "Brown, K.", "affiliation": "CMU"}
],
"year": 2024,
"abstract": "We present a novel...",
"citations": [1]
}
]
}
Work with both flat and deeply nested JSON structures:
# Code example placeholder
# Add your Python/API code here for handling nested structures
Import newline-delimited JSON (JSONL/NDJSON) for streaming large datasets:
# Code example placeholder
# Add your Python/API code here for JSONL format
Load simple JSON objects as graph nodes:
# Code example placeholder
# Add your Python/API code here for basic node import
Define how JSON fields correspond to node attributes:
# Code example placeholder
# Add your Python/API code here for property mapping
Import multiple entities from JSON arrays:
# Code example placeholder
# Add your Python/API code here for array processing
Transform nested JSON into nodes and edges:
# Code example placeholder
# Add your Python/API code here for nested relationships
Convert hierarchical JSON into graph structure:
# Code example placeholder
# Add your Python/API code here for flattening hierarchies
Store complex nested data as node properties:
# Code example placeholder
# Add your Python/API code here for preserving structure
Import edges defined explicitly in JSON:
# Code example placeholder
# Add your Python/API code here for explicit edges
Create edges from ID references in nested objects:
# Code example placeholder
# Add your Python/API code here for implicit relationships
Handle arrays of references for complex connections:
# Code example placeholder
# Add your Python/API code here for many-to-many relationships
Validate JSON structure against a schema before import:
# Code example placeholder
# Add your Python/API code here for JSON schema validation
Implement domain-specific validation logic:
# Code example placeholder
# Add your Python/API code here for custom validation
Manage validation errors and malformed JSON:
# Code example placeholder
# Add your Python/API code here for handling invalid data
Apply transformations during import:
# Code example placeholder
# Add your Python/API code here for field transformations
Convert JSON types to appropriate database types:
# Code example placeholder
# Add your Python/API code here for type coercion
Generate additional properties from JSON data:
# Code example placeholder
# Add your Python/API code here for computed properties
Update existing nodes with new JSON data:
# Code example placeholder
# Add your Python/API code here for incremental updates
Apply conditional rules during import:
# Code example placeholder
# Add your Python/API code here for conditional import
Combine data from multiple JSON files:
# Code example placeholder
# Add your Python/API code here for merging sources
Process large files without loading entirely into memory:
# Code example placeholder
# Add your Python/API code here for streaming
Import JSON records in optimized batches:
# Code example placeholder
# Add your Python/API code here for batch processing
Use parallel processing for faster imports:
# Code example placeholder
# Add your Python/API code here for parallel import
Handle malformed JSON gracefully:
# Code example placeholder
# Add your Python/API code here for parse error handling
Manage records with missing mandatory data:
# Code example placeholder
# Add your Python/API code here for missing fields
Implement rollback for failed imports:
# Code example placeholder
# Add your Python/API code here for rollback
# Code example placeholder
# Import complex paper records with authors, sections, and citations
# Code example placeholder
# Create entity-relationship graphs from JSON
# Code example placeholder
# Load nested category structures
| Feature | JSON | CSV | API |
|---|---|---|---|
| Nested structures | ✓ Native support | ✗ Requires flattening | ✓ Full support |
| Human readable | ✓ Very readable | ✓ Easy to read | ✓ Readable |
| File size | Medium | Small | N/A (network) |
| Schema flexibility | ✓ Very flexible | ✗ Fixed columns | ✓ Flexible |
| Best for | Complex data exports | Tabular data | Real-time data |
Continue learning about data import from external sources: