Class: JSON::LD::BlankNodeMapper
- Defined in:
- vendor/bundler/ruby/3.3.0/bundler/gems/json-ld-f1de87658826/lib/json/ld/utils.rb
Overview
Utility class for mapping old blank node identifiers, or unnamed blank nodes to new identifiers
Direct Known Subclasses
Instance Method Summary collapse
-
#get_name(old = "") ⇒ String
Get a new mapped name for
old
. -
#get_sym(old = "") ⇒ String
Just return a Blank Node based on
old
.
Methods inherited from Hash
Instance Method Details
#get_name(old = "") ⇒ String
Get a new mapped name for old
261 262 263 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/json-ld-f1de87658826/lib/json/ld/utils.rb', line 261 def get_name(old = "") "_:" + get_sym(old) end |
#get_sym(old = "") ⇒ String
Just return a Blank Node based on old
. Manufactures
a node if old
is nil or empty
251 252 253 254 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/json-ld-f1de87658826/lib/json/ld/utils.rb', line 251 def get_sym(old = "") old = RDF::Node.new.to_s if old.to_s.empty? old.to_s.sub(/_:/, '') end |