Method: RDF::Vocabulary::Writer#initialize

Defined in:
lib/rdf/vocab/writer.rb

#initialize(output = $stdout, base_uri:, **options) {|writer| ... } ⇒ Writer

Initializes the writer.

Parameters:

  • output (IO, File) (defaults to: $stdout)

    the output stream

  • base_uri (RDF::URI)

    URI of this vocabulary

  • options (Hash{Symbol => Object})

    ({})

    any additional options. See Writer#initialize

Options Hash (**options):

  • :class_name (String)

    Class name for this vocabulary

  • :module_name (String) — default: "RDF"

    Module name for this vocabulary

  • extra (Hash)

    Extra properties to add to the output (programatic only)

  • patch (String)

    An LD Patch to run against the graph before writing

  • strict (Boolean) — default: false

    Create an RDF::StrictVocabulary instead of an RDF::Vocabulary

Yields:

  • (writer)

    ‘self`

Yield Parameters:

Yield Returns:

  • (void)


136
137
138
139
140
# File 'lib/rdf/vocab/writer.rb', line 136

def initialize(output = $stdout, base_uri:, **options, &block)
  @graph = RDF::Repository.new
  options.merge(base_uri: base_uri)
  super
end