Creating new Europeana Agent ids?

Skip to first unread message

Magnus Sälgö

Jan 28, 2020, 4:17:43 AM1/28/20
to Europeana API forum
We have now seen that en:Wikipedia dont think the quality of Europeana is good enough and dont want to link Europeana see T243764 and status report

The problem I understand we have in Sweden is that museums etc. dont upload items with URI to the agent it match.... they have the match in the system but dont kniow the Europeana agent ID or the Europeana agent id doesnt exist for the person

To get an understanding how this should be done I need 27 new agents for Swedish female sculptors link list 

Those female artists are from a research project at the Swedish Nationalmuseum link

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?

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)
    return sparql.query().convert()

results = get_results(endpoint_url, query)

for result in results["results"]["bindings"]:
   // add the API for creating objects here

Magnus Sälgö

Jan 29, 2020, 11:25:17 AM1/29/20
to Europeana API forum
Gist with the code and the result...

Magnus Sälgö

Feb 10, 2020, 5:09:27 AM2/10/20
to Europeana API forum
ping any possibilities to create new entities? If yes how

Magnus Sälgö

Feb 20, 2020, 9:42:34 PM2/20/20
to Europeana API forum
Reply all
Reply to author
0 new messages