Datasets:

Languages:
English
DOI:
License:
arminmehrabian's picture
Update README.md
b8f650e verified
|
raw
history blame
13 kB
metadata
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.

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. These nodes contain metadata and attributes specific to each dataset.
  • Properties:
    • globalId (String): Unique identifier for the dataset.
    • doi (String): Digital Object Identifier.
    • shortName (String): Abbreviated name of the dataset.
    • longName (String): Full name of the dataset.
    • abstract (String): Brief summary of the dataset.
    • cmrId (String): Common Metadata Repository ID.
    • daac (String): Distributed Active Archive Center associated with the dataset.
    • temporalFrequency (String): Frequency of data collection (e.g., daily, monthly).
    • temporalExtentStart (Date): Start date of the dataset's temporal coverage.
    • temporalExtentEnd (Date): End date of the dataset's temporal coverage.
    • nwCorner (Geo-Coordinate): Northwest corner coordinate of spatial coverage.
    • seCorner (Geo-Coordinate): Southeast corner coordinate of spatial coverage.
    • landingPageUrl (URL): Webpage link to the dataset.
    • pagerank_global (Float): PageRank score calculated using the natural graph direction.
    • fastrp_embedding_with_labels (List): FastRP embedding vector considering node labels.

2. Publication

  • Description: This node type captures publications that reference or use datasets, particularly those from NASA DAACs and other included data providers. By linking datasets and publications, this node type enables analysis of scientific impact and research usage of NASA’s datasets.
  • Properties:
    • globalId (String): Unique identifier for the publication.
    • DOI (String): Digital Object Identifier.
    • title (String): Title of the publication.
    • abstract (String): Summary of the publication's content.
    • authors (List): List of authors.
    • year (Integer): Year of publication.
    • pagerank_global (Float): PageRank score.
    • fastrp_embedding_with_labels (List): FastRP embedding vector.

3. ScienceKeyword

  • Description: Represents scientific keywords used to classify datasets and publications. Keywords provide topical context and aid in identifying research trends and related areas.
  • Properties:
    • globalId (String): Unique identifier.
    • name (String): Name of the science keyword.
    • pagerank_global (Float): PageRank score.
    • fastrp_embedding_with_labels (List): FastRP embedding vector.

4. Instrument

  • Description: Instruments used in data collection, often mounted on platforms like satellites. Instruments are linked to the datasets they help generate.
  • Properties:
    • globalId (String): Unique identifier.
    • shortName (String): Abbreviated name.
    • longName (String): Full name.
    • pagerank_global (Float): PageRank score.
    • fastrp_embedding_with_labels (List): FastRP embedding vector.

5. Platform

  • Description: Platforms, such as satellites or airborne vehicles, that host instruments for data collection.
  • Properties:
    • globalId (String): Unique identifier.
    • shortName (String): Abbreviated name.
    • longName (String): Full name.
    • Type (String): Type of platform.
    • pagerank_global (Float): PageRank score.
    • fastrp_embedding_with_labels (List): FastRP embedding vector.

6. Project

  • Description: NASA projects associated with datasets, often indicating a funding source or collaborative initiative for data collection and research.
  • Properties:
    • globalId (String): Unique identifier.
    • shortName (String): Abbreviated name.
    • longName (String): Full name.
    • pagerank_global (Float): PageRank score.
    • fastrp_embedding_with_labels (List): FastRP embedding vector.

7. DataCenter

  • Description: Represents data centers, primarily NASA DAACs, as well as other data providers in academia and government who manage and distribute datasets.
  • Properties:
    • globalId (String): Unique identifier.
    • shortName (String): Abbreviated name.
    • longName (String): Full name.
    • url (URL): Website of the data center.
    • pagerank_global (Float): PageRank score.
    • fastrp_embedding_with_labels (List): FastRP embedding vector.

Relationships

The knowledge graph includes several relationship types that define how nodes are interconnected.

1. HAS_DATASET

  • Description: Connects a DataCenter to its Dataset(s).
  • Properties: None.

2. OF_PROJECT

  • Description: Links a Dataset to a Project.
  • Properties: None.

3. HAS_PLATFORM

  • Description: Associates a Dataset with a Platform.
  • Properties: None.

4. HAS_INSTRUMENT

  • Description: Connects a Platform to an Instrument.
  • Properties: None.

5. HAS_SCIENCEKEYWORD

  • Description: Links a Dataset to a ScienceKeyword.
  • Properties: None.

6. HAS_SUBCATEGORY

  • Description: Defines hierarchical relationships between ScienceKeyword nodes.
  • Properties: None.

7. CITES

  • Description: Represents citation relationships between Publication nodes, indicating how research builds on previous work.
  • Properties: None.

8. HAS_APPLIED_RESEARCH_AREA

  • Description: Associates a Publication with a ScienceKeyword.
  • Properties: None.

Statistics

  • Total Nodes: 135,764
    • Publication: 125,939
    • Dataset: 6,390
    • ScienceKeyword: 1,609
    • Instrument: 867
    • Platform: 442
    • Project: 333
    • DataCenter: 184
  • Total Relationships: 344,525
    • CITES: 208,670
    • HAS_APPLIED_RESEARCH_AREA: 89,039
    • HAS_SCIENCEKEYWORD: 20,436
    • HAS_PLATFORM: 9,884
    • HAS_DATASET: 9,017
    • OF_PROJECT: 6,049
    • HAS_INSTRUMENT: 2,469
    • HAS_SUBCATEGORY: (Count not provided)

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 that supports Cypher and the APOC library, use the following command:

CALL apoc.load.json("path/to/graph.json") YIELD value
MERGE (n {id: value.id, label: value.label})
SET n += value.properties

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}")