Class: RDF::StrictVocabulary

Inherits:
Vocabulary show all
Defined in:
vendor/bundler/ruby/2.5.0/bundler/gems/rdf-491e9bb5b443/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

Class Method Summary collapse

Methods inherited from Vocabulary

#[], __prefix__, _orig_each, camelize, each, each_statement, enum_for, expand_pname, find, find_term, from_graph, imported_from, imports, #initialize, #inspect, inspect, list, #method_missing, method_missing, ontology, properties, property, to_html, to_iri, #to_s, to_s, #to_uri, to_uri, value_to_html

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



1172
1173
1174
1175
1176
# File 'vendor/bundler/ruby/2.5.0/bundler/gems/rdf-491e9bb5b443/lib/rdf/vocabulary.rb', line 1172

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

.strict?Boolean

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

Returns:

  • (Boolean)


1164
# File 'vendor/bundler/ruby/2.5.0/bundler/gems/rdf-491e9bb5b443/lib/rdf/vocabulary.rb', line 1164

def strict?; true; end