LP#1442815: teach record attributes about SKOS
authorGalen Charlton <gmc@esilibrary.com>
Fri, 10 Apr 2015 22:03:46 +0000 (22:03 +0000)
committerJason Stephenson <jstephenson@mvlc.org>
Wed, 19 Aug 2015 17:39:10 +0000 (13:39 -0400)
Add columns to the database for storing URIs of SKOS
vocabularies and concepts.  In particular:

- add a vocabulary column to config.record_attr_definition
  to store the URI of the published vocabulary associated
  with the record attribute
- add a concept_uri column to config.coded_value_map

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/lp1442815_1of2.schema.teach_record_attributes_about_skos.sql [new file with mode: 0644]

index 1fc9695..5983733 100644 (file)
@@ -873,6 +873,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
                        <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
                        <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
+                       <field reporter:label="Vocabulary URI" name="vocabulary" reporter:datatype="text"/>
                        <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
                </fields>
                <links>
@@ -1040,6 +1041,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
                        <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
+            <field reporter:label="Concept URI" name="concept_uri" reporter:datatype="text"/>
             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
index a11069e..02cea68 100644 (file)
@@ -792,7 +792,11 @@ CREATE TABLE config.record_attr_definition (
     fixed_field TEXT, -- should exist in config.marc21_ff_pos_map.fixed_field
 
 -- For phys-char fields
-    phys_char_sf    INT REFERENCES config.marc21_physical_characteristic_subfield_map (id)
+    phys_char_sf    INT REFERENCES config.marc21_physical_characteristic_subfield_map (id),
+
+-- Source of vocabulary terms for this record attribute;
+-- typically will be a URI referring to a SKOS vocabulary
+    vocabulary  TEXT
 );
 
 CREATE TABLE config.record_attr_index_norm_map (
@@ -811,7 +815,9 @@ CREATE TABLE config.coded_value_map (
     description     TEXT,
     opac_visible    BOOL    NOT NULL DEFAULT TRUE, -- For TPac selectors
     search_label    TEXT,
-    is_simple       BOOL    NOT NULL DEFAULT FALSE
+    is_simple       BOOL    NOT NULL DEFAULT FALSE,
+    concept_uri     TEXT    -- URI expressing the SKOS concept that the
+                            -- coded value represents
 );
 
 CREATE VIEW config.language_map AS SELECT code, value FROM config.coded_value_map WHERE ctype = 'item_lang';
diff --git a/Open-ILS/src/sql/Pg/upgrade/lp1442815_1of2.schema.teach_record_attributes_about_skos.sql b/Open-ILS/src/sql/Pg/upgrade/lp1442815_1of2.schema.teach_record_attributes_about_skos.sql
new file mode 100644 (file)
index 0000000..0b8de34
--- /dev/null
@@ -0,0 +1,9 @@
+BEGIN;
+
+ALTER TABLE config.record_attr_definition
+    ADD COLUMN vocabulary TEXT;
+
+ALTER TABLE config.coded_value_map
+    ADD COLUMN concept_uri TEXT;
+
+COMMIT;