Sha256: f997d75cc0eecd34d787b44bdbda674d951c36f8d7b27b6da5b5b880fc2fa091

Contents?: true

Size: 1.36 KB

Versions: 11

Compression:

Stored size: 1.36 KB

Contents

# encoding: UTF-8

# Copyright 2011 innoQ Deutschland GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require 'singleton'

# virtual root node
# NB:
# * does not inherit from Concept::Base to avoid being included in all
#   queries based on that class, including indirect ones (e.g. relations)
# * persistence (i.e. a database record) is not required since this is a
#   singleton and merely a static, virtual node
class Concept::SKOS::Scheme
  include Singleton

  def self.rdf_class
    :ConceptScheme
  end

  def self.rdf_namespace
    :skos
  end

  def origin
    :scheme
  end

  def build_rdf_subject(document, controller, &block)
    ns = IqRdf::Namespace.find_namespace_class(self.class.rdf_namespace.to_sym)
    raise "Namespace '#{rdf_namespace}' is not defined in IqRdf document." unless ns
    IqRdf.build_uri(origin, ns.build_uri(self.class.rdf_class), &block)
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
iqvoc-4.0.8 app/models/concept/skos/scheme.rb
iqvoc-4.0.7 app/models/concept/skos/scheme.rb
iqvoc-4.0.6 app/models/concept/skos/scheme.rb
iqvoc-4.0.5 app/models/concept/skos/scheme.rb
iqvoc-4.0.4 app/models/concept/skos/scheme.rb
iqvoc-4.0.3 app/models/concept/skos/scheme.rb
iqvoc-4.0.2 app/models/concept/skos/scheme.rb
iqvoc-4.0.1 app/models/concept/skos/scheme.rb
iqvoc-4.0.0 app/models/concept/skos/scheme.rb
iqvoc-3.5.7 app/models/concept/skos/scheme.rb
iqvoc-3.5.6 app/models/concept/skos/scheme.rb