Class: Commons::Integrity::Check::WikidataIdentifiers

Inherits:
Base
  • Object
show all
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

Methods inherited from Base

#initialize, moniker

Constructor Details

This class inherits a constructor from Commons::Integrity::Check::Base

Instance Method Details

#errorsArray<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