query-27023da699dd71dfbaa8c94c72b98fa8

rq turtle/ttl

External Identifiers used for Companies 19:40, 23 February 2017 (UTC)) talk (Vladimir AlexievPlease help: (removed old link because it was lost in an old archive, and copied below by rjlabs)--Trying to find all External Identifier props used for Companies. This finds all external identifier props: External Identifiers used for CompaniesTrying to find all External Identifier props used for Companies. This finds all external identifier props:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
select ?wd ?lab ?desc {
  ?wd wikibase:directClaim ?wdt.
  ?wdt a owl:DatatypeProperty 
  filter (exists{?wd wdt:P31/wdt:P279* wd:Q19847637} # Unique Identifier
      || exists{?wd wikibase:propertyType wikibase:ExternalId})
  #filter exists {[?wdt []; wdt:P31/wdt:P279* wd:Q783794]} # a Company: causes timeout
  ?wd rdfs:label ?lab filter(lang(?lab)="en")
  optional {?wd schema:description ?desc filter(lang(?desc)="en")}
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?desc"):::projected v1("?lab"):::projected v2("?wd"):::projected v4("?wdt") a1((" ")) c4(["wd:Q19847637"]):::iri c9(["owl:DatatypeProperty"]):::iri c6(["wikibase:ExternalId"]):::iri f0[["?lab = 'en'"]] f0 --> v1 f1[["( || )"]] subgraph f1e0["Exists Clause"] e0v1 --"wdt:P31"--> e0a1 e0a1 --"wdt:P279"--> e0c3 e0v1("?wd"):::projected e0a1((" ")):::projected e0c3(["wd:Q19847637"]):::iri end f1--EXISTS--> f1e0 subgraph f1e1["Exists Clause"] e1v1 --"wikibase:propertyType"--> e1c2 e1v1("?wd"):::projected e1c2(["wikibase:ExternalId"]):::iri end f1--EXISTS--> f1e1 f1 --> v2 f1 --> c2 f1 --> a1 f1 --> c3 f1 --> c4 f1 --> c5 f1 --> c6 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c4 v2 --"wikibase:propertyType"--> c6 v2 --"wikibase:directClaim"--> v4 v4 --"a"--> c9 v2 --"rdfs:label"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."schema:description".-> v3 end