From 0b10bde4472c146f6336d3308616d7a7f7c8d82d Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Wed, 25 Sep 2019 13:23:07 +0100 Subject: [PATCH] Add helper function --- depicts/wdqs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/depicts/wdqs.py b/depicts/wdqs.py index 0be6753..ee4224f 100644 --- a/depicts/wdqs.py +++ b/depicts/wdqs.py @@ -16,6 +16,10 @@ def row_id(row): def get_row_value(row, field): return row[field]['value'] if field in row else None +def get_row_text(row, field): + if field in row and 'xml:lang' in row[field]: + return row[field]['value'] + def commons_uri_to_filename(uri): return urllib.parse.unquote(utils.drop_start(uri, commons_start))