Class: RDF::StrictVocabulary

Inherits:
Vocabulary show all
Defined in:
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

Class Method Summary collapse

Methods inherited from Vocabulary

#[], __prefix__, __prefix__=, 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_iri, to_s, #to_s, #to_uri, to_uri, 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 '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 'lib/rdf/vocabulary.rb', line 1317

def strict?; true; end