Wikidata:WikiProject Visual arts/Getty Vocabularies
This sub-project of the WikiProject Visual arts aims to align the information of the Getty Vocabulary Program (Q5554720) and Wikidata. The current approach is to use federated SPARQL queries that compare Getty and Wikidata date and whose results are fed to Wikidata via QuickStatements. There are bots around which work on this as well, so by Multichill dealing with labels, aliases and sex or gender (P21) and by Magnus Magnus dealing with date of birth (P569) and date of death (P570).
Queries edit
The table contains queries that can be easily used as input for QuickStatements.
Property | 1st ref | 1st stmt | Comment |
---|---|---|---|
ULAN entities | |||
place of birth (P19) |
# property P19 statements without any reference
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P19 ("place of birth") statements: add ULAN as first reference'
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
?qid ?P19 ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
?item p:P19 ?statement .
?statement ps:P19 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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 foaf:focus/gvp:biographyPreferred/schema:birthPlace/^foaf:focus ?gettyObject . ?gettyObject xl:prefLabel/xl:literalForm ?gettyObjectTerm. FILTER(LANG(?gettyObjectTerm) = "en") \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
}
?wdObject wdt:P1667 ?tgnID . FILTER(URI(CONCAT("http://vocab.getty.edu/tgn/", ?tgnID)) = ?gettyObject)\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P19)
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("P19" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P19 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:P19 ?statement .
?statement ps:P19 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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 foaf:focus/gvp:biographyPreferred/schema:birthPlace/^foaf:focus ?gettyObject . ?gettyObject xl:prefLabel/xl:literalForm ?gettyObjectTerm. FILTER(LANG(?gettyObjectTerm) = "en") \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:P1667 ?tgnID . FILTER(URI(CONCAT("http://vocab.getty.edu/tgn/", ?tgnID)) = ?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 ?P19)
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("P19" 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", ?P19, "%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
|
# property P19 statements that could be added
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P19 ("place of birth") statements: add with ULAN as reference'
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
?qid ?P19 ?comment ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
FILTER NOT EXISTS { ?item p:P19 [] . }
} LIMIT 2000 } 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 foaf:focus/gvp:biographyPreferred/schema:birthPlace/^foaf:focus ?gettyObject . ?gettyObject xl:prefLabel/xl:literalForm ?gettyObjectTerm. FILTER(LANG(?gettyObjectTerm) = "en") \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
}
?wdObject wdt:P1667 ?tgnID . FILTER(URI(CONCAT("http://vocab.getty.edu/tgn/", ?tgnID)) = ?gettyObject)\u0023
hint:Query hint:optimizer "None" .\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P19)
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("P19" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P19 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:P19 [] . }
} LIMIT 2000 } 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 foaf:focus/gvp:biographyPreferred/schema:birthPlace/^foaf:focus ?gettyObject . ?gettyObject xl:prefLabel/xl:literalForm ?gettyObjectTerm. FILTER(LANG(?gettyObjectTerm) = "en") \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:P1667 ?tgnID . FILTER(URI(CONCAT("http://vocab.getty.edu/tgn/", ?tgnID)) = ?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 ?P19)
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("P19" 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", ?P19, "%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
Q5 only: # property P19 statements that could be added
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P19 ("place of birth") statements: add with ULAN as reference'
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
?qid ?P19 ?comment ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
?item wdt:P31 wd:Q5.
FILTER NOT EXISTS { ?item p:P19 [] . }
} LIMIT 1200 } 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 foaf:focus/gvp:biographyPreferred/schema:birthPlace/^foaf:focus ?gettyObject . ?gettyObject xl:prefLabel/xl:literalForm ?gettyObjectTerm. FILTER(LANG(?gettyObjectTerm) = "en") \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
}
?wdObject wdt:P1667 ?tgnID . FILTER(URI(CONCAT("http://vocab.getty.edu/tgn/", ?tgnID)) = ?gettyObject)\u0023
hint:Query hint:optimizer "None" .\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P19)
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("P19" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P19 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 .
?item wdt:P31 wd:Q5.
FILTER NOT EXISTS { ?item p:P19 [] . }
} LIMIT 1200 } 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 foaf:focus/gvp:biographyPreferred/schema:birthPlace/^foaf:focus ?gettyObject . ?gettyObject xl:prefLabel/xl:literalForm ?gettyObjectTerm. FILTER(LANG(?gettyObjectTerm) = "en") \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:P1667 ?tgnID . FILTER(URI(CONCAT("http://vocab.getty.edu/tgn/", ?tgnID)) = ?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 ?P19)
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("P19" 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", ?P19, "%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
|
|
place of death (P20) |
# property P20 statements without any reference
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P20 ("place of death") statements: add ULAN as first reference'
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
?qid ?P20 ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
?item p:P20 ?statement .
?statement ps:P20 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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 foaf:focus/gvp:biographyPreferred/schema:deathPlace/^foaf:focus ?gettyObject . ?gettyObject xl:prefLabel/xl:literalForm ?gettyObjectTerm. FILTER(LANG(?gettyObjectTerm) = "en") \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
}
?wdObject wdt:P1667 ?tgnID . FILTER(URI(CONCAT("http://vocab.getty.edu/tgn/", ?tgnID)) = ?gettyObject)\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P20)
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("P20" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P20 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:P20 ?statement .
?statement ps:P20 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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 foaf:focus/gvp:biographyPreferred/schema:deathPlace/^foaf:focus ?gettyObject . ?gettyObject xl:prefLabel/xl:literalForm ?gettyObjectTerm. FILTER(LANG(?gettyObjectTerm) = "en") \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:P1667 ?tgnID . FILTER(URI(CONCAT("http://vocab.getty.edu/tgn/", ?tgnID)) = ?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 ?P20)
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("P20" 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", ?P20, "%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
|
# property P20 statements that could be added
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P20 ("place of death") statements: add with ULAN as reference'
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
?qid ?P20 ?comment ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
FILTER NOT EXISTS { ?item p:P20 [] . }
} LIMIT 2000 } 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 foaf:focus/gvp:biographyPreferred/schema:deathPlace/^foaf:focus ?gettyObject . ?gettyObject xl:prefLabel/xl:literalForm ?gettyObjectTerm. FILTER(LANG(?gettyObjectTerm) = "en") \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
}
?wdObject wdt:P1667 ?tgnID . FILTER(URI(CONCAT("http://vocab.getty.edu/tgn/", ?tgnID)) = ?gettyObject)\u0023
hint:Query hint:optimizer "None" .\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P20)
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("P20" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P20 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:P20 [] . }
} LIMIT 2000 } 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 foaf:focus/gvp:biographyPreferred/schema:deathPlace/^foaf:focus ?gettyObject . ?gettyObject xl:prefLabel/xl:literalForm ?gettyObjectTerm. FILTER(LANG(?gettyObjectTerm) = "en") \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:P1667 ?tgnID . FILTER(URI(CONCAT("http://vocab.getty.edu/tgn/", ?tgnID)) = ?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 ?P20)
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("P20" 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", ?P20, "%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
| |
sex or gender (P21) |
# property P21 statements without any reference
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P21 ("sex or gender") statements: add ULAN as first reference'
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
?qid ?P21 ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
?item p:P21 ?statement .
?statement ps:P21 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 500 } 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 foaf:focus/gvp:biographyPreferred/schema:gender ?gettyObject . \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
BIND(IF(?gettyObject = aat:300189559, wd:Q6581097, IF(?gettyObject = aat:300189557, wd:Q6581072, "")) AS ?wdObjectFromGetty)
}
FILTER(?wdObject = ?wdObjectFromGetty)\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P21)
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("P21" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P21 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:P21 ?statement .
?statement ps:P21 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 500 } 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 foaf:focus/gvp:biographyPreferred/schema:gender ?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. }
BIND(IF(?gettyObject = aat:300189559, wd:Q6581097, IF(?gettyObject = aat:300189557, wd:Q6581072, "")) AS ?wdObjectFromGetty)
}
FILTER(?wdObject = ?wdObjectFromGetty)\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 ?P21)
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("P21" 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", ?P21, "%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
|
Q5 only: # property P21 statements that could be added
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P21 ("sex or gender") statements: add with ULAN as reference'
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
?qid ?P21 ?comment ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
?item wdt:P31 wd:Q5.
FILTER NOT EXISTS { ?item p:P21 [] . }
} LIMIT 200 } 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 foaf:focus/gvp:biographyPreferred/schema:gender ?gettyObject . \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
}
BIND(IF(?gettyObject = aat:300189559, wd:Q6581097, IF(?gettyObject = aat:300189557, wd:Q6581072, "")) AS ?wdObject)
FILTER(?wdObject != "")\u0023
hint:Query hint:optimizer "None" .\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P21)
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("P21" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
|
|
work location (P937) |
# property P937 statements without any reference
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P937 ("work location") statements: add ULAN as first reference'
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
?qid ?P937 ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
?item p:P937 ?statement .
?statement ps:P937 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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 foaf:focus/(gvp:eventPreferred|gvp:eventNonPreferred) ?event.
?event dct:type aat:300393177.
?event schema:location/^foaf:focus ?gettyObject.
?gettyObject xl:prefLabel/xl:literalForm ?gettyObjectTerm. FILTER(LANG(?gettyObjectTerm) = "en") \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
}
?wdObject wdt:P1667 ?tgnID . FILTER(URI(CONCAT("http://vocab.getty.edu/tgn/", ?tgnID)) = ?gettyObject)\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P937)
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("P937" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P937 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:P937 ?statement .
?statement ps:P937 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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 foaf:focus/(gvp:eventPreferred|gvp:eventNonPreferred) ?event.
?event dct:type aat:300393177.
?event schema:location/^foaf:focus ?gettyObject.
?gettyObject xl:prefLabel/xl:literalForm ?gettyObjectTerm. FILTER(LANG(?gettyObjectTerm) = "en") \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:P1667 ?tgnID . FILTER(URI(CONCAT("http://vocab.getty.edu/tgn/", ?tgnID)) = ?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 ?P937)
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("P937" 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", ?P937, "%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
|
| |
occupation (P106) |
# property P106 statements without any reference
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P106 ("occupation") statements: add ULAN as first reference'
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
?qid ?P106 ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
?item p:P106 ?statement .
?statement ps:P106 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 8000 } 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:agentTypePreferred|gvp:agentTypeNonPreferred) ?gettyObject . \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. }
}
?wdObject wdt:P1014 ?aatID . FILTER(URI(CONCAT("http://vocab.getty.edu/aat/", ?aatID)) = ?gettyObject)\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P106)
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("P106" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P106 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:P106 ?statement .
?statement ps:P106 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 1000 } 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:agentTypePreferred|gvp:agentTypeNonPreferred) ?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:P1014 ?aatID . FILTER(URI(CONCAT("http://vocab.getty.edu/aat/", ?aatID)) = ?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 ?P106)
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("P106" 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", ?P106, "%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
|
GVP-side type checked (and remove less specific gvp:agentTypePreferred here!! (cf. GVP doc)) # property P106 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 .
?item wdt:P31 wd:Q5.
FILTER NOT EXISTS { ?item p:P106 [] . }
} LIMIT 10 } 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:agentTypeNonPreferred ?gettyObject .
{?gettyObject gvp:broaderPreferred* aat:300025485} UNION { FILTER (?gettyObject = aat:300115251)}
#MINUS {?gettyObject gvp:broaderPreferred* aat:300025746 .} \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:P1014 ?aatID . FILTER(URI(CONCAT("http://vocab.getty.edu/aat/", ?aatID)) = ?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 ?P106)
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("P106" 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", ?P106, "%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
|
|
child (P40) |
# property P40 statements without any reference
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P40 ("child") statements: add ULAN as first reference'
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
?qid ?P40 ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
?item p:P40 ?statement .
?statement ps:P40 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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:ulan1512_parent_of ?gettyObject . \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. }
}
?wdObject wdt:P245 ?ulanID . FILTER(URI(CONCAT("http://vocab.getty.edu/ulan/", ?ulanID)) = ?gettyObject)\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P40)
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("P40" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P40 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:P40 ?statement .
?statement ps:P40 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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:ulan1512_parent_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. }
}
?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 ?P40)
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("P40" 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", ?P40, "%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
|
# property P40 statements that could be added
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P40 ("child") statements: add with ULAN as reference'
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
?qid ?P40 ?comment ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
FILTER NOT EXISTS { ?item p:P40 [] . }
} LIMIT 1000 } 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:ulan1512_parent_of ?gettyObject . \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. }
}
?wdObject wdt:P245 ?ulanID . FILTER(URI(CONCAT("http://vocab.getty.edu/ulan/", ?ulanID)) = ?gettyObject)\u0023
hint:Query hint:optimizer "None" .\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P40)
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("P40" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P40 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:P40 [] . }
} LIMIT 1000 } 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:ulan1512_parent_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. }
}
?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 ?P40)
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("P40" 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", ?P40, "%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
|
|
sibling (P3373) |
# property P3373 statements without any reference
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P3373 ("sibling") statements: add ULAN as first reference'
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
?qid ?P3373 ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
?item p:P3373 ?statement .
?statement ps:P3373 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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:ulan1501_sibling_of ?gettyObject . \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. }
}
?wdObject wdt:P245 ?ulanID . FILTER(URI(CONCAT("http://vocab.getty.edu/ulan/", ?ulanID)) = ?gettyObject)\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P3373)
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("P3373" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P3373 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:P3373 ?statement .
?statement ps:P3373 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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:ulan1501_sibling_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. }
}
?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 ?P3373)
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("P3373" 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", ?P3373, "%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
|
# property P3373 statements that could be added
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P3373 ("sibling") statements: add with ULAN as reference'
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
?qid ?P3373 ?comment ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
FILTER NOT EXISTS { ?item p:P3373 [] . }
} LIMIT 300 } 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:ulan1501_sibling_of ?gettyObject . \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. }
}
?wdObject wdt:P245 ?ulanID . FILTER(URI(CONCAT("http://vocab.getty.edu/ulan/", ?ulanID)) = ?gettyObject)\u0023
hint:Query hint:optimizer "None" .\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P3373)
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("P3373" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P3373 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:P3373 [] . }
} LIMIT 300 } 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:ulan1501_sibling_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. }
}
?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 ?P3373)
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("P3373" 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", ?P3373, "%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
|
|
spouse (P26) |
# property P26 statements without any reference
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P26 ("spouse") statements: add ULAN as first reference'
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
?qid ?P26 ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
?item p:P26 ?statement .
?statement ps:P26 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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:ulan1541_spouse_of ?gettyObject . \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. }
}
?wdObject wdt:P245 ?ulanID . FILTER(URI(CONCAT("http://vocab.getty.edu/ulan/", ?ulanID)) = ?gettyObject)\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P26)
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("P26" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P26 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:P26 ?statement .
?statement ps:P26 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 1000 } 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:ulan1541_spouse_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. }
}
?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 ?P26)
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("P26" 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", ?P26, "%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
|
# property P26 statements that could be added
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P26 ("spouse") statements: add with ULAN as reference'
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
?qid ?P26 ?comment ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
FILTER NOT EXISTS { ?item p:P26 [] . }
} LIMIT 1000 } 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:ulan1541_spouse_of ?gettyObject . \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. }
}
?wdObject wdt:P245 ?ulanID . FILTER(URI(CONCAT("http://vocab.getty.edu/ulan/", ?ulanID)) = ?gettyObject)\u0023
hint:Query hint:optimizer "None" .\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P26)
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("P26" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P26 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:P26 [] . }
} LIMIT 1000 } 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:ulan1541_spouse_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. }
}
?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 ?P26)
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("P26" 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", ?P26, "%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
|
|
stepparent (P3448) |
# property P3448 statements without any reference
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P3448 ("stepparent") statements: add ULAN as first reference'
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
?qid ?P3448 ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
?item p:P3448 ?statement .
?statement ps:P3448 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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:ulan1562_step-parent_of ?gettyObject . \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. }
}
?wdObject wdt:P245 ?ulanID . FILTER(URI(CONCAT("http://vocab.getty.edu/ulan/", ?ulanID)) = ?gettyObject)\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P3448)
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("P3448" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P3448 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:P3448 ?statement .
?statement ps:P3448 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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:ulan1562_step-parent_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. }
}
?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 ?P3448)
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("P3448" 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", ?P3448, "%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
|
# property P3448 statements that could be added
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P3448 ("stepparent") statements: add with ULAN as reference'
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
?qid ?P3448 ?comment ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
FILTER NOT EXISTS { ?item p:P3448 [] . }
} 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:ulan1562_step-parent_of ?gettyObject . \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. }
}
?wdObject wdt:P245 ?ulanID . FILTER(URI(CONCAT("http://vocab.getty.edu/ulan/", ?ulanID)) = ?gettyObject)\u0023
hint:Query hint:optimizer "None" .\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P3448)
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("P3448" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P3448 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:P3448 [] . }
} 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:ulan1562_step-parent_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. }
}
?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 ?P3448)
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("P3448" 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", ?P3448, "%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
|
|
family (P53) |
# property P53 statements without any reference
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P53 ("family") statements: add ULAN as first reference'
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
?qid ?P53 ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
?item p:P53 ?statement .
?statement ps:P53 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} 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
}
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
# 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 first reference from [[Q2494649]]. Documentation at [[WD:WPVA/Getty]]. Please report any issues e.g. at [[WT:WPVA/Getty]]!" AS ?comment)\u0023
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P53 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:P53 ?statement .
?statement ps:P53 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} 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
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 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", ?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
|
# property P53 statements that could be added
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P53 ("family") statements: add with ULAN as reference'
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
?qid ?P53 ?comment ?S248 ?s245 ?s577 ?s813 ?commentRef
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
}
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
# 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# 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
|
|
educated at (P69) |
# property P69 statements without any reference
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P69 ("educated at") statements: add ULAN as first reference'
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
?qid ?P69 ?S248 ?s245 ?s577 ?s813 ?commentRef
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
}
OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. }
}
?wdObject wdt:P245 ?ulanID . FILTER(URI(CONCAT("http://vocab.getty.edu/ulan/", ?ulanID)) = ?gettyObject)\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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# 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
|
This does not add dates, they are estimates though.[1]
| |
said to be the same as (P460) |
# property P460 statements without any reference
# with information in ULAN of the Getty Vocabulary Program (GVP)
# output: a table that as CSV is ready for QuickStatements as "CSV with header row"
# after replacing the column headers ("comment" and) "commentRef" with the "#" character
# suggested QS batch name: 'Getty Vocabulary Program (GVP): P460 ("said to be the same as") statements: add ULAN as first reference'
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
?qid ?P460 ?S248 ?s245 ?s577 ?s813 ?commentRef
WITH { SELECT ?item ?gettyHumanURI ?gettySubjectTerm ?wdObject ?gettyObject ?gettyObjectTerm ?gettyID
WHERE {
?item wdt:P245 ?gettyID .
?item p:P460 ?statement .
?statement ps:P460 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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:ulan1005_possibly_identified_with ?gettyObject . \u0023
{ SELECT ?gettyModified WHERE {
?gettySubject dct:modified ?gettyModified .
} ORDER BY DESC(?gettyModified) LIMIT 1
}
OPTIONAL { ?gettyObject gvp:prefLabelGVP/xl:literalForm ?gettyObjectTerm. }
}
?wdObject wdt:P245 ?ulanID . FILTER(URI(CONCAT("http://vocab.getty.edu/ulan/", ?ulanID)) = ?gettyObject)\u0023
# formatting
BIND(SUBSTR(STR(?item), 32) AS ?qid)
BIND(SUBSTR(STR(?wdObject), 32) AS ?P460)
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("P460" 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
BIND(?comment AS ?commentRef)
# copy the comment to the column "commentRef" so that it can be used for
# the edit summaries of the edit adding the statement and the edit adding the reference
}
ORDER BY xsd:integer(SUBSTR(STR(?qid),2))
# LIMIT 500 # I think this isn't needed
# property P460 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:P460 ?statement .
?statement ps:P460 ?wdObject .
FILTER NOT EXISTS { ?statement prov:wasDerivedFrom ?wdRef . }
FILTER NOT EXISTS { ?statement ?someQualProp [] .
[] wikibase:qualifier ?someQualProp . }
} LIMIT 90000 } 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:ulan1005_possibly_identified_with ?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 ?P460)
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("P460" 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", ?P460, "%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
|
||
TGN entities | |||
Template:P | |||
Template:P |
Edits done edit
- test run: "ULAN POB references 1" (should make a better name): batch 2343: EG, QS, old QS
- first bigger run: place of birth (P19) first references (accidentally no name set): batch 4578: EG, QS, old QS
- …
- batch 15516: EG
- batch 15521
- batch 15522
- batch 15523
- more at toollabs:quickstatements/#/batches/Marsupium
Usefulness has been contested in Wikidata:Project chat/Archive/2019/05#Does Wikidata lack a Quality mindset? Sometimes it feels more like a playground for python exercises...?
TGN matching edit
Matching on a specific administrative level can be done with queries like this one (heavy adaption necessary, also to escape timeout):
TODO edit
- use Template:P instead of Template:P
- introduce Template:P checks:
- compare coords (can get complex constraint violation
- compare names: labels, etc.
- check Wikidata:Database reports/Constraint violations/P1667
add comments Help:QuickStatements#Comments with a link to WD:WPVA/GettyTemplate:Done- implement more actions than just "add first reference"
- do /reference normalization for the Getty Vocabularies
- ULAN schema:gender "unknown" shouldn't be used probably like at Q29473318#P21
- after adding of references recheck the manual (non-templated) queries from (the version history of) this page, they had 1 (P19) and 2 (P20) results more (inner limit was 50000)
- introduce checking for existing qualifiers! and don't add reference if they aren't sourced as well! I've checked old cases by hand with queries like Template:SPARQL partly implemented: [3], but doesn't work for cases like this where there is the same value twice!
Lessons learnt edit
- for many projects pywikibot will be a more sustainable way, having less restrictions with WDQS timeout, Lua memory usage etc. also copypasting can be reduced. drawbacks: useful built-in features like batches
Ontology mapping edit
- A subject-object relationship in the GVP, as examples here:
- gvp:ulan1532_uncle-aunt_of: Template:SPARQL/sandbox
- gvp:ulan2828_student_at and gvp:ulan1322_school_was: Template:SPARQL/sandbox
- From the database (some have still to be tested since the GVP ontology specification is not that clear; as of 2018-06-10 all ULAN properties have tried to be mapped there): Template:SPARQL
For the GVP ontology see http://vocab.getty.edu/ontology!
Some matches that need special modelling here:
Getty | Wikidata |
---|---|
gvp:ulan1006_formerly_identified_with | Template:P+Template:P with deprecated rank |
gvp:ulan1204_donor_was | Template:P is similar |
gvp:ulan1513_grandchild_of | Template:P with qualifier |
gvp:ulan1514_gandparent_of | " |
gvp:ulan1532_uncle-aunt_of | " |