Class: RDF::StrictVocabulary

Inherits:
Vocabulary show all
Defined in:
vendor/bundler/ruby/3.3.0/bundler/gems/rdf-cfdeb1f47544/lib/rdf/vocabulary.rb

Overview

Represents an RDF Vocabulary. The difference from Vocabulary is that that every concept in the vocabulary is required to be declared. To assist in this, an existing RDF representation of the vocabulary can be loaded as the basis for concepts being available

Direct Known Subclasses

OWL, RDFS, RDFV, Tabular::CSVW, Vocab::SHACL

Class Method Summary collapse

Methods inherited from Vocabulary

#[], __prefix__, __prefix__=, _orig_each, _orig_from_sym, camelize, each, each_statement, enum_for, expand_pname, find, find_term, from_graph, from_sym, imported_from, imports, #initialize, #inspect, inspect, limit_vocabs, list, #method_missing, method_missing, ontology, properties, property, register, to_html, to_iri, to_jsonld, #to_s, to_s, to_ttl, to_uri, #to_uri, value_to_html, vocab_map

Constructor Details

This class inherits a constructor from RDF::Vocabulary

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RDF::Vocabulary

Class Method Details

.[](name) ⇒ RDF::URI

Returns the URI for the term property in this vocabulary.

Parameters:

Returns:

Raises:

  • (KeyError)

    if property not defined in vocabulary



1325
1326
1327
1328
1329
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-cfdeb1f47544/lib/rdf/vocabulary.rb', line 1325

def [](name)
  props.fetch(name.to_sym)
rescue KeyError
  raise KeyError, "#{name.inspect} not found in vocabulary #{self.__name__}"
end

.strict?Boolean

Is this a strict vocabulary, or a liberal vocabulary allowing arbitrary properties?

Returns:

  • (Boolean)


1317
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-cfdeb1f47544/lib/rdf/vocabulary.rb', line 1317

def strict?; true; end