Class: RDF::N3::Format
- Defined in:
- vendor/bundler/ruby/3.3.0/bundler/gems/rdf-n3-a6ef81a7e1ce/lib/rdf/n3/format.rb
Overview
RDFa format specification.
Class Method Summary collapse
-
.cli_commands ⇒ Hash{Symbol => Hash}
Hash of CLI commands appropriate for this format.
-
.symbols ⇒ Object
Symbols which may be used to lookup this format.
Methods inherited from Format
accept_type, accept_types, content_encoding, content_type, content_types, detect, each, file_extension, file_extensions, for, name, reader, reader_symbols, reader_types, require, to_sym, uri, uris, writer, writer_symbols, writer_types
Class Method Details
.cli_commands ⇒ Hash{Symbol => Hash}
Hash of CLI commands appropriate for this format
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-n3-a6ef81a7e1ce/lib/rdf/n3/format.rb', line 37 def self.cli_commands { reason: { description: "Reason over formulae.", help: "reason [--think] file\nPerform Notation-3 reasoning.", parse: false, # Only shows when input and output format set filter: {format: :n3}, repository: RDF::N3::Repository.new, lambda: ->(argv, **) do repository = [:repository] result_repo = RDF::N3::Repository.new RDF::CLI.parse(argv, format: :n3, list_terms: true, **) do |reader| reasoner = RDF::N3::Reasoner.new(reader, **) reasoner.reason!(**) if [:conclusions] result_repo << reasoner.conclusions elsif [:data] result_repo << reasoner.data else result_repo << reasoner end end # Replace input repository with results repository.clear! repository << result_repo end, options: [ RDF::CLI::Option.new( symbol: :conclusions, datatype: TrueClass, control: :checkbox, use: :optional, on: ["--conclusions"], description: "Exclude formulae and statements in the original dataset."), RDF::CLI::Option.new( symbol: :data, datatype: TrueClass, control: :checkbox, use: :optional, on: ["--data"], description: "Only results from default graph, excluding formulae or variables."), RDF::CLI::Option.new( symbol: :strings, datatype: TrueClass, control: :checkbox, use: :optional, on: ["--strings"], description: "Returns the concatenated strings from log:outputString."), RDF::CLI::Option.new( symbol: :think, datatype: TrueClass, control: :checkbox, use: :optional, on: ["--think"], description: "Continuously execute until results stop growing."), ] }, } end |
.symbols ⇒ Object
Symbols which may be used to lookup this format
30 31 32 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-n3-a6ef81a7e1ce/lib/rdf/n3/format.rb', line 30 def self.symbols [:n3, :notation3] end |