Class: Commons::Integrity::Check::WikidataIdentifiers
- Defined in:
- lib/commons/integrity/check/wikidata_identifiers.rb
Overview
Check that any values in a “wikidata” column look like valid IDs
Given a CSV file with a column of Wikidata identifiers, this Check will ensure that all the values in that column look like valid identifiers (i.e. are Q-numbers). It does not check that they are actually valid IDs: only that they are of the correct form.
Configuration Options
-
column_name: the column containing the IDs (default: “wikidata”)
-
column_case: “fixed” if the column_name must be exactly as specified (default: “any”)
Instance Method Summary collapse
-
#errors ⇒ Array<Error>
Errors will be in the category ‘:wikidata_id_format`.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Commons::Integrity::Check::Base
Instance Method Details
#errors ⇒ Array<Error>
Errors will be in the category ‘:wikidata_id_format`
23 24 25 |
# File 'lib/commons/integrity/check/wikidata_identifiers.rb', line 23 def errors problematic_values.map { |val| error(wikidata_id_format: "Invalid wikidata ID: #{val}") } end |