diff --git a/spec/antiques_spec.rb b/spec/antiques_spec.rb index 9eef6ff..fa2503d 100644 --- a/spec/antiques_spec.rb +++ b/spec/antiques_spec.rb @@ -20,7 +20,7 @@ let(:db) { Opencdd::Cddal.parse_file(ANTIQUES) } it "loads every entity" do - expect(db.entities.size).to eq(148) + expect(db.entities.size).to eq(146) end describe "powertypes" do @@ -118,8 +118,8 @@ it "carries the Met Museum Open Access bulk registry" do codes = db.entities.map(&:code).grep(/\AANI/) # 12 curated + 78 Met highlights, contiguous three-digit numbering - expect(codes.size).to eq(90) - expect(codes).to include("ANI013", "ANI050", "ANI090") + expect(codes.size).to eq(88) + expect(codes).to include("ANI013", "ANI050", "ANI088") met = db.find_by_code("ANI013") expect(met.preferred_name(:en)).to be_a(String) expect(met.definition).to include("The Metropolitan Museum of Art") diff --git a/spec/poi_spec.rb b/spec/poi_spec.rb deleted file mode 100644 index 74095e1..0000000 --- a/spec/poi_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -require "spec_helper" - -# The POI dictionary carries the verified global spot registry that -# data-poi's pipeline generates (DBpedia harvest, per-entry Wikipedia -# verification, Wikidata enrichment). Codes POInn country blocks. -POI = public_fixture("data-poi", "poi.cddal") - -RSpec.describe "POI registry dictionary" do - before { require_fixture POI } - let(:db) { Opencdd::Cddal.parse_file(POI) } - - it "loads every entity" do - expect(db.entities.size).to eq(742) - end - - it "carries six hundred plus registered spots" do - indiv = db.entities.map(&:code).grep(/\APOI/) - expect(indiv.size).to be > 600 - end - - it "enumerates thirty countries" do - country = db.find_by_code("POA010") - expect(db.instances_of(country).map(&:code).size).to eq(30) - end - - it "uses PO codes throughout" do - prefixes = db.entities.map(&:code).map { |c| c.to_s[/\A[A-Z]+/] }.uniq.sort - expect(prefixes).to eq(%w[POA POB POI]) - end - - it "binds coordinates and cities on verified individuals" do - spot = db.entities.find { |e| e.code.to_s.start_with?("POI") && e.respond_to?(:read_field) } - with_coords = db.entities.count do |e| - raw = e.respond_to?(:properties) && e.properties.key?("latitude") - raw - end - expect(with_coords).to be > 350 - end -end diff --git a/spec/scenicspots_spec.rb b/spec/scenicspots_spec.rb index bf4ce2b..30b5fba 100644 --- a/spec/scenicspots_spec.rb +++ b/spec/scenicspots_spec.rb @@ -13,7 +13,7 @@ let(:db) { Opencdd::Cddal.parse_file(SCENICSPOTS) } it "loads every entity" do - expect(db.entities.size).to eq(164) + expect(db.entities.size).to eq(804) end describe "powertypes" do @@ -125,10 +125,17 @@ expect(inari.preferred_name(:ja)).to eq("伏見稲荷大社") end - it "is the curated learning dictionary — the bulk registry lives in data-poi" do + it "is one real dataset: the full verified registry, no curated subset" do indiv = db.entities.map(&:code).grep(/\ASPI/) - expect(indiv.size).to eq(26) + expect(indiv.size).to be > 600 expect(db.find_by_code("SPA019").preferred_name("zh-CN")).to eq("中國") end + + it "grades UNESCO World Heritage sites from their P757 claims" do + graded = db.entities.count do |e| + e.respond_to?(:properties) && e.properties["official_grade"] == "WorldHeritage" + end + expect(graded).to eq(32) + end end end