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__, 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


1314
1315
1316
1317
1318
# File 'lib/rdf/vocabulary.rb', line 1314

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)

1306
# File 'lib/rdf/vocabulary.rb', line 1306

def strict?; true; end