Class: JSON::LD::BlankNodeUniqer
- Inherits:
-
BlankNodeMapper
- Object
- Hash
- BlankNodeMapper
- JSON::LD::BlankNodeUniqer
- Defined in:
- lib/json/ld/utils.rb
Instance Method Summary collapse
-
#get_sym(old = "") ⇒ String
Use the uniquely generated bnodes, rather than a sequence.
Methods inherited from BlankNodeMapper
Instance Method Details
#get_sym(old = "") ⇒ String
Use the uniquely generated bnodes, rather than a sequence
266 267 268 269 270 271 272 273 274 275 |
# File 'lib/json/ld/utils.rb', line 266 def get_sym(old = "") old = old.to_s.sub(/_:/, '') if old && self.has_key?(old) self[old] elsif !old.empty? self[old] = RDF::Node.new.to_unique_base[2..-1] else RDF::Node.new.to_unique_base[2..-1] end end |