Class: Concept::SKOS::Base

Inherits:
Base
  • Object
show all
Defined in:
app/models/concept/skos/base.rb

Overview

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.

Instance Method Summary collapse

Methods inherited from Base

#additional_info, #associated_objects_in_editing_mode, broader_tops, #concept_relations_by_id, #concept_relations_by_id=, #concept_relations_by_id_and_rank, edit_link_partial_name, #ensure_a_pref_label_in_the_primary_thesaurus_language, #ensure_distinct_versions, #ensure_exclusive_top_term, #ensure_no_pref_labels_share_the_same_language, #ensure_rooted_top_terms, #ensure_valid_rank_for_ranked_relations, for_dashboard, inline_partial_name, #invalid_with_full_validation?, #labelings_by_text, #labelings_by_text=, #labels_for_labeling_class_and_language, #matches_for_class, new_link_partial_name, #notes_for_class, #pref_label, #related_concepts_for_relation_class, #save_with_full_validation!, #to_param, #to_s, tops, #valid_with_full_validation?, with_associations, with_pref_labels

Methods included from Iqvoc::Versioning

#branch, #editor_selectable?, #in_review?, #lock_by_user, #locked?, #publish, #published?, #state, #to_review, #unlock, #unpublish

Instance Method Details

#build_rdf_subject(document, controller, &block) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/models/concept/skos/base.rb', line 22

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

  # ensure skos:Concept type is present
  unless self.rdf_namespace == "skos" && self.rdf_class == "Concept"
    subject.Rdf.build_predicate("type", IqRdf::Skos.build_uri("Concept"))
  end

  return subject
end