Method: RDF::Reader.options

Defined in:
lib/rdf/reader.rb

.optionsArray<RDF::CLI::Option>

Options suitable for automatic Reader provisioning.

Returns:



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/rdf/reader.rb', line 122

def self.options
  [
    RDF::CLI::Option.new(
      symbol: :base_uri,
      control: :url,
      datatype: RDF::URI,
      on: ["--uri URI"],
      description: "Base URI of input file, defaults to the filename.") {|arg| RDF::URI(arg)},
    RDF::CLI::Option.new(
      symbol: :canonicalize,
      datatype: TrueClass,
      on: ["--canonicalize"],
      control: :checkbox,
      default: false,
      description: "Canonicalize URI/literal forms") {true},
    RDF::CLI::Option.new(
      symbol: :encoding,
      datatype: Encoding,
      control: :text,
      on: ["--encoding ENCODING"],
      description: "The encoding of the input stream.") {|arg| Encoding.find arg},
    RDF::CLI::Option.new(
      symbol: :intern,
      datatype: TrueClass,
      control: :none,
      on: ["--intern"],
      description: "Intern all parsed URIs."),
    RDF::CLI::Option.new(
      symbol: :prefixes,
      datatype: Hash,
      control: :none,
      multiple: true,
      on: ["--prefixes PREFIX:URI,PREFIX:URI"],
      description: "A comma-separated list of prefix:uri pairs.") do |arg|
        arg.split(',').inject({}) do |memo, pfxuri|
          pfx,uri = pfxuri.split(':', 2)
          memo.merge(pfx.to_sym => RDF::URI(uri))
        end
    end,
    RDF::CLI::Option.new(
      symbol: :rdfstar,
      datatype: TrueClass,
      control: :checkbox,
      on: ["--rdfstar"],
      description: "Parse RDF-star for preliminary RDF 1.2 support."),
    RDF::CLI::Option.new(
      symbol: :validate,
      datatype: TrueClass,
      control: :checkbox,
      on: ["--[no-]validate"],
      description: "Validate on input and output."),
    RDF::CLI::Option.new(
      symbol: :verifySSL,
      datatype: TrueClass,
      default: true,
      control: :checkbox,
      on: ["--[no-]verifySSL"],
      description: "Verify SSL results on HTTP GET"),
    RDF::CLI::Option.new(
      symbol: :version,
      control: :select,
      datatype: RDF::Format::VERSIONS, # 1.1, 1.2, or 1.2-basic
      on: ["--version VERSION"],
      description: "RDF Version."),
  ]
end