lib/bio-publisci/dataset/data_cube.rb in bio-publisci-0.0.7 vs lib/bio-publisci/dataset/data_cube.rb in bio-publisci-0.0.8
- old
+ new
@@ -119,11 +119,11 @@
var = sanitize([var]).first
options = defaults().merge(options)
base = options[:base_url]
<<-EOF.unindent
@base <#{base}/ns/dc/> .
- @prefix ns: <#{base}/ns/dataset/#{var}#> .
+ @prefix ns: <#{base}/ns/dataset/#{var}/> .
@prefix qb: <http://purl.org/linked-data/cube#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix prop: <#{base}/dc/properties/> .
@prefix dct: <http://purl.org/dc/terms/> .
@@ -340,11 +340,10 @@
str << " .\n\n"
lists << str
}
-
lists
end
def concept_codes(codes, data, var, options={})
options = defaults().merge(options)
@@ -355,15 +354,16 @@
if code[0] =~ /^<.+>$/
refcode = code[0][1..-2]
else
refcode = code[0]
end
+ # puts data[refcode].uniq
data[refcode].uniq.each_with_index{|value,i|
unless value == nil && !options[:encode_nulls]
concepts << <<-EOF.unindent
#{to_resource(value,options)} a skos:Concept, #{code[2]};
skos:topConceptOf #{code[1]} ;
- skos:prefLabel "#{strip_uri(data[refcode][i])}" ;
+ skos:prefLabel "#{strip_uri(value)}" ;
skos:inScheme #{code[1]} .
EOF
end
}