Project:SPARQL/examples: Difference between revisions

Line 108: Line 108:


<sparql tryit="1">
<sparql tryit="1">
PREFIX schema: <http://schema.org/>
PREFIX wd: <https://geokb.wikibase.cloud/entity/>
PREFIX wd: <https://geokb.wikibase.cloud/entity/>
PREFIX wdt: <https://geokb.wikibase.cloud/prop/direct/>
PREFIX wdt: <https://geokb.wikibase.cloud/prop/direct/>
Line 113: Line 114:
PREFIX pq: <https://geokb.wikibase.cloud/prop/qualifier/>
PREFIX pq: <https://geokb.wikibase.cloud/prop/qualifier/>


SELECT ?item ?itemLabel ?orcid ?email ?url ?end_time
SELECT ?item ?itemLabel ?orcid ?email ?url ?end_time ?dateModified
WHERE {
WHERE {
   ?item wdt:P107 wd:Q44210 ; # Employed by the USGS
   ?item wdt:P107 wd:Q44210 ; # Employed by the USGS
         p:P107 ?emp_statement .
         p:P107 ?emp_statement ;
        schema:dateModified ?dateModified .
   OPTIONAL {
   OPTIONAL {
     ?emp_statement pq:P61 ?end_time . # Any value here indicates that employment status ended at some point
     ?emp_statement pq:P61 ?end_time . # Any value here indicates that employment status ended at some point