From 70ead0cc4ae20dbad08f75057f0941a233eaa295 Mon Sep 17 00:00:00 2001 From: klacointe Date: Wed, 24 Sep 2014 10:05:02 +0200 Subject: [PATCH] =?UTF-8?q?Handle=20snaktype:=20=C2=ABsomevalue=C2=BB.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From http://www.wikidata.org/wiki/Wikidata:Glossary/en#Property « Unknown value is a marker for when there is some value but the exact value is not known for the property. "Some value" means that there is nothing known for the value except that it should exist and not imply a negation of the claim (example: if the date of a human's death is completely unknown the item would receive this marker for date of death (P570), denoting that the human is, in fact, dead — however, with the date of death being unknown). » --- lib/wikidata/snak.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/wikidata/snak.rb b/lib/wikidata/snak.rb index 2ffe44a..f5f2f8a 100644 --- a/lib/wikidata/snak.rb +++ b/lib/wikidata/snak.rb @@ -11,7 +11,9 @@ def property def value @value ||= begin - if datavalue['type'] == "wikibase-entityid" + if snaktype == "somevalue" + Wikidata::DataValues::String.new({string: "Unknown"}) + elsif datavalue['type'] == "wikibase-entityid" Wikidata::DataValues::Entity.new(datavalue.value) elsif datavalue['type'] == "time" Wikidata::DataValues::Time.new(datavalue.value)