Skip to content

UCF-HENAT/GeoOutageKG

Repository files navigation

GeoOutageKG

GeoOutageKG is a geospatial, multimodal knowledge graph for the domain of power outage detection and analysis in the state of Florida. The corresponding ontology contains separate classes for Outage Records, which is directly recorded from the Eagle-I dataset, NTL Images, from NASA's Black Marble dataset, and Outage Map, which is generated using Aparcedo et al.'s Multimodal Power Outage Prediction model.

Ontologies resued for GeoOutageKG:

All files including NTL and Outage Map imagery can be found on our OSF repository at https://doi.org/10.17605/OSF.IO/QVD8B.

The ontology for GeoOutageKG, GeoOutageOnto, can be accessed from the web at https://ucf-henat.github.io/GeoOutageOnto/. The repository for that web link can be found here.

Installation and Initialization

This section covers how to install all appropirate packages for using the provided data download API (download.py) and knowledge graph generator (GeoOutageKG.py). This section also covers downloading and initializing GeoOutageKG for SPAQRL endpoint use.

Python:

  1. Clone the repository:

    git clone https://github.com/UCF-HENAT/GeoOutageKG.git
    cd GeoOutageKG
    
  2. Create virtual enviroment and install required packages

    With Anaconda:

    conda create -n geooutagekg python=3.12 -y
    conda activate geooutagekg
    pip install --upgrade pip
    pip install -r requirements.txt
    

    With venv:

    python -m venv geooutagekg
    source geooutagekg/bin/activate
    pip install --upgrade pip
    pip install -r requirements.txt
    
  3. (Use if generating your own data, otherwise skip to Step 4) Export NASA Earthdata Token and run download.py (Create Earthdata account and generate token at https://urs.earthdata.nasa.gov/). Replace dates and product as desired. Valid products are VNP46A2 and VNP46A3.

    export EARTH_DATA_TOKEN="EARTH_DATA_TOKEN_HERE"
    python download.py 2025-02-01 2025-02-28 --product="VNP46A2"
    

    a. Convert generated daily county pickle files to PNG images. Replace dir with the location of your pickles as needed.

    python pickle_to_image.py --dir="./county_VNP46A2"
    
  4. (Use if using pre-generated data, otherwise skip to Step 3) Download VNP46A2_county_imgs.zip and outage_maps.zip from https://doi.org/10.17605/OSF.IO/QVD8B and unzip contents

    unzip VNP46A2_county_imgs.zip
    unzip outage_maps.zip
    
  5. Run GeoOutageKG.py and give root directory & serialization format as command arguments

    python GeoOutageKG.py --root_dir="./" --fmt="turtle"
    

    If necessary, swap './' with root directory containing unzipped VNP46A2_county_imgs/ and outage_maps/ folders. Optionally change "turtle" with your format of choice (i.e. xml, jsonld, etc.).

SPARQL Endpoint:

  1. Download all .ttl files from https://doi.org/10.17605/OSF.IO/QVD8B
  2. Import .ttl files into local RDF repository (e.g. GraphDB)

Note: Online SPARQL endpoint for all NTLs, Outage Maps, and Records coming soon!

Example SPARQL Queries

The following section contains examples of SPARQL queries using GeoOutageKG, showing use cases for the knowledge graph.

Query all entries for 29 September 2022

PREFIX goo:  <https://ucf-henat.github.io/GeoOutageOnto/#>
PREFIX ma-ont: <http://www.w3.org/ns/ma-ont#>
PREFIX schema: <http://schema.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT * WHERE {
    ?entry schema:name ?name ;
    	   ma-ont:locator ?locator .
    FILTER(CONTAINS(LCASE(?name), "2022-09-29"))
}

List all Outage Records in the year 2017

PREFIX goo:  <https://ucf-henat.github.io/GeoOutageOnto/#>
PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>

SELECT 
  ?rec          # The OutageRecord resource
  ?recordDate   # Its dateTime
  ?numOutages   # Its integer count
WHERE {
  ?rec a goo:OutageRecord ;
       goo:recordDateTime ?recordDate ;
       goo:numberOfOutages ?numOutages .
  
  FILTER (YEAR(?recordDate) = 2017)
}

List greatest 100 Outage Records with county name & date, sorted from greatest to least

PREFIX goo:  <https://ucf-henat.github.io/GeoOutageOnto/#>
PREFIX dbo:  <https://dbpedia.org/ontology/>
PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT 
  ?rec   
  ?county 
  ?date
  ?num
WHERE {
  ?rec a goo:OutageRecord ;
       goo:representsCounty ?county ;
       goo:recordDateTime   ?date ;
       goo:numberOfOutages  ?num .
}
# Sort descending by number of outages
ORDER BY DESC(?num)
# Only the first 100 results
LIMIT 100

All Data with >100 Outages for Lee County, FL One Month Before and After Hurricane Ian

PREFIX goo:    <https://ucf-henat.github.io/GeoOutageOnto/#>
PREFIX dbo:    <https://dbpedia.org/ontology/>
PREFIX dbr:    <https://dbpedia.org/page/> 
PREFIX ma-ont: <http://www.w3.org/ns/ma-ont#>
PREFIX schema: <http://schema.org/>
PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?ntl ?map ?rec
WHERE {
  BIND(dbr:Lee_County%2C_Florida AS ?county)
    
  # Raw NTL images
  ?ntl a goo:NTLImage ;
       goo:representsCounty ?county .

  # Derived outage maps
  ?map a goo:OutageMap ;
       goo:representsCounty ?county .

  # Numerical outage records
  ?rec a goo:OutageRecord ;
       goo:representsCounty ?county ;
       goo:hasNTLImage      ?ntl ;
       goo:hasOutageMap     ?map ;
       goo:recordDateTime   ?date ;
       goo:numberOfOutages  ?num .

  # Only “surges” >100 outages in the 1-month windows before and after Hurricane Ian
  FILTER(?num > 100)
  FILTER(
    ?date >= "2022-08-28T00:00:00Z"^^xsd:dateTime &&
    ?date <  "2022-10-28T00:00:00Z"^^xsd:dateTime
  )
}

Find Outage Records with highest number of outages, then return NTL Image, Outage Map, county, date, and outage number. Return first 10 results.

PREFIX goo:  <https://ucf-henat.github.io/GeoOutageOnto/#>
PREFIX dbo:  <https://dbpedia.org/ontology/>
PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>

SELECT 
  ?county
  ?maxOutages
  ?dateOfMax
  ?rec
  ?ntl
  ?map
WHERE {
  # Compute the maximum outages per county
  {
    SELECT 
      ?county
      (MAX(?num) AS ?maxOutages)
    WHERE {
      ?rec a goo:OutageRecord ;
           goo:representsCounty ?county ;
           goo:numberOfOutages  ?num .
    }
    GROUP BY ?county
  }
  # Link back to the records that match that maximum
  ?rec a goo:OutageRecord ;
       goo:representsCounty ?county ;
       goo:numberOfOutages  ?maxOutages ;
       goo:recordDateTime   ?dateOfMax ;
       goo:hasNTLImage      ?ntl ;
       goo:hasOutageMap     ?map .
}
ORDER BY DESC(?maxOutages)
LIMIT 10

Citation

If you would like to reference or utilize GeoOutageKG in your work, we kindly ask that you reference us using the following citation:

@InProceedings{geooutagekg,
    author={Frakes, Ethan and Wu, Yinghui and French, Roger H. and Li, Mengjie},
    editor={Garijo, Daniel and Kirrane, Sabrina and Salatino, Angelo and Shimizu, Cogan and Acosta, Maribel and Nuzzolese, Andrea Giovanni and Ferrada, Sebasti{\'a}n and Soulard, Thibaut and Kozaki, Kouji and Takeda, Hideaki and Gentile, Anna Lisa},
    title={{GeoOutageKG}: A Multimodal Geospatiotemporal Knowledge Graph for Multiresolution Power Outage Analysis},
    booktitle={The Semantic Web -- ISWC 2025},
    year={2025},
    month={10},
    publisher={Springer Nature Switzerland},
    address={Cham},
    pages={221--239},
    isbn={978-3-032-09530-5},
    doi={10.1007/978-3-032-09530-5_13},
    eprint={2507.22878},
    eprinttype={arxiv},
    eprintclass={cs.IR}
}

License

GeoOutageKG is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages