query-be109c9d8d9041f3d104f853cd0a1637

rq turtle/ttl

Place reference query

Caveat: The lack of Wikidata identifiers doesn't necessarily mean Wikidata doesn't know these things exist. It just means they aren't reconciled.

Caveat: The lack of VIAF IDs doesn't necessarily mean Wikidata doesn't know the VIAF IDs. It might only mean the FAST ID isn't reconciled.

Caveat: Multiple VIAF IDs may mean there are duplicates in VIAF or that Wikidata has allowed mismatches. Blame in the latter case can be diagnosed via "References" and/or the "History" tab.

PREFIX fast: http://id.worldcat.org/fast/ PREFIX viaf: http://viaf.org/viaf/ SELECT ?fast ?heading

?viaflookup

?viaflookupDeref ?us_vs_them (GROUP_CONCAT(DISTINCT ?wdfastID;SEPARATOR=" | ") AS ?wdFASTS) (GROUP_CONCAT(DISTINCT ?viaf;SEPARATOR=" | ") AS ?wdVIAFS) (GROUP_CONCAT(DISTINCT ?lccn;SEPARATOR=" | " ) AS ?wdLCCNs) ?wd ?wdLabel ?wdDescription (GROUP_CONCAT(DISTINCT ?typeQ;SEPARATOR=" | ") AS ?types) WHERE { VALUES (?fast ?heading ?viaflookupDeref) { (fast:1204155 "aUnited States." viaf:130168302) (fast:1219920 "aEngland." viaf:142995804) (fast:1204623 "aGreat Britain." viaf:127756949) (fast:1204289 "aFrance." viaf:170385099) (fast:1204333 "aNew York (State) zNew York." viaf:266415900) (fast:1204271 "aEngland zLondon." viaf:261467287) (fast:1204928 "aCalifornia." viaf:147680367) (fast:1245064 "aEurope. " viaf:124144648501726049254) (fast:1210272 "aGermany." viaf:189116956) (fast:1204565 "aItaly." viaf:152361066) (fast:1205283 "aFrance zParis." viaf:158822968) (fast:1244550 "aSouthern States. " viaf:315526862) (fast:1204310 "aCanada." viaf:136600716) (fast:1210280 "aNew York (State)" viaf:146785329) (fast:1204885 "aRome (Empire) " viaf:145348938) (fast:1243255 "aWest United States." viaf:129296938) (fast:1204540 "aCalifornia zLos Angeles." viaf:124053622) (fast:1204304 "aNorth Carolina." viaf:127824921) (fast:1204303 "aSpain." viaf:133609710) (fast:1241913 "aNew England." viaf:236811278) (fast:1206715 "aScotland." viaf:134799371) (fast:1204505 "aWashington (D.C.)" viaf:312739635) (fast:1204270 "aMaine." viaf:151253777) (fast:1208379 "aNew Jersey." viaf:157102040) (fast:1239509 "aAfrica." viaf:127043766) (fast:1205427 "aIreland." viaf:158208597) (fast:1210281 "aSoviet Union." viaf:124251745) (fast:1207312 "aRussia." viaf:247149066396265601002) (fast:1204481 "aCalifornia zSan Francisco." viaf:143700861) (fast:1205012 "aMassachusetts zBoston." viaf:133676669) (fast:1205076 "aOhio zColumbus" viaf:247586192) (fast:1240359 "aMoon zTranquility Base" viaf:315125366) (fast:1333516 "aAlaska zMount Denali" viaf:241195889) (fast:1020337 "aMiddle Earth (Imaginary place)" viaf:NA) (fast:1243528 "aPacific Ocean" viaf:304910555) (fast:1896842 "aTurkey zTroy (Extinct city)" viaf:150894506) }

OPTIONAL { ?wd wdtn:P2163 ?fast . OPTIONAL {?wd wdt:P214 ?viaf} OPTIONAL {?wd wdt:P2163 ?wdfastID} OPTIONAL {?wd wdt:P244 ?lccn} OPTIONAL { ?wd p:P31 [ ps:P31 ?type ]. ?type rdfs:label ?typeLabel . FILTER(LANG(?typeLabel)="en") BIND(CONCAT(?typeLabel, " (", STRAFTER(STR(?type), STR(wd:)), ")") AS ?typeQ) } } OPTIONAL { ?wd wdtn:P214 ?viaflookupDeref . OPTIONAL {?wd wdt:P2163 ?wdfastID} OPTIONAL {?wd wdt:P214 ?viaf} OPTIONAL {?wd wdt:P244 ?lccn} OPTIONAL { ?wd p:P31 [ ps:P31 ?type ]. ?type rdfs:label ?typeLabel . FILTER(LANG(?typeLabel)="en") BIND(CONCAT(?typeLabel, " (", STRAFTER(STR(?type), STR(wd:)), ")") AS ?typeQ) } } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

BIND(STRAFTER(STR(?fast), STR(fast:)) AS ?fastID) BIND(CONCAT("00000000", ?fastID) AS ?fast000ID) BIND(SUBSTR(?fast000ID, STRLEN(?fast000ID)-7) AS ?fstID) BIND (URI(CONCAT("http://viaf.org/viaf/sourceID/FAST|fst", ?fstID)) AS ?viaflookup) } GROUP BY ?fast ?heading ?wd ?wdLabel ?wdDescription ?viaflookup ?viaflookupDeref ?us_vs_them ORDER BY xsd:integer(STRAFTER(STR(?fast), STR(fast:)))

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdtn: <http://www.wikidata.org/prop/direct-normalized/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Place reference query
# Caveat: The lack of Wikidata identifiers doesn't necessarily mean Wikidata doesn't know these things exist. It just means they aren't reconciled.
# Caveat: The lack of VIAF IDs doesn't necessarily mean Wikidata doesn't know the VIAF IDs. It might only mean the FAST ID isn't reconciled.
# Caveat: Multiple VIAF IDs may mean there are duplicates in VIAF or that Wikidata has allowed mismatches. Blame in the latter case can be diagnosed via "References" and/or the "History" tab.
PREFIX fast: <http://id.worldcat.org/fast/>
PREFIX viaf: <http://viaf.org/viaf/>
SELECT ?fast ?heading 
#?viaflookup 
?viaflookupDeref 
?us_vs_them
(GROUP_CONCAT(DISTINCT ?wdfastID;SEPARATOR=" | ") AS ?wdFASTS) 
(GROUP_CONCAT(DISTINCT ?viaf;SEPARATOR=" | ") AS ?wdVIAFS) 
(GROUP_CONCAT(DISTINCT ?lccn;SEPARATOR=" | " ) AS ?wdLCCNs)
?wd ?wdLabel ?wdDescription 
(GROUP_CONCAT(DISTINCT ?typeQ;SEPARATOR=" | ") AS ?types) 
WHERE {
  VALUES (?fast ?heading ?viaflookupDeref) {
    (fast:1204155 "aUnited States." viaf:130168302)
    (fast:1219920 "aEngland." viaf:142995804)
    (fast:1204623 "aGreat Britain." viaf:127756949)
    (fast:1204289 "aFrance." viaf:170385099)
    (fast:1204333 "aNew York (State) zNew York." viaf:266415900)
    (fast:1204271 "aEngland zLondon." viaf:261467287)
    (fast:1204928 "aCalifornia." viaf:147680367)
    (fast:1245064 "aEurope. " viaf:124144648501726049254)
    (fast:1210272 "aGermany." viaf:189116956)
    (fast:1204565 "aItaly." viaf:152361066)
    (fast:1205283 "aFrance zParis." viaf:158822968)
    (fast:1244550 "aSouthern States. " viaf:315526862)
    (fast:1204310 "aCanada." viaf:136600716)
    (fast:1210280 "aNew York (State)" viaf:146785329)
    (fast:1204885 "aRome (Empire) " viaf:145348938)
    (fast:1243255 "aWest United States." viaf:129296938)
    (fast:1204540 "aCalifornia zLos Angeles." viaf:124053622)
    (fast:1204304 "aNorth Carolina." viaf:127824921)
    (fast:1204303 "aSpain." viaf:133609710)
    (fast:1241913 "aNew England." viaf:236811278)
    (fast:1206715 "aScotland." viaf:134799371)
    (fast:1204505 "aWashington (D.C.)" viaf:312739635)
    (fast:1204270 "aMaine." viaf:151253777)
    (fast:1208379 "aNew Jersey." viaf:157102040)
    (fast:1239509 "aAfrica." viaf:127043766)
    (fast:1205427 "aIreland." viaf:158208597)
    (fast:1210281 "aSoviet Union." viaf:124251745)
    (fast:1207312 "aRussia." viaf:247149066396265601002)
    (fast:1204481 "aCalifornia zSan Francisco." viaf:143700861)
    (fast:1205012 "aMassachusetts zBoston." viaf:133676669)
    (fast:1205076 "aOhio zColumbus" viaf:247586192)
    (fast:1240359 "aMoon zTranquility Base" viaf:315125366)
    (fast:1333516 "aAlaska zMount Denali" viaf:241195889)
    (fast:1020337 "aMiddle Earth (Imaginary place)" viaf:NA)
    (fast:1243528 "aPacific Ocean" viaf:304910555)
    (fast:1896842 "aTurkey zTroy (Extinct city)" viaf:150894506)
  }

  OPTIONAL {
    ?wd wdtn:P2163 ?fast .
    OPTIONAL {?wd wdt:P214 ?viaf}
    OPTIONAL {?wd wdt:P2163 ?wdfastID}
    OPTIONAL {?wd wdt:P244 ?lccn}
    OPTIONAL {
      ?wd p:P31 [ ps:P31 ?type ]. 
      ?type rdfs:label ?typeLabel .
      FILTER(LANG(?typeLabel)="en")
      BIND(CONCAT(?typeLabel, " (", STRAFTER(STR(?type), STR(wd:)), ")") AS ?typeQ)
    }
  }
  OPTIONAL {
    ?wd wdtn:P214 ?viaflookupDeref .
    OPTIONAL {?wd wdt:P2163 ?wdfastID}
    OPTIONAL {?wd wdt:P214 ?viaf}
    OPTIONAL {?wd wdt:P244 ?lccn}
    OPTIONAL {
      ?wd p:P31 [ ps:P31 ?type ]. 
      ?type rdfs:label ?typeLabel .
      FILTER(LANG(?typeLabel)="en")
      BIND(CONCAT(?typeLabel, " (", STRAFTER(STR(?type), STR(wd:)), ")") AS ?typeQ)
    }
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

  BIND(STRAFTER(STR(?fast), STR(fast:)) AS ?fastID)
  BIND(CONCAT("00000000", ?fastID) AS ?fast000ID)
  BIND(SUBSTR(?fast000ID, STRLEN(?fast000ID)-7) AS ?fstID)
  BIND (URI(CONCAT("http://viaf.org/viaf/sourceID/FAST|fst", ?fstID)) AS ?viaflookup)
}
GROUP BY ?fast ?heading ?wd ?wdLabel ?wdDescription ?viaflookup ?viaflookupDeref ?us_vs_them
ORDER BY xsd:integer(STRAFTER(STR(?fast), STR(fast:)))

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?fast"):::projected v12("?fast000ID") v11("?fastID") v13("?fstID") v2("?heading"):::projected v8("?lccn"):::projected v9("?type") v4("?typeLabel") v11("?typeQ"):::projected v18("?types") v6("?viaf"):::projected v14("?viaflookup") v3("?viaflookupDeref"):::projected v5("?wd"):::projected v15("?wdFASTS") v17("?wdLCCNs") v16("?wdVIAFS") v7("?wdfastID"):::projected a1((" ")) a2((" ")) c12(["bd:serviceParam"]):::iri c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?fast ?heading ?viaflookupDeref/] bind0-->v2 bind0-->v2 bind0-->v3 bind00([http://id.worldcat.org/fast/1204155]) bind00 --> bind0 bind01(["aUnited States."]) bind01 --> bind0 bind02([http://viaf.org/viaf/130168302]) bind02 --> bind0 bind03([http://id.worldcat.org/fast/1219920]) bind03 --> bind0 bind04(["aEngland."]) bind04 --> bind0 bind05([http://viaf.org/viaf/142995804]) bind05 --> bind0 bind06([http://id.worldcat.org/fast/1204623]) bind06 --> bind0 bind07(["aGreat Britain."]) bind07 --> bind0 bind08([http://viaf.org/viaf/127756949]) bind08 --> bind0 bind09([http://id.worldcat.org/fast/1204289]) bind09 --> bind0 bind010(["aFrance."]) bind010 --> bind0 bind011([http://viaf.org/viaf/170385099]) bind011 --> bind0 bind012([http://id.worldcat.org/fast/1204333]) bind012 --> bind0 bind013(["aNew York (State) zNew York."]) bind013 --> bind0 bind014([http://viaf.org/viaf/266415900]) bind014 --> bind0 bind015([http://id.worldcat.org/fast/1204271]) bind015 --> bind0 bind016(["aEngland zLondon."]) bind016 --> bind0 bind017([http://viaf.org/viaf/261467287]) bind017 --> bind0 bind018([http://id.worldcat.org/fast/1204928]) bind018 --> bind0 bind019(["aCalifornia."]) bind019 --> bind0 bind020([http://viaf.org/viaf/147680367]) bind020 --> bind0 bind021([http://id.worldcat.org/fast/1245064]) bind021 --> bind0 bind022(["aEurope. "]) bind022 --> bind0 bind023([http://viaf.org/viaf/124144648501726049254]) bind023 --> bind0 bind024([http://id.worldcat.org/fast/1210272]) bind024 --> bind0 bind025(["aGermany."]) bind025 --> bind0 bind026([http://viaf.org/viaf/189116956]) bind026 --> bind0 bind027([http://id.worldcat.org/fast/1204565]) bind027 --> bind0 bind028(["aItaly."]) bind028 --> bind0 bind029([http://viaf.org/viaf/152361066]) bind029 --> bind0 bind030([http://id.worldcat.org/fast/1205283]) bind030 --> bind0 bind031(["aFrance zParis."]) bind031 --> bind0 bind032([http://viaf.org/viaf/158822968]) bind032 --> bind0 bind033([http://id.worldcat.org/fast/1244550]) bind033 --> bind0 bind034(["aSouthern States. "]) bind034 --> bind0 bind035([http://viaf.org/viaf/315526862]) bind035 --> bind0 bind036([http://id.worldcat.org/fast/1204310]) bind036 --> bind0 bind037(["aCanada."]) bind037 --> bind0 bind038([http://viaf.org/viaf/136600716]) bind038 --> bind0 bind039([http://id.worldcat.org/fast/1210280]) bind039 --> bind0 bind040(["aNew York (State)"]) bind040 --> bind0 bind041([http://viaf.org/viaf/146785329]) bind041 --> bind0 bind042([http://id.worldcat.org/fast/1204885]) bind042 --> bind0 bind043(["aRome (Empire) "]) bind043 --> bind0 bind044([http://viaf.org/viaf/145348938]) bind044 --> bind0 bind045([http://id.worldcat.org/fast/1243255]) bind045 --> bind0 bind046(["aWest United States."]) bind046 --> bind0 bind047([http://viaf.org/viaf/129296938]) bind047 --> bind0 bind048([http://id.worldcat.org/fast/1204540]) bind048 --> bind0 bind049(["aCalifornia zLos Angeles."]) bind049 --> bind0 bind050([http://viaf.org/viaf/124053622]) bind050 --> bind0 bind051([http://id.worldcat.org/fast/1204304]) bind051 --> bind0 bind052(["aNorth Carolina."]) bind052 --> bind0 bind053([http://viaf.org/viaf/127824921]) bind053 --> bind0 bind054([http://id.worldcat.org/fast/1204303]) bind054 --> bind0 bind055(["aSpain."]) bind055 --> bind0 bind056([http://viaf.org/viaf/133609710]) bind056 --> bind0 bind057([http://id.worldcat.org/fast/1241913]) bind057 --> bind0 bind058(["aNew England."]) bind058 --> bind0 bind059([http://viaf.org/viaf/236811278]) bind059 --> bind0 bind060([http://id.worldcat.org/fast/1206715]) bind060 --> bind0 bind061(["aScotland."]) bind061 --> bind0 bind062([http://viaf.org/viaf/134799371]) bind062 --> bind0 bind063([http://id.worldcat.org/fast/1204505]) bind063 --> bind0 bind064(["aWashington (D.C.)"]) bind064 --> bind0 bind065([http://viaf.org/viaf/312739635]) bind065 --> bind0 bind066([http://id.worldcat.org/fast/1204270]) bind066 --> bind0 bind067(["aMaine."]) bind067 --> bind0 bind068([http://viaf.org/viaf/151253777]) bind068 --> bind0 bind069([http://id.worldcat.org/fast/1208379]) bind069 --> bind0 bind070(["aNew Jersey."]) bind070 --> bind0 bind071([http://viaf.org/viaf/157102040]) bind071 --> bind0 bind072([http://id.worldcat.org/fast/1239509]) bind072 --> bind0 bind073(["aAfrica."]) bind073 --> bind0 bind074([http://viaf.org/viaf/127043766]) bind074 --> bind0 bind075([http://id.worldcat.org/fast/1205427]) bind075 --> bind0 bind076(["aIreland."]) bind076 --> bind0 bind077([http://viaf.org/viaf/158208597]) bind077 --> bind0 bind078([http://id.worldcat.org/fast/1210281]) bind078 --> bind0 bind079(["aSoviet Union."]) bind079 --> bind0 bind080([http://viaf.org/viaf/124251745]) bind080 --> bind0 bind081([http://id.worldcat.org/fast/1207312]) bind081 --> bind0 bind082(["aRussia."]) bind082 --> bind0 bind083([http://viaf.org/viaf/247149066396265601002]) bind083 --> bind0 bind084([http://id.worldcat.org/fast/1204481]) bind084 --> bind0 bind085(["aCalifornia zSan Francisco."]) bind085 --> bind0 bind086([http://viaf.org/viaf/143700861]) bind086 --> bind0 bind087([http://id.worldcat.org/fast/1205012]) bind087 --> bind0 bind088(["aMassachusetts zBoston."]) bind088 --> bind0 bind089([http://viaf.org/viaf/133676669]) bind089 --> bind0 bind090([http://id.worldcat.org/fast/1205076]) bind090 --> bind0 bind091(["aOhio zColumbus"]) bind091 --> bind0 bind092([http://viaf.org/viaf/247586192]) bind092 --> bind0 bind093([http://id.worldcat.org/fast/1240359]) bind093 --> bind0 bind094(["aMoon zTranquility Base"]) bind094 --> bind0 bind095([http://viaf.org/viaf/315125366]) bind095 --> bind0 bind096([http://id.worldcat.org/fast/1333516]) bind096 --> bind0 bind097(["aAlaska zMount Denali"]) bind097 --> bind0 bind098([http://viaf.org/viaf/241195889]) bind098 --> bind0 bind099([http://id.worldcat.org/fast/1020337]) bind099 --> bind0 bind0100(["aMiddle Earth (Imaginary place)"]) bind0100 --> bind0 bind0101([http://viaf.org/viaf/NA]) bind0101 --> bind0 bind0102([http://id.worldcat.org/fast/1243528]) bind0102 --> bind0 bind0103(["aPacific Ocean"]) bind0103 --> bind0 bind0104([http://viaf.org/viaf/304910555]) bind0104 --> bind0 bind0105([http://id.worldcat.org/fast/1896842]) bind0105 --> bind0 bind0106(["aTurkey zTroy (Extinct city)"]) bind0106 --> bind0 bind0107([http://viaf.org/viaf/150894506]) bind0107 --> bind0 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct-normalized/P2163".-> v2 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P214".-> v6 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P2163".-> v7 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P244".-> v8 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; a1 -."p:statement/P31".-> v9 v5 --"p:P31"--> a1 v9 --"rdfs:label"--> v4 bind1[/"concat(?typeLabel,' (',substring-after(str(?type),str('wd:')),')')"/] v4 --o bind1 v9 --o bind1 bind1 --as--o v11 end end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct-normalized/P214".-> v3 subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P2163".-> v7 end subgraph optional7["(optional)"] style optional7 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P214".-> v6 end subgraph optional8["(optional)"] style optional8 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P244".-> v8 end subgraph optional9["(optional)"] style optional9 fill:#bbf,stroke-dasharray: 5 5; a2 -."p:statement/P31".-> v9 v5 --"p:P31"--> a2 v9 --"rdfs:label"--> v4 bind2[/"concat(?typeLabel,' (',substring-after(str(?type),str('wd:')),')')"/] v4 --o bind2 v9 --o bind2 bind2 --as--o v11 end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end bind3[/"substring-after(str(?fast),str(http://id.worldcat.org/fast/))"/] v2 --o bind3 bind3 --as--o v11 bind4[/"concat('00000000',?fastID)"/] v11 --o bind4 bind4 --as--o v12 bind5[/"substring(?fast000ID,string-length(?fast000ID) + '-7^^xsd:integer')"/] v12 --o bind5 bind5 --as--o v13 bind6[/"concat('http://viaf.org/viaf/sourceID/FAST|fst',?fstID)"/] v13 --o bind6 bind6 --as--o v14 bind11[/"?wdfastID"/] v7 --o bind11 bind11 --as--o v15 bind12[/"?viaf"/] v6 --o bind12 bind12 --as--o v16 bind13[/"?lccn"/] v8 --o bind13 bind13 --as--o v17 bind14[/"?typeQ"/] v11 --o bind14 bind14 --as--o v18