Datasets:

Languages:
English
DOI:
License:
arminmehrabian's picture
Card: JSON loader example sets relationship properties (authorPosition, weight, derived)
7eeba66 verified
|
Raw
History Blame Contribute Delete
21.9 kB
metadata
license: apache-2.0
language:
  - en
tags:
  - NASA
  - Earth
  - Satellite
  - Knowledge Graph
  - Machine Learning
  - Authorship
  - Citations
  - OpenAlex

Dataset Summary

The NASA Knowledge Graph Dataset is an expansive graph-based dataset designed to integrate and interconnect information about satellite datasets, scientific publications, instruments, platforms, projects, data centers, and science keywords. This knowledge graph is particularly focused on datasets managed by NASA's Distributed Active Archive Centers (DAACs), which are NASA's data repositories responsible for archiving and distributing scientific data. In addition to NASA DAACs, the graph includes datasets from 184 data providers worldwide, including various government agencies and academic institutions.

The primary goal of the NASA Knowledge Graph is to bridge scientific publications with the datasets they reference, facilitating deeper insights and research opportunities within NASA's scientific and data ecosystem. By organizing these interconnections within a graph structure, this dataset enables advanced analyses, such as discovering influential datasets, understanding research trends, and exploring scientific collaborations.

As of v2.0.0 the graph also models the authorship and citation network around these publications. It adds Author and Institution entities sourced from OpenAlex, links publications to their authors and authors to their institutions, expands the publication and citation coverage by following the citation network outward from cited datasets, and adds derived edges that summarize dataset co-usage and researcher and institution data usage.


What's Changed (v2.0.0) - June 8, 2026

This release augments the graph with authorship, affiliation, and an expanded citation network sourced from OpenAlex, plus computed (derived) edges. The seven original node types and their relationships are preserved unchanged; all additions are additive.

1. Node Changes

  • Total Nodes: Increased from 150,351 to 1,409,253 (+1,258,902)

  • New Node Types:

    • Author: 905,086 (new)
    • Institution: 35,435 (new)
  • Updated Node Counts:

    • Publication: Increased from 138,704 to 457,085 (+318,381), from following the citation network outward from cited datasets
    • Dataset: Remained at 8,058
    • DataCenter: Remained at 189
    • Instrument: Remained at 921
    • Platform: Remained at 455
    • Project: Remained at 415
    • ScienceKeyword: Remained at 1,609

2. Relationship Changes

  • Total Relationships: Increased from 436,203 to 5,836,702 (+5,400,499)

  • New Relationship Types:

    • AUTHORED_BY (Publication to Author): 2,540,881
    • AFFILIATED_WITH (Author to Institution): 1,441,939
    • WORKS_WITH_DATASET (Author or Institution to Dataset, derived): 604,929
    • CO_USED_WITH (Dataset to Dataset, derived): 27,973
  • Updated Relationship Counts:

    • CITES: Increased from 208,616 to 982,434 (+773,818)
    • USES_DATASET: Increased from 44,354 to 55,313 (+10,959)
    • HAS_APPLIEDRESEARCHAREA: Remained at 121,553
    • HAS_SCIENCEKEYWORD: Remained at 25,553
    • HAS_PLATFORM: Remained at 11,944
    • HAS_DATASET: Remained at 11,698
    • OF_PROJECT: Remained at 8,031
    • HAS_INSTRUMENT: Remained at 2,631
    • HAS_SUBCATEGORY: Remained at 1,823

3. Property and Schema Changes

  • New node types Author and Institution carry the properties listed under Dataset Structure below. All properties remain string type for cross-database compatibility, consistent with v1.2.0.
  • Asserted vs derived edges. Edges computed from the graph's own structure carry a boolean property derived: true and a numeric weight, so they can be filtered apart from sourced facts. These are CO_USED_WITH and WORKS_WITH_DATASET. AUTHORED_BY carries an authorPosition property (first, middle, last).
  • Citation-expansion publications. Publications discovered by following the citation network carry globalId, doi, title, and year. They may not include abstract or authors string fields, which are present on the original publication set.

4. New Data Sources

  • OpenAlex (openalex.org) provides author, institution, authorship, affiliation, and citation data, and is released under a CC0 1.0 public domain dedication. OpenAlex builds on ROR (institution identifiers) and ORCID (author identifiers), which are likewise openly licensed. OpenAlex data is provided as is. Author identity reflects OpenAlex disambiguation, which on rare occasions splits one person across multiple identifiers.

Data Integrity

Each file in the dataset has a SHA-256 checksum to verify its integrity:

File Name SHA-256 Checksum
graph.cypher 4ee679f97d8e06ae599bc1aa49dd35eeb2ff04c7b2b82029ed842425d1394cc3
graph.graphml 85d563ebb900fb6835021688f0d41d9e60bf7c8bd088a30363503c765b66b9e5
graph.json 63779a173e3053306eb2fd92d541877e76dcb8d87ea1bf507a34d1c42ed72f0c

Verification

To verify the integrity of each file, calculate its SHA-256 checksum and compare it with the hashes provided above.

You can use the following Python code to calculate the SHA-256 checksum:

import hashlib

def calculate_sha256(filepath):
    sha256_hash = hashlib.sha256()
    with open(filepath, "rb") as f:
        for byte_block in iter(lambda: f.read(4096), b""):
            sha256_hash.update(byte_block)
    return sha256_hash.hexdigest()

Dataset Structure

Nodes and Properties

The knowledge graph consists of nine node types. The seven original types describe NASA's data ecosystem; Author and Institution were added in v2.0.0 to describe the people and organizations behind the publications.

1. Dataset

  • Description: Represents satellite datasets, particularly those managed by NASA DAACs, along with datasets from other governmental and academic data providers.

  • Properties:

    • globalId (String)
    • doi (String)
    • shortName (String)
    • longName (String)
    • abstract (String)
    • cmrId (String)
    • daac (String)
    • temporalFrequency (String)
    • temporalExtentStart (String)
    • temporalExtentEnd (String)

2. Publication

  • Description: Captures publications that reference or use datasets.

  • Properties:

    • globalId (String)
    • doi (String)
    • title (String)
    • abstract (String)
    • authors (String)
    • year (String)

3. ScienceKeyword

  • Properties:

    • globalId (String)
    • name (String)

4. Instrument

  • Properties:

    • globalId (String)
    • shortName (String)
    • longName (String)

5. Platform

  • Properties:

    • globalId (String)
    • shortName (String)
    • longName (String)
    • Type (String)

6. Project

  • Properties:

    • globalId (String)
    • shortName (String)
    • longName (String)

7. DataCenter

  • Properties:

    • globalId (String)
    • shortName (String)
    • longName (String)
    • url (String)

8. Author

  • Description: A person credited as an author on one or more publications, sourced from OpenAlex. Added in v2.0.0.

  • Properties:

    • globalId (String)
    • name (String)
    • openalexId (String)
    • orcid (String)

9. Institution

  • Description: An organization affiliated with one or more authors, sourced from OpenAlex. Added in v2.0.0.

  • Properties:

    • globalId (String)
    • name (String)
    • openalexId (String)
    • ror (String)
    • country (String)

Statistics

Total Counts

Type Count
Total Nodes 1,409,253
Total Relationships 5,836,702

Node Label Counts

Node Label Count
Author 905,086
Publication 457,085
Institution 35,435
Dataset 8,058
ScienceKeyword 1,609
Instrument 921
Platform 455
Project 415
DataCenter 189

Relationship Label Counts

Relationship Label Count
AUTHORED_BY 2,540,881
AFFILIATED_WITH 1,441,939
CITES 982,434
WORKS_WITH_DATASET 604,929
HAS_APPLIEDRESEARCHAREA 121,553
USES_DATASET 55,313
CO_USED_WITH 27,973
HAS_SCIENCEKEYWORD 25,553
HAS_PLATFORM 11,944
HAS_DATASET 11,698
OF_PROJECT 8,031
HAS_INSTRUMENT 2,631
HAS_SUBCATEGORY 1,823

Derived Edges

Two relationship types are computed from the graph's own structure rather than ingested from a source. Each carries derived: true and a weight:

  • CO_USED_WITH (Dataset to Dataset): two datasets used together in the same publication. Stored in one direction; query it undirected. weight is the number of publications co-using the pair.
  • WORKS_WITH_DATASET (Author or Institution to Dataset): an author, or an author's institution, that has worked with a dataset through an authored publication. weight is the number of evidencing publications.

Data Formats

The Knowledge Graph Dataset is available in three formats: JSON, GraphML, and Cypher.

1. JSON

  • File: graph.json
  • Description: A line-delimited JSON format representing nodes and relationships, one object per line. Each node includes its properties, such as globalId and doi.
  • Usage: Suitable for web applications and APIs, and for use cases where line-delimited data structures are preferred.

Loading the JSON Format

To load the JSON file into a graph database using Python and multiprocessing:

import json
from tqdm import tqdm
from collections import defaultdict
from multiprocessing import Pool, cpu_count
from neo4j import GraphDatabase

# Batch size for processing
BATCH_SIZE = 100

# Neo4j credentials (replace with environment variables or placeholders)
NEO4J_URI = "bolt://<your-neo4j-host>:<port>"  # e.g., "bolt://localhost:7687"
NEO4J_USER = "<your-username>"
NEO4J_PASSWORD = "<your-password>"


def ingest_data(file_path):
    # Initialize counters and label trackers
    node_label_counts = defaultdict(int)
    relationship_label_counts = defaultdict(int)
    node_count = 0
    relationship_count = 0

    with open(file_path, "r") as f:
        nodes = []
        relationships = []

        # Read and categorize nodes and relationships, and count labels
        for line in tqdm(f, desc="Reading JSON Lines"):
            obj = json.loads(line.strip())
            if obj["type"] == "node":
                nodes.append(obj)
                node_count += 1
                for label in obj["labels"]:
                    node_label_counts[label] += 1
            elif obj["type"] == "relationship":
                relationships.append(obj)
                relationship_count += 1
                relationship_label_counts[obj["label"]] += 1

    # Print statistics
    print("\n=== Data Statistics ===")
    print(f"Total Nodes: {node_count}")
    print(f"Total Relationships: {relationship_count}")
    print("\nNode Label Counts:")
    for label, count in node_label_counts.items():
        print(f"  {label}: {count}")
    print("\nRelationship Label Counts:")
    for label, count in relationship_label_counts.items():
        print(f"  {label}: {count}")
    print("=======================")

    # Multiprocess node ingestion
    print("Starting Node Ingestion...")
    node_batches = [nodes[i : i + BATCH_SIZE] for i in range(0, len(nodes), BATCH_SIZE)]
    with Pool(processes=cpu_count()) as pool:
        list(
            tqdm(
                pool.imap(ingest_nodes_batch, node_batches),
                total=len(node_batches),
                desc="Ingesting Nodes",
            )
        )

    # Multiprocess relationship ingestion
    print("Starting Relationship Ingestion...")
    relationship_batches = [
        relationships[i : i + BATCH_SIZE]
        for i in range(0, len(relationships), BATCH_SIZE)
    ]
    with Pool(processes=cpu_count()) as pool:
        list(
            tqdm(
                pool.imap(ingest_relationships_batch, relationship_batches),
                total=len(relationship_batches),
                desc="Ingesting Relationships",
            )
        )


def ingest_nodes_batch(batch):
    with GraphDatabase.driver(NEO4J_URI, auth=(NEO4J_USER, NEO4J_PASSWORD)) as driver:
        with driver.session() as session:
            for node in batch:
                try:
                    label = node["labels"][0]  # Assumes a single label per node
                    query = f"""
                    MERGE (n:{label} {{globalId: $globalId}})
                    SET n += $properties
                    """
                    session.run(
                        query,
                        globalId=node["properties"]["globalId"],
                        properties=node["properties"],
                    )
                except Exception as e:
                    print(
                        f"Error ingesting node with globalId {node['properties']['globalId']}: {e}"
                    )


def ingest_relationships_batch(batch):
    with GraphDatabase.driver(NEO4J_URI, auth=(NEO4J_USER, NEO4J_PASSWORD)) as driver:
        with driver.session() as session:
            for relationship in batch:
                try:
                    rel_type = relationship[
                        "label"
                    ]  # Use the label for the relationship
                    query = f"""
                    MATCH (start {{globalId: $start_globalId}})
                    MATCH (end {{globalId: $end_globalId}})
                    MERGE (start)-[r:{rel_type}]->(end)
                    SET r += $properties
                    """
                    session.run(
                        query,
                        start_globalId=relationship["start"]["properties"]["globalId"],
                        end_globalId=relationship["end"]["properties"]["globalId"],
                        properties=relationship.get("properties", {}),
                    )
                except Exception as e:
                    print(
                        f"Error ingesting relationship with label {relationship['label']}: {e}"
                    )


if __name__ == "__main__":
    # Path to the JSON file
    JSON_FILE_PATH = "<path-to-your-graph.json>"

    # Run the ingestion process
    ingest_data(JSON_FILE_PATH)

2. GraphML

  • File: graph.graphml
  • Description: An XML-based format well-suited for complex graph structures and metadata-rich representations.
  • Usage: Compatible with graph visualization and analysis tools, including Gephi, Cytoscape, and databases that support GraphML import.

Loading the GraphML Format

To import the GraphML file into a graph database with APOC support, use the following command:

CALL apoc.import.graphml("path/to/graph.graphml", {readLabels: true})

3. Cypher

  • File: graph.cypher
  • Description: A series of Cypher commands to recreate the knowledge graph structure.
  • Usage: Useful for recreating the graph in any Cypher-compatible graph database.

Loading the Cypher Format

To load the Cypher script, execute it directly using a command-line interface for your graph database:

neo4j-shell -file path/to/graph.cypher

4. Loading the Knowledge Graph into PyTorch Geometric (PyG)

This knowledge graph can be loaded into PyG (PyTorch Geometric) for further processing, analysis, or model training. Below is an example script that shows how to load the JSON data into a PyG-compatible HeteroData object.

The script first reads the JSON data, processes nodes and relationships, and then loads everything into a HeteroData object for use with PyG.

import json
import torch
from torch_geometric.data import HeteroData
from collections import defaultdict

# Load JSON data from file
file_path = "path/to/graph.json"  # Replace with your actual file path
graph_data = []
with open(file_path, "r") as f:
    for line in f:
        try:
            graph_data.append(json.loads(line))
        except json.JSONDecodeError as e:
            print(f"Error decoding JSON line: {e}")
            continue

# Initialize HeteroData object
data = HeteroData()

# Mapping for node indices per node type
node_mappings = defaultdict(dict)

# Temporary storage for properties to reduce concatenation cost
node_properties = defaultdict(lambda: defaultdict(list))
edge_indices = defaultdict(lambda: defaultdict(list))

# Process each item in the loaded JSON data
for item in graph_data:
    if item['type'] == 'node':
        node_type = item['labels'][0]  # Assuming first label is the node type
        node_id = item['id']
        properties = item['properties']

        # Store the node index mapping
        node_index = len(node_mappings[node_type])
        node_mappings[node_type][node_id] = node_index

        # Store properties temporarily by type
        for key, value in properties.items():
            if isinstance(value, list) and all(isinstance(v, (int, float)) for v in value):
                node_properties[node_type][key].append(torch.tensor(value, dtype=torch.float))
            elif isinstance(value, (int, float)):
                node_properties[node_type][key].append(torch.tensor([value], dtype=torch.float))
            else:
                node_properties[node_type][key].append(value)  # non-numeric properties as lists

    elif item['type'] == 'relationship':
        start_type = item['start']['labels'][0]
        end_type = item['end']['labels'][0]
        start_id = item['start']['id']
        end_id = item['end']['id']
        edge_type = item['label']

        # Map start and end node indices
        start_idx = node_mappings[start_type][start_id]
        end_idx = node_mappings[end_type][end_id]

        # Append to edge list
        edge_indices[(start_type, edge_type, end_type)]['start'].append(start_idx)
        edge_indices[(start_type, edge_type, end_type)]['end'].append(end_idx)

# Finalize node properties by batch processing
for node_type, properties in node_properties.items():
    data[node_type].num_nodes = len(node_mappings[node_type])
    for key, values in properties.items():
        if isinstance(values[0], torch.Tensor):
            data[node_type][key] = torch.stack(values)
        else:
            data[node_type][key] = values  # Keep non-tensor properties as lists

# Finalize edge indices in bulk
for (start_type, edge_type, end_type), indices in edge_indices.items():
    edge_index = torch.tensor([indices['start'], indices['end']], dtype=torch.long)
    data[start_type, edge_type, end_type].edge_index = edge_index

# Display statistics for verification
print("Nodes and Properties:")
for node_type in data.node_types:
    print(f"\nNode Type: {node_type}")
    print(f"Number of Nodes: {data[node_type].num_nodes}")
    for key, value in data[node_type].items():
        if key != 'num_nodes':
            if isinstance(value, torch.Tensor):
                print(f"  - {key}: {value.shape}")
            else:
                print(f"  - {key}: {len(value)} items (non-numeric)")

print("\nEdges and Types:")
for edge_type in data.edge_types:
    edge_index = data[edge_type].edge_index
    print(f"Edge Type: {edge_type} - Number of Edges: {edge_index.size(1)} - Shape: {edge_index.shape}")

Provenance and Licensing

The combined dataset is released under the Apache 2.0 license. The original NASA entities (Dataset, Publication, ScienceKeyword, Instrument, Platform, Project, DataCenter) are sourced as described in the reference below. The Author, Institution, AUTHORED_BY, AFFILIATED_WITH, and expanded Publication and CITES data are sourced from OpenAlex, which is released under CC0 1.0, and build on the ROR and ORCID open identifier systems. The CO_USED_WITH and WORKS_WITH_DATASET edges are computed from the graph and are marked with derived: true.


Citation

Please cite the dataset as follows:

NASA Goddard Earth Sciences Data and Information Services Center (GES-DISC). (2024). Knowledge Graph of NASA Earth Observations Satellite Datasets and Related Research Publications [Data set]. DOI: 10.57967/hf/3463

BibTeX

@misc {nasa_goddard_earth_sciences_data_and_information_services_center__(ges-disc)_2024,
    author       = { {NASA Goddard Earth Sciences Data and Information Services Center (GES-DISC)} },
    title        = { nasa-eo-knowledge-graph },
    year         = 2024,
    url          = { https://huggingface.co/datasets/nasa-gesdisc/nasa-eo-knowledge-graph },
    doi          = { 10.57967/hf/3463 },
    publisher    = { Hugging Face }
}

References

For details on the process of collecting these publications, please refer to:

Gerasimov, I., Savtchenko, A., Alfred, J., Acker, J., Wei, J., & KC, B. (2024). Bridging the Gap: Enhancing Prominence and Provenance of NASA Datasets in Research Publications. Data Science Journal, 23(1). DOI: 10.5334/dsj-2024-001


Contact

For any questions or further information, please contact: