query-aee5bd1190dc29dbf67e63c78475ffa0

rq turtle/ttl

property P69 statements without any reference

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 .

?item p:P69 ?statement .
?statement ps:P69 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
                    [] wikibase:qualifier ?someQualProp . }

} LIMIT 10000 } 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:ulan2828_student_at|gvp:ulan1322_school_was) ?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. }

} ?wdObject wdt:P245 ?ulanID . FILTER(URI(CONCAT("http://vocab.getty.edu/ulan/", ?ulanID)) = ?gettyObject)\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 ?P69) 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("P69" AS ?wdPropPid)
BIND("S248" as ?S248str) BIND("S245" as ?S245str) BIND("S577" as ?S577str) BIND("S813" as ?S813str)\u0023 BIND("/add first reference 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", ?P69, "%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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# property P69 statements without any reference
# 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 .

    ?item p:P69 ?statement .
    ?statement ps:P69 ?wdObject .
    FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
    FILTER NOT EXISTS { ?statement ?someQualProp [] .
                        [] wikibase:qualifier ?someQualProp . }
  } LIMIT 10000 }  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:ulan2828_student_at|gvp:ulan1322_school_was) ?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. }

  }
  ?wdObject wdt:P245 ?ulanID . FILTER(URI(CONCAT("http://vocab.getty.edu/ulan/", ?ulanID)) = ?gettyObject)\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 ?P69)
  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("P69" AS ?wdPropPid)    
  BIND("S248" as ?S248str)
  BIND("S245" as ?S245str)
  BIND("S577" as ?S577str)
  BIND("S813" as ?S813str)\u0023
  BIND("/*add first reference 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", ?P69, "%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; v15("?P69") v26("?QSlink"):::projected v22("?S245str") v16("?S248") v21("?S248str") v23("?S577str") v24("?S813str") v25("?comment") v11("?gettyHumanURI"):::projected v8("?gettyID") v27("?gettyLink") v12("?gettyModified") v3("?gettyObject"):::projected v28("?gettyObjectLink") v14("?gettyObjectTerm"):::projected v10("?gettySubject") v13("?gettySubjectTerm"):::projected v7("?item"):::projected v15("?qid") v17("?s245") v18("?s577") v19("?s813") v5("?someQualProp") v4("?statement") v2("?ulanID") v9("?wdObject"):::projected v20("?wdPropPid") v6("?wdRef") a1((" ")) a2((" ")) a3((" ")) a4((" ")) c15(["bd:serviceParam"]):::iri c17(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["concat('http://vocab.getty.edu/ulan/',?ulanID) = ?gettyObject"]] f0 --> v2 f0 --> v3 f1[["not "]] subgraph f1e0["Exists Clause"] e0v1 -->e0v2--> e0a1 e0a2 --"wikibase:qualifier"--> e0v2 e0v2("?someQualProp"):::projected e0v1("?statement"):::projected e0a1((" ")):::projected e0a2((" ")):::projected end f1--EXISTS--> f1e0 f1 --> v4 f1 --> v5 f1 --> a1 f1 --> a2 f1 --> c3 v4 -->v5--> a1 a2 --"wikibase:qualifier"--> v5 f2[["not "]] subgraph f2e1["Exists Clause"] e1v1 --"prov:wasDerivedFrom"--> e1v2 e1v1("?statement"):::projected e1v2("?wdRef"):::projected end f2--EXISTS--> f2e1 f2 --> v4 f2 --> c4 f2 --> v6 v4 --"prov:wasDerivedFrom"--> v6 v7 --"p:direct/P245"--> v8 v7 --"p:P69"--> v4 v4 --"p:statement/P69"--> v9 bind3[/"concat('http://vocab.getty.edu/ulan/',?gettyID)"/] v8 --o bind3 bind3 --as--o v10 bind4[/"concat('http://vocab.getty.edu/page/ulan/',?gettyID)"/] v8 --o bind4 bind4 --as--o v11 subgraph s1["http://vocab.getty.edu/sparql.json"] style s1 stroke-width:4px; subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v10 --http://vocab.getty.edu/ontology#ulan1322_school_was--> v3 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v10 --http://vocab.getty.edu/ontology#ulan2828_student_at--> v3 end union0r <== or ==> union0l end v10 --"dct:modified"--> v12 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v10 -.http://vocab.getty.edu/ontology#prefLabelGVP.-> a3 a3 --http://www.w3.org/2008/05/skos-xl#literalForm--> v13 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -.http://vocab.getty.edu/ontology#prefLabelGVP.-> a4 a4 --http://www.w3.org/2008/05/skos-xl#literalForm--> v14 end end v9 --"p:direct/P245"--> v2 subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c15 --"wikibase:language"--> c17 end bind5[/"substring(str(?item),'32^^xsd:integer')"/] v7 --o bind5 bind5 --as--o v15 bind6[/"substring(str(?wdObject),'32^^xsd:integer')"/] v9 --o bind6 bind6 --as--o v15 bind7[/"'Q2494649'"/] bind7 --as--o v16 bind8[/"concat(', ?gettyID, ')"/] bind8 --as--o v17 bind9[/"concat('+',substring(str(?gettyModified),'1^^xsd:integer','10^^xsd:integer'),'T00:00:00Z/11')"/] v12 --o bind9 bind9 --as--o v18 bind10[/"concat('+',substring(str(NOW()),'1^^xsd:integer','10^^xsd:integer'),'T00:00:00Z/11')"/] bind10 --as--o v19 bind11[/"'P69'"/] bind11 --as--o v20 bind12[/"'S248'"/] bind12 --as--o v21 bind13[/"'S245'"/] bind13 --as--o v22 bind14[/"'S577'"/] bind14 --as--o v23 bind15[/"'S813'"/] bind15 --as--o v24 bind16[/"'/*add first reference 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;! */'"/] bind16 --as--o v25 bind17[/"concat('https://quickstatements.toolforge.org/index_old.html#v1=',?qid,'%09',?wdPropPid,'%09',?P69,'%09',?S248str,'%09',?S248,'%09',?S245str,'%09',?s245,'%09',?S577str,'%09',?s577,'%09',?S813str,'%09',?s813,?comment)"/] v15 --o bind17 v20 --o bind17 v15 --o bind17 v21 --o bind17 v16 --o bind17 v22 --o bind17 v17 --o bind17 v23 --o bind17 v18 --o bind17 v24 --o bind17 v19 --o bind17 v25 --o bind17 bind17 --as--o v26 bind18[/"concat('#91;',str(?gettyHumanURI),' ',?gettyID,'#93;')"/] v11 --o bind18 v8 --o bind18 bind18 --as--o v27 bind19[/"concat('#91;',str(?gettyObject),'#93;')"/] v3 --o bind19 bind19 --as--o v28