--- license: apache-2.0 language: - en tags: - NASA - Earth - Satellite - Knowledge Graph - Machine Learning --- # NASA Knowledge Graph Dataset ## 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. --- ## What's Changed (v1.2.0) - October 21, 2025 ### 1. Node Changes * **Total Nodes:** Increased from 145,678 to 150,351 (+4,673) * **New Node Counts:** * **Dataset:** Increased from 6,821 to 8,058 (+1,237) * **DataCenter:** Decreased from 197 to 189 (-8) * **Instrument:** Increased from 897 to 921 (+24) * **Platform:** Increased from 451 to 455 (+4) * **Project:** Increased from 351 to 415 (+64) * **Publication:** Increased from 135,352 to 138,704 (+3,352) * **ScienceKeyword:** Remained the same at 1,609 ### 2. Relationship Changes * **Total Relationships:** Increased from 406,515 to 436,203 (+29,688) * **Updated Relationship Counts:** * **CITES:** Increased from 208,429 to 208,616 (+187) * **HAS_APPLIEDRESEARCHAREA:** Increased from 119,695 to 121,553 (+1,858) * **HAS_DATASET:** Increased from 9,834 to 11,698 (+1,864) * **HAS_INSTRUMENT:** Increased from 2,526 to 2,631 (+105) * **HAS_PLATFORM:** Increased from 10,398 to 11,944 (+1,546) * **HAS_SCIENCEKEYWORD:** Increased from 21,571 to 25,553 (+3,982) * **HAS_SUBCATEGORY:** Remained the same at 1,823 * **OF_PROJECT:** Increased from 6,378 to 8,031 (+1,653) * **USES_DATASET:** Increased from 25,861 to 44,354 (+18,493) ### 3. Property Changes * **Removed Properties:** * `pagerank_publication_dataset` and all derived PageRank fields. * **Schema Updates:** * All node properties standardized to string type for cross-database compatibility. * No new node types added; schema remains stable with seven main entity types. * Relationship properties remain null across all types. These changes reflect expansion in dataset-publication linkages, improved dataset completeness, and schema simplification for downstream applications. --- ## Data Integrity Each file in the dataset has a SHA-256 checksum to verify its integrity: | File Name | SHA-256 Checksum | | --------------- | ------------------------------------------------------------------ | | `graph.cypher` | `ed4800be1a822822402083e6209a0b3dd1a1a697e0a44b19e74638cd8a2c3abe` | | `graph.graphml` | `55d7c4fc1a29b692c909bd76f89b35d9b3705f41febcdb6261ae72bca533e086` | | `graph.json` | `4cb68b0d7e5f2b5a6823ee489a58938f534bc9bcbce53d6f8c03f31f8c23795e` | ### 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: ```python 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 seven main node types, each representing a different entity within NASA's ecosystem. #### 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) --- ## Statistics # Data Statistics ## Total Counts | Type | Count | | ----------------------- | ------- | | **Total Nodes** | 150,351 | | **Total Relationships** | 436,203 | ## Node Label Counts | Node Label | Count | | -------------- | ------- | | Dataset | 8,058 | | DataCenter | 189 | | Project | 415 | | Platform | 455 | | Instrument | 921 | | ScienceKeyword | 1,609 | | Publication | 138,704 | ## Relationship Label Counts | Relationship Label | Count | | ----------------------- | ------- | | CITES | 208,616 | | HAS_APPLIEDRESEARCHAREA | 121,553 | | HAS_DATASET | 11,698 | | HAS_INSTRUMENT | 2,631 | | HAS_PLATFORM | 11,944 | | HAS_SCIENCEKEYWORD | 25,553 | | HAS_SUBCATEGORY | 1,823 | | OF_PROJECT | 8,031 | | USES_DATASET | 44,354 | --- ## Data Formats The Knowledge Graph Dataset is available in three formats: JSON, GraphML, and Cypher. (Section content unchanged from previous version.) ## Data Formats The Knowledge Graph Dataset is available in three formats: ### 1. JSON - **File**: `graph.json` - **Description**: A hierarchical data format representing nodes and relationships. Each node includes its properties, such as `globalId`, `doi`, and `pagerank_global`. - **Usage**: Suitable for web applications and APIs, and for use cases where hierarchical data structures are preferred. #### Loading the JSON Format To load the JSON file into a graph database using Python and multiprocessing you can using the following script: ```python 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://:" # e.g., "bolt://localhost:7687" NEO4J_USER = "" NEO4J_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) """ session.run( query, start_globalId=relationship["start"]["properties"]["globalId"], end_globalId=relationship["end"]["properties"]["globalId"], ) 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 = "" # 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: ```cypher 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: ```bash 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. ```python 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}") ``` --- ## 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](https://doi.org/10.57967/hf/3463) ### BibTeX ```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](https://doi.org/10.5334/dsj-2024-001) For any questions or further information, please contact: - Armin Mehrabian: [armin.mehrabian@nasa.gov](mailto:armin.mehrabian@nasa.gov) - Irina Gerasimov: [irina.gerasimov@nasa.gov](mailto:irina.gerasimov@nasa.gov) - Kendall Gilbert: [kendall.c.gilbert@nasa.gov](mailto:kendall.c.gilbert@nasa.gov)