Class: JSON::LD::BlankNodeUniqer
- Inherits:
-
BlankNodeMapper
- Object
- Hash
- BlankNodeMapper
- JSON::LD::BlankNodeUniqer
- Defined in:
- vendor/bundler/ruby/3.3.0/bundler/gems/json-ld-f1de87658826/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
Methods inherited from Hash
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 'vendor/bundler/ruby/3.3.0/bundler/gems/json-ld-f1de87658826/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 |