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
271 272 273 274 275 276 277 278 279 280 |
# File 'lib/json/ld/utils.rb', line 271 def get_sym(old = "") old = old.to_s.sub(/_:/, '') if old && key?(old) self[old] elsif !old.empty? self[old] = RDF::Node.new.to_unique_base[2..] else RDF::Node.new.to_unique_base[2..] end end |