Class: RDF::Literal

Inherits:
Object
  • Object
show all
Defined in:
lib/json/ld/extensions.rb

Instance Method Summary collapse

Instance Method Details

#valid_extended?Boolean

Validate extended RDF

Returns:

  • (Boolean)


37
38
39
40
41
42
# File 'lib/json/ld/extensions.rb', line 37

def valid_extended?
  return false if language? && language.to_s !~ /^[a-zA-Z]+(-[a-zA-Z0-9]+)*$/
  return false if datatype? && datatype.invalid?

  value.is_a?(String)
end