Anonymous

Main Page: Difference between revisions

From geokb
1,243 bytes removed ,  10 months ago
Line 202: Line 202:


* [[EntitySchema:E2|Organization EntitySchema]]
* [[EntitySchema:E2|Organization EntitySchema]]
 
* [[Item:Q50862|USGS Organizations]]
The following query retrieves information on organization entities that are characterized as "part of" the [[Item:Q44210|U.S. Geological Survey]]. Because we often need to lookup an organization based on imperfect identifiers like name and url variations, this query may return multiple records for each entity with different URLs and aliases. This allows us to efficiently figure out if we already have a label or URL variant included for linking purposes. (This is still a work in progress as we have an incomplete record of USGS organizations of interest and are working to harmonize across several sources.)
 
<sparql tryit=1>
PREFIX wd: <https://geokb.wikibase.cloud/entity/>
PREFIX wdt: <https://geokb.wikibase.cloud/prop/direct/>
 
SELECT ?item ?itemLabel ?item_alt_label ?instance_ofLabel ?url
WHERE {
  ?org_types wdt:P2 wd:Q50862 . # Gets subclasses of USGS organization
  ?item wdt:P1 ?org_types . # Gets items in those classes
  ?item wdt:P1 ?instance_of . # Gets the individual instance of classification
  OPTIONAL {
    ?item skos:altLabel ?item_alt_label .
    FILTER (lang(?item_alt_label)='en')
  }
  OPTIONAL {
    ?item wdt:P31 ?url . # Get all reference URLs when available
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
</sparql>


== People ==
== People ==