Anonymous

Item talk:Q3: Difference between revisions

From geokb
Line 14: Line 14:


<sparql tryit="1">
<sparql tryit="1">
PREFIX wd: <https://geokb.wikibase.cloud/entity/>
PREFIX wdt: <https://geokb.wikibase.cloud/prop/direct/>
PREFIX p: <https://geokb.wikibase.cloud/prop/>
PREFIX p: <https://geokb.wikibase.cloud/prop/>
PREFIX ps: <https://geokb.wikibase.cloud/prop/statement/>
PREFIX ps: <https://geokb.wikibase.cloud/prop/statement/>
PREFIX pq: <https://geokb.wikibase.cloud/prop/qualifier/>
PREFIX pq: <https://geokb.wikibase.cloud/prop/qualifier/>


SELECT ?item ?itemLabel ?retrieved
SELECT ?item ?itemLabel ?profile_url ?retrieved ?status_code
WHERE {
WHERE {
   ?item p:P31 ?ref_url_statement .
   ?item wdt:P1 wd:Q3 ;
   ?ref_url_statement pq:P151 ?status_code ;
        wdt:P31 ?profile_url ;
                    pq:P139 ?retrieved .
        p:P31 ?ref_url_statement .
   FILTER (STR(?status_code) = '200')
   OPTIONAL {
  FILTER (xsd:dateTime(?retrieved) > xsd:dateTime("2020-01-01T00:00:00Z"))
    ?ref_url_statement pq:P151 ?status_code ;
                      pq:P139 ?retrieved .
   }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
}
</sparql>
</sparql>