ICOS-Carbon-Portal / meta

ICOS Carbon Portal metadata service
GNU General Public License v3.0
3 stars 1 forks source link

[sparql] Allow for fast search of incompletely-uploaded data objects #152

Closed mirzov closed 11 months ago

mirzov commented 2 years ago

Query that needs to work "magically" for this:

prefix cpmeta: <http://meta.icos-cp.eu/ontologies/cpmeta/>
prefix prov: <http://www.w3.org/ns/prov#>

select ?dobj ?submTime where{
    ?dobj cpmeta:hasName ?fileName .
    ?dobj cpmeta:hasObjectSpec ?spec .
    FILTER NOT EXISTS { ?dobj cpmeta:wasSubmittedBy/prov:endedAtTime [] }
    ?dobj cpmeta:wasSubmittedBy/prov:startedAtTime ?submTime
}
order by desc(?submTime)
limit 10

The crucial part is the FILTER NOT EXISTS line. Current workaround is to use FILTER NOT EXISTS {?dobj cpmeta:hasSizeInBytes []} instead.