Skip to content

Latest commit

 

History

History
326 lines (280 loc) · 10.9 KB

query_example.md

File metadata and controls

326 lines (280 loc) · 10.9 KB

SPARQL query examples for GEOSatDB

1. Namespaces

PREFIX eo-ont: <https://www.eoknowledgehub.cn/eo/ontology/>
PREFIX mrc: <https://schemas.isotc211.org/19115/-1/mrc/1.3.0/>
PREFIX mac: <https://schemas.isotc211.org/19115/-2/mac/2.2/>
PREFIX smi: <https://schemas.isotc211.org/19130/-3/smi/1.1/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX schema: <http://schema.org/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX eor: <https://www.eoknowledgehub.cn/eo/resource/>

2. Satellite property

2.1. name and alternateName

select DISTINCT ?satellite ?name ?launchDate where {
    ?satellite a eo-ont:Satellite ;
               schema:name ?name;
               schema:alternateName ?alternateName;
               eo-ont:launchDate ?launchDate.
    FILTER(CONTAINS(LCASE(?name),"landsat")||
        CONTAINS(LCASE(?alternateName),"landsat"))
}
ORDER BY DESC(?launchDate)

2.2. launchDate

select DISTINCT ?satellite ?name ?launchDate where {
    ?satellite a eo-ont:Satellite ;
               schema:name ?name;
               schema:alternateName ?alternateName;
               eo-ont:launchDate ?launchDate.
    FILTER(?launchDate>="2023-01-01"^^xsd:dateTime && ?launchDate<"2024-01-01"^^xsd:dateTime)
}
ORDER BY DESC(?launchDate)

2.3. Owner

2.3.1. Owner count

select ?owner ?owner_name (COUNT(DISTINCT ?satellite) AS ?count) where {
    ?satellite a eo-ont:Satellite ;
               eo-ont:owner ?owner.
    ?owner rdfs:label ?owner_name.
}
GROUP BY ?owner ?owner_name
ORDER BY DESC(?count)

2.3.2. Designated owner

select DISTINCT ?satellite ?name ?launchDate ?owner ?owner_name where {
    ?satellite a eo-ont:Satellite ;
               schema:name ?name;
               eo-ont:launchDate ?launchDate;
               eo-ont:owner ?owner.
    ?owner rdfs:label ?owner_name.
#    FILTER(LCASE(?owner_name)="china"@en)
    FILTER(CONTAINS(LCASE(?owner_name),"china"))
}
ORDER BY DESC(?launchDate)

2.4. Orbit Type

2.4.1. Orbit Type count

select ?orbitType ?orbitType_name (COUNT(DISTINCT ?satellite) AS ?count) where {
    ?satellite a eo-ont:Satellite ;
               eo-ont:orbitType ?orbitType.
    ?orbitType rdfs:label ?orbitType_name.
}
GROUP BY ?orbitType ?orbitType_name
ORDER BY DESC(?count)

2.4.2. Designated Orbit Type

select DISTINCT ?satellite ?name ?launchDate where {
    ?satellite a eo-ont:Satellite ;
               schema:name ?name;
               eo-ont:launchDate ?launchDate;
               eo-ont:orbitType eor:orbit_type.LLEO_S.
}
ORDER BY DESC(?launchDate)

3. Sensor property

3.1. name and alternateName

select DISTINCT ?sensor ?name where {
    ?sensor a eo-ont:Sensor ;
               schema:name ?name;
               schema:alternateName ?alternateName.
    FILTER(CONTAINS(LCASE(?name),"modis")||
        CONTAINS(LCASE(?alternateName),"modis"))
}

3.2. Satellites and on-board sensors

select DISTINCT ?satellite ?satellite_name ?sensor ?sensor_name where {
    ?satellite a eo-ont:Satellite ;
               schema:name ?satellite_name ;
               eo-ont:launchDate ?launchDate.
    ?sensor mac:mountedOn ?satellite ;
            schema:name ?sensor_name .
}
ORDER BY DESC(?launchDate)

3.3. waveband region

select ?wavebandRegion ?wavebandRegion_name (COUNT(DISTINCT ?sensor) AS ?sensor_count) where {
    ?sensor a eo-ont:Sensor ;
            eo-ont:operationalBand ?operationalBand .
    ?operationalBand eo-ont:wavebandRegion ?wavebandRegion.
    ?wavebandRegion rdfs:label ?wavebandRegion_name.
}
GROUP BY ?wavebandRegion ?wavebandRegion_name
ORDER BY DESC(?sensor_count)

3.4. sensor type

select ?sensorType ?sensorType_name (COUNT(DISTINCT ?sensor) AS ?sensor_count) where {
    ?sensor a eo-ont:Sensor ;
            eo-ont:sensorType ?sensorType .
    ?sensorType rdfs:label ?sensorType_name.
}
GROUP BY ?sensorType ?sensorType_name
ORDER BY DESC(?sensor_count)

3.5. Wavelength/Frequency

select DISTINCT ?sensor ?sensor_name ?boundMin ?boundMax where {
    ?sensor a eo-ont:Sensor ;
            schema:name ?sensor_name ;
            eo-ont:operationalBand ?operationalBand.
    ?operationalBand mrc:boundUnit "micrometer"@en ;
                     mrc:boundMin ?boundMin ;
                     mrc:boundMax ?boundMax .
    FILTER((?boundMin>=0.40) && (?boundMax<=0.75))
}
ORDER BY DESC(?sensor)

3.6. Horizontal resolution (m)

select DISTINCT ?sensor ?sensor_name ?wavebandRegion ?horizontalResolution where {
    ?sensor a eo-ont:Sensor ;
            schema:name ?sensor_name ;
            eo-ont:operationalBand ?operationalBand.
    ?operationalBand eo-ont:operation ?operation ;
                     eo-ont:wavebandRegion ?wavebandRegion .
    ?operation eo-ont:horizontalResolution ?horizontalResolution.
    FILTER(?horizontalResolution<100)
}
ORDER BY DESC(?horizontalResolution)

4. Use cases

4.1. Orbiting satellites in a specific waveband

select DISTINCT ?satellite ?satellite_name where {
    ?satellite a eo-ont:Satellite ;
               schema:name ?satellite_name ;
               eo-ont:operationalStatus ?operationalStatus .
    FILTER (?operationalStatus in (eor:operational_status.operational, eor:operational_status.partially_operational, eor:operational_status.spare, eor:operational_status.extended_mission)) .
    ?sensor mac:mountedOn ?satellite ;
            schema:name ?sensor_name ;
            eo-ont:operationalBand ?operationalBand .
    ?operationalBand eo-ont:wavebandRegion eor:waveband_region.Red.
}

4.2. Number of orbiting satellites with NIR capability

select DISTINCT ?satellite ?satellite_name ?sensor ?sensor_name where {
    ?satellite a eo-ont:Satellite ;
               schema:name ?satellite_name ;
               eo-ont:operationalStatus ?operationalStatus .
    FILTER (?operationalStatus in (eor:operational_status.operational, eor:operational_status.partially_operational, eor:operational_status.spare, eor:operational_status.extended_mission)) .
    ?sensor mac:mountedOn ?satellite ;
            schema:name ?sensor_name ;
            eo-ont:operationalBand ?operationalBand .
    ?operationalBand eo-ont:wavebandRegion eor:waveband_region.NIR .
}

4.3. Maximum horizontal resolution of microwave sensors

SELECT ?satellite ?satellite_name ?sensor ?sensor_name ?launchDate ?year ?maxRes WHERE {
    {
        SELECT ?sensor (MIN(?band_tir_res) AS ?maxRes) WHERE {
            ?sensor rdf:type eo-ont:Sensor;
                    schema:name ?sensor_name;
                    eo-ont:operationalBand ?band.
            ?band mrc:boundUnit "gigahertz"@en;
                                              eo-ont:operation ?band_tir_op.
            ?band_tir_op eo-ont:horizontalResolution ?band_tir_res.
        }
        GROUP BY ?sensor
    }
    ?sensor mac:mountedOn ?satellite;
            schema:name ?sensor_name.
    ?satellite schema:name ?satellite_name;
               eo-ont:launchDate ?launchDate.
    BIND(YEAR(?launchDate) AS ?year)
}
order by ?maxRes

4.4. Superior TIR resolution compared to Landsat-9 TIRS

4.4.1. Subqueries

SELECT DISTINCT ?satellite ?satellite_name ?sensor ?sensor_name ?band_tir_res WHERE {
    # Spatial resolution of Landsat-9 TIRS
    {
        SELECT ?tirs_band_res WHERE {
            ?landsat_9 rdf:type eo-ont:Satellite;
                       schema:name ?name;
                       schema:alternateName ?alternateName.
            FILTER(((LCASE(?name)) = "landsat-9"@en) || 
                ((LCASE(?alternateName)) = "landsat-9"@en))
            ?tirs mac:mountedOn ?landsat_9;
                  eo-ont:operationalBand ?tirs_band.
            ?tirs_band eo-ont:wavebandRegion eor:waveband_region.TIR ;
                       eo-ont:operation ?tirs_band_op.
            ?tirs_band_op eo-ont:horizontalResolution ?tirs_band_res.
        }
    }
    # Spatial resolution for all thermal infrared
    ?satellite rdf:type eo-ont:Satellite;
               schema:name ?satellite_name.
    ?sensor mac:mountedOn ?satellite;
            schema:name ?sensor_name;
            eo-ont:operationalBand ?band.
    ?band eo-ont:wavebandRegion eor:waveband_region.TIR ;
          eo-ont:operation ?band_tir_op.
    ?band_tir_op eo-ont:horizontalResolution ?band_tir_res.
    FILTER(?band_tir_res <= ?tirs_band_res)
}

4.4.2. Other

select DISTINCT ?satellite ?satellite_name ?sensor ?sensor_name ?waveband_tir_resolution where {
    ?l8 a eo-ont:Satellite ;
        schema:name "LANDSAT 8"@en .
    ?l8_ins mac:mountedOn ?l8 ;
            eo-ont:operationalBand ?l8_ins_band .
    ?l8_ins_band eo-ont:wavebandRegion eor:waveband_region.TIR ;
                 eo-ont:operation ?l8_ins_band_mode .
    ?l8_ins_band_mode eo-ont:horizontalResolution ?l8_tir_resolution .
    ?satellite a eo-ont:Satellite ;
               schema:name ?satellite_name .
    ?sensor mac:mountedOn ?satellite ;
            schema:name ?sensor_name ;
            eo-ont:operationalBand ?waveband .
    ?waveband eo-ont:wavebandRegion eor:waveband_region.TIR ;
              eo-ont:operation ?waveband_mode .
    ?waveband_mode eo-ont:horizontalResolution ?waveband_tir_resolution .
    FILTER (?waveband_tir_resolution <= ?l8_tir_resolution) .
}