query-850c234d8135f098dedfb385c89041f0

rq turtle/ttl

property P53 statements that could be added

with information in ULAN of the Getty Vocabulary Program (GVP)

output: a human-readable table that allows visual checking of the data of Wikidata and the GVP

PREFIX xl: http://www.w3.org/2008/05/skos-xl# PREFIX gvp: http://vocab.getty.edu/ontology# PREFIX aat: http://vocab.getty.edu/aat/

SELECT DISTINCT ?item ?itemLabel ?wdObject ?wdObjectLabel ?gettyHumanURI ?gettySubjectTerm ?gettyObject ?gettyObjectTerm ?QSlink # TODO: needs to be tested WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID WHERE { ?item wdt:P245 ?gettyID .

FILTER NOT EXISTS { ?item p:P53 [] . }

} LIMIT 100000 } AS %items

# now see what Getty says to those statements WHERE { INCLUDE %items BIND(URI(CONCAT("http://vocab.getty.edu/ulan/", ?gettyID)) AS ?gettySubject) BIND(URI(CONCAT("http://vocab.getty.edu/page/ulan/", ?gettyID)) AS ?gettyHumanURI) SERVICE http://vocab.getty.edu/sparql.json { ?gettySubject gvp:ulan1317_member_of ?gettyObject . \u0023 { SELECT ?gettyModified WHERE { ?gettySubject dct:modified ?gettyModified . } ORDER BY DESC(?gettyModified) LIMIT 1 }\u0023 OPTIONAL { ?gettySubject gvp:prefLabelGVP/xl:literalForm ?gettySubjectTerm. } OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. } OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. } } ?wdObject wdt:P31/wdt:P279 wd:Q8436 . ?wdObject wdt:P245 ?ulanID . FILTER(URI(CONCAT("http://vocab.getty.edu/ulan/", ?ulanID)) = ?gettyObject)\u0023 hint:Query hint:optimizer "None" .\u0023 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".}\u0023 # formatting BIND(SUBSTR(STR(?item), 32) AS ?qid) BIND(SUBSTR(STR(?wdObject), 32) AS ?P53) BIND("Q2494649" AS ?S248) BIND(CONCAT("\"", ?gettyID, "\"") AS ?s245) # "publication date" (P577) BIND(CONCAT("+", SUBSTR(STR(?gettyModified),1,10), "T00:00:00Z/11") AS ?s577) # "retrieved" (P813) BIND(CONCAT("+", SUBSTR(STR(NOW()),1,10), "T00:00:00Z/11") AS ?s813)\u0023 # String variables QuickStatements version 1 format BIND("P53" AS ?wdPropPid)
BIND("S248" as ?S248str) BIND("S245" as ?S245str) BIND("S577" as ?S577str) BIND("S813" as ?S813str)\u0023 BIND("/
add data from [[Q2494649]]. Documentation at [[WD:WPVA/Getty]]. Please report any issues e.g. at [[WT:WPVA/Getty]]! */" AS ?comment)\u0023 # Produce QuickStatements version 1 links # cf. https://www.wikidata.org/wiki/Help:QuickStatements#Running_QuickStatements_through_URL: BIND(URI(CONCAT("https://quickstatements.toolforge.org/index_old.html#v1=", ?qid, "%09", ?wdPropPid, "%09", ?P53, "%09", ?S248str, "%09", ?S248, "%09", ?S245str, "%09", ?s245, "%09", ?S577str, "%09", ?s577, "%09", ?S813str, "%09", ?s813, ?comment)) AS ?QSlink) BIND(CONCAT("[", STR(?gettyHumanURI), " ", ?gettyID, "]") AS ?gettyLink) BIND(CONCAT("[", STR(?gettyObject), "]") AS ?gettyObjectLink) } ORDER BY xsd:integer(SUBSTR(STR(?qid),2))

LIMIT 500 # I think this isn't needed

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# property P53 statements that could be added
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a human-readable table that allows visual checking of the data of Wikidata and the GVP

PREFIX xl: <http://www.w3.org/2008/05/skos-xl#>
PREFIX gvp: <http://vocab.getty.edu/ontology#>
PREFIX aat: <http://vocab.getty.edu/aat/>

SELECT DISTINCT
?item ?itemLabel ?wdObject ?wdObjectLabel ?gettyHumanURI ?gettySubjectTerm ?gettyObject ?gettyObjectTerm ?QSlink # TODO: needs to be tested

  # now see what Getty says to those statements
  WHERE {  { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
  WHERE {
    ?item wdt:P245 ?gettyID .

    FILTER NOT EXISTS { ?item p:P53 [] . }
  } LIMIT 100000 }  BIND(URI(CONCAT("http://vocab.getty.edu/ulan/", ?gettyID)) AS ?gettySubject)
  BIND(URI(CONCAT("http://vocab.getty.edu/page/ulan/", ?gettyID)) AS ?gettyHumanURI)
  SERVICE <http://vocab.getty.edu/sparql.json> {
    ?gettySubject gvp:ulan1317_member_of ?gettyObject .  \u0023
    { SELECT ?gettyModified WHERE {
      ?gettySubject dct:modified ?gettyModified .
      } ORDER BY DESC(?gettyModified) LIMIT 1
    }\u0023
    OPTIONAL { ?gettySubject gvp:prefLabelGVP/xl:literalForm ?gettySubjectTerm. }
    OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. }
  OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. }
  }
  ?wdObject wdt:P31/wdt:P279* wd:Q8436 . ?wdObject wdt:P245 ?ulanID . FILTER(URI(CONCAT("http://vocab.getty.edu/ulan/", ?ulanID)) = ?gettyObject)\u0023
  \u0023
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".}\u0023
  # formatting
  BIND(SUBSTR(STR(?item), 32) AS ?qid)
  BIND(SUBSTR(STR(?wdObject), 32) AS ?P53)
  BIND("Q2494649" AS ?S248)
  BIND(CONCAT(""", ?gettyID, """) AS ?s245)
  # "publication date" (P577)
  BIND(CONCAT("+", SUBSTR(STR(?gettyModified),1,10), "T00:00:00Z/11") AS ?s577)
  # "retrieved" (P813)
  BIND(CONCAT("+", SUBSTR(STR(NOW()),1,10), "T00:00:00Z/11") AS ?s813)\u0023
  # String variables QuickStatements version 1 format
  BIND("P53" AS ?wdPropPid)    
  BIND("S248" as ?S248str)
  BIND("S245" as ?S245str)
  BIND("S577" as ?S577str)
  BIND("S813" as ?S813str)\u0023
  BIND("/*add data from [[Q2494649]]. Documentation at [[WD:WPVA/Getty]]. Please report any issues e.g. at [[WT:WPVA/Getty]]! */" AS ?comment)\u0023
  # Produce QuickStatements version 1 links
  # cf. <https://www.wikidata.org/wiki/Help:QuickStatements#Running_QuickStatements_through_URL>:
  BIND(URI(CONCAT("https://quickstatements.toolforge.org/index_old.html#v1=",
                  ?qid, "%09", ?wdPropPid, "%09", ?P53, "%09", ?S248str, "%09", ?S248,
                  "%09", ?S245str,
                  "%09", ?s245,
                  "%09", ?S577str, "%09", ?s577,
                  "%09", ?S813str, "%09", ?s813,
                  ?comment)) AS ?QSlink)
  BIND(CONCAT("[", STR(?gettyHumanURI), " ", ?gettyID, "]") AS ?gettyLink)
  BIND(CONCAT("[", STR(?gettyObject), "]") AS ?gettyObjectLink)
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v12("?P53") v23("?QSlink"):::projected v19("?S245str") v13("?S248") v18("?S248str") v20("?S577str") v21("?S813str") v22("?comment") v7("?gettyHumanURI"):::projected v5("?gettyID") v24("?gettyLink") v8("?gettyModified") v3("?gettyObject"):::projected v25("?gettyObjectLink") v10("?gettyObjectTerm"):::projected v6("?gettySubject") v9("?gettySubjectTerm"):::projected v4("?item"):::projected v12("?qid") v14("?s245") v15("?s577") v16("?s813") v2("?ulanID") v11("?wdObject"):::projected v17("?wdPropPid") a1((" ")) a2((" ")) a3((" ")) a4((" ")) a5((" ")) c14(["bd:serviceParam"]):::iri c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal c12(["wd:Q8436"]):::iri f0[["concat('http://vocab.getty.edu/ulan/',?ulanID) = ?gettyObject"]] f0 --> v2 f0 --> v3 f1[["not "]] subgraph f1e0["Exists Clause"] e0v1 --"p:P53"--> e0a1 e0v1("?item"):::projected e0a1((" ")):::projected end f1--EXISTS--> f1e0 f1 --> v4 f1 --> c3 f1 --> a1 v4 --"p:P53"--> a1 v4 --"p:direct/P245"--> v5 bind2[/"concat('http://vocab.getty.edu/ulan/',?gettyID)"/] v5 --o bind2 bind2 --as--o v6 bind3[/"concat('http://vocab.getty.edu/page/ulan/',?gettyID)"/] v5 --o bind3 bind3 --as--o v7 subgraph s1["http://vocab.getty.edu/sparql.json"] style s1 stroke-width:4px; v6 --http://vocab.getty.edu/ontology#ulan1317_member_of--> v3 v6 --"dct:modified"--> v8 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -.http://vocab.getty.edu/ontology#prefLabelGVP.-> a2 a2 --http://www.w3.org/2008/05/skos-xl#literalForm--> v9 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -.http://vocab.getty.edu/ontology#prefLabelGVP.-> a3 a3 --http://www.w3.org/2008/05/skos-xl#literalForm--> v10 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -.http://vocab.getty.edu/ontology#prefLabelGVP.-> a4 a4 --http://www.w3.org/2008/05/skos-xl#literalForm--> v10 end end v11 --"p:direct/P31"--> a5 a5 --"p:direct/P279"--> c12 v11 --"p:direct/P245"--> v2 subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c14 --"wikibase:language"--> c16 end bind4[/"substring(str(?item),'32^^xsd:integer')"/] v4 --o bind4 bind4 --as--o v12 bind5[/"substring(str(?wdObject),'32^^xsd:integer')"/] v11 --o bind5 bind5 --as--o v12 bind6[/"'Q2494649'"/] bind6 --as--o v13 bind7[/"concat(', ?gettyID, ')"/] bind7 --as--o v14 bind8[/"concat('+',substring(str(?gettyModified),'1^^xsd:integer','10^^xsd:integer'),'T00:00:00Z/11')"/] v8 --o bind8 bind8 --as--o v15 bind9[/"concat('+',substring(str(NOW()),'1^^xsd:integer','10^^xsd:integer'),'T00:00:00Z/11')"/] bind9 --as--o v16 bind10[/"'P53'"/] bind10 --as--o v17 bind11[/"'S248'"/] bind11 --as--o v18 bind12[/"'S245'"/] bind12 --as--o v19 bind13[/"'S577'"/] bind13 --as--o v20 bind14[/"'S813'"/] bind14 --as--o v21 bind15[/"'/*add data from #91;#91;Q2494649#93;#93;. Documentation at #91;#91;WD:WPVA/Getty#93;#93;. Please report any issues e.g. at #91;#91;WT:WPVA/Getty#93;#93;! */'"/] bind15 --as--o v22 bind16[/"concat('https://quickstatements.toolforge.org/index_old.html#v1=',?qid,'%09',?wdPropPid,'%09',?P53,'%09',?S248str,'%09',?S248,'%09',?S245str,'%09',?s245,'%09',?S577str,'%09',?s577,'%09',?S813str,'%09',?s813,?comment)"/] v12 --o bind16 v17 --o bind16 v12 --o bind16 v18 --o bind16 v13 --o bind16 v19 --o bind16 v14 --o bind16 v20 --o bind16 v15 --o bind16 v21 --o bind16 v16 --o bind16 v22 --o bind16 bind16 --as--o v23 bind17[/"concat('#91;',str(?gettyHumanURI),' ',?gettyID,'#93;')"/] v7 --o bind17 v5 --o bind17 bind17 --as--o v24 bind18[/"concat('#91;',str(?gettyObject),'#93;')"/] v3 --o bind18 bind18 --as--o v25