Class: RDF::Tabular::Row::Cell
- Defined in:
- vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb
Overview
Class for returning values
Instance Attribute Summary collapse
-
#aboutUrl ⇒ Object
Returns the value of attribute aboutUrl.
-
#column ⇒ Object
Returns the value of attribute column.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#propertyUrl ⇒ Object
Returns the value of attribute propertyUrl.
-
#row ⇒ Object
Returns the value of attribute row.
-
#stringValue ⇒ Object
Returns the value of attribute stringValue.
-
#table ⇒ Object
Returns the value of attribute table.
-
#value ⇒ Object
Returns the value of attribute value.
-
#valueUrl ⇒ Object
Returns the value of attribute valueUrl.
Instance Method Summary collapse
-
#id ⇒ RDF::URI
Identifier for this Cell, as an RFC7111 fragment.
- #inspect ⇒ Object
- #set_urls(mapped_values, decode_uri) ⇒ Object
-
#to_atd ⇒ Object
Return Annotated Cell representation.
- #to_s ⇒ Object
- #valid? ⇒ Boolean
Instance Attribute Details
#aboutUrl ⇒ Object
Returns the value of attribute aboutUrl
1957 1958 1959 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1957 def aboutUrl @aboutUrl end |
#column ⇒ Object
Returns the value of attribute column
1957 1958 1959 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1957 def column @column end |
#errors ⇒ Object
Returns the value of attribute errors
1957 1958 1959 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1957 def errors @errors end |
#propertyUrl ⇒ Object
Returns the value of attribute propertyUrl
1957 1958 1959 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1957 def propertyUrl @propertyUrl end |
#row ⇒ Object
Returns the value of attribute row
1957 1958 1959 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1957 def row @row end |
#stringValue ⇒ Object
Returns the value of attribute stringValue
1957 1958 1959 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1957 def stringValue @stringValue end |
#table ⇒ Object
Returns the value of attribute table
1957 1958 1959 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1957 def table @table end |
#value ⇒ Object
Returns the value of attribute value
1957 1958 1959 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1957 def value @value end |
#valueUrl ⇒ Object
Returns the value of attribute valueUrl
1957 1958 1959 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1957 def valueUrl @valueUrl end |
Instance Method Details
#id ⇒ RDF::URI
Identifier for this Cell, as an RFC7111 fragment
1978 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1978 def id; table.url + "#cell=#{self.row.sourceNumber},#{self.column.sourceNumber}"; end |
#inspect ⇒ Object
1994 1995 1996 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1994 def inspect self.class.name + to_atd.inspect end |
#set_urls(mapped_values, decode_uri) ⇒ Object
1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1958 def set_urls(mapped_values, decode_uri) %w(aboutUrl propertyUrl valueUrl).each do |prop| # If the cell value is nil, and it is not a virtual column next if prop == "valueUrl" && value.nil? && !column.virtual if v = column.send(prop.to_sym) t = Addressable::Template.new(v) mapped = t.(mapped_values).to_s mapped = RDF::URI.decode(mapped) if decode_uri # FIXME: don't expand here, do it in CSV2RDF url = row.context.(mapped, documentRelative: true) self.send("#{prop}=".to_sym, url) end end end |
#to_atd ⇒ Object
Return Annotated Cell representation
1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1981 def to_atd { "@id" => id.to_s, "@type" => "Cell", "column" => column.id.to_s, "row" => row.id.to_s, "stringValue" => self.stringValue, "table" => (table.id.to_s if table.id), "value" => table.context.(nil, self.value), "errors" => self.errors }.delete_if {|k,v| Array(v).empty?} end |
#to_s ⇒ Object
1974 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1974 def to_s; value.to_s; end |
#valid? ⇒ Boolean
1973 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-tabular-52804f52e930/lib/rdf/tabular/metadata.rb', line 1973 def valid?; Array(errors).empty?; end |