We have now seen that en:Wikipedia dont think the quality of Europeana is good enough and dont want to link Europeana see
Question A: is there an API for creating new Entities?
Question B: if not can someone create those so we get a Showcase how a good upload to Europeana is done?
Regards
Magnus Sälgö
Stockholm, Sweden
Doing Wikidata stuff
Python code that retrieves the list from Wikidata
# pip install sparqlwrapper
from SPARQLWrapper import SPARQLWrapper, JSON
query = """SELECT ?sculptors (REPLACE(STR(?sculptors),".*Q","Q") AS ?WD) ?sculptorsLabel ?birth ?died ?sculptorsDescription WHERE {
VALUES ?sculptors { wd:Q4936564 wd:Q5908201 wd:Q4938072 wd:Q15711231 wd:Q4966391 wd:Q4939597 wd:Q16596588
wd:Q4952238 wd:Q2827030 wd:Q4970016 wd:Q4970058 wd:Q4935445 wd:Q20156198 wd:Q4981273
wd:Q4967393 wd:Q4970058 wd:Q4942419 wd:Q4948953 wd:Q4941548 wd:Q23989466 wd:Q18274990
wd:Q4953594 wd:Q23989466 wd:Q4976986 wd:Q4972692 wd:Q517138 wd:Q22338471 wd:Q4960550
wd:Q23989419 wd:Q48704874 wd:Q27902203 }
MINUS {?sculptors wdt:P7704 ?EuropeanaID}
?sculptors wdt:P569 ?birthDate.
?sculptors wdt:P570 ?diedDate
BIND (SUBSTR(CONCAT("0",STR(DAY(?diedDate))),STRLEN(STR(DAY(?diedDate))),2) AS ?diedDay)
BIND (SUBSTR(CONCAT("0",STR(MONTH(?diedDate))),STRLEN(STR(MONTH(?diedDate))),2) AS ?diedMonth)
BIND (CONCAT(STR(YEAR(?diedDate)),"-",?diedMonth,"-",?diedDay) AS ?died)
BIND (SUBSTR(CONCAT("0",STR(DAY(?birthDate))),STRLEN(STR(DAY(?birthDate))),2) AS ?birthDay)
BIND (SUBSTR(CONCAT("0",STR(MONTH(?birthDate))),STRLEN(STR(MONTH(?birthDate))),2) AS ?birthMonth)
BIND (CONCAT(STR(YEAR(?birthDate)),"-",?birthMonth,"-",?birthDay) AS ?birth)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,sv". }
} group by ?sculptors ?sculptorsLabel ?sculptorsDescription ?birth ?died
order by ?sculptorsLabel"""
def get_results(endpoint_url, query):
sparql = SPARQLWrapper(endpoint_url)
sparql.setQuery(query)
sparql.setReturnFormat(JSON)
return sparql.query().convert()
results = get_results(endpoint_url, query)
for result in results["results"]["bindings"]:
print(result)
// add the API for creating objects here