sul-dlss / dor-services-app

A Rails application exposing Digital Object Registry functions as a RESTful HTTP API
https://sul-dlss.github.io/dor-services-app/
Other
3 stars 2 forks source link

Report on unique subject source code values #4187

Closed arcadiafalcone closed 2 years ago

arcadiafalcone commented 2 years ago

Report on unique values of subject..source.code. Desired output is a list of deduplicated terms.

Test record vz332dg7306 has subject..source.code with values lcsh and naf.

jcoyne commented 2 years ago

Here are the results:

["23",
 "aat",
 "abne",
 "acm",
 "afs",
 "afset",
 "agrovoc",
 "aiatsisl",
 "aiatsisp",
 "aiatsiss",
 "anscr",
 "ascl",
 "bcc",
 "bcl",
 "bcl0",
 "bcm",
 "bcmc",
 "bdic",
 "Bdic",
 "bial",
 "bidex",
 "bidex/cpl",
 "Bird Area",
 "bisacsh",
 "bkl",
 "bl",
 "blmlsh",
 "blsrissc",
 "Bremen <Geschichte>",
 "Bsh",
 "BSH",
 "cadocs",
 "Cadre de classement de la Bibliographie nationale française",
 "cct",
 "cdcng",
 "cjurivoc",
 "clc",
 "Cnam",
 "colper",
 "csh",
 "csht",
 "cshua",
 "czenas",
 "DB",
 "dcs",
 "ddb",
 "ddc",
 "ddcrit",
 "Dewey",
 "dopaed",
 "dtict",
 "eclas",
 "eczenas",
 "edbsc",
 "eflch",
 "embne",
 "ericd",
 "eurovoc",
 "eurovocen",
 "farl",
 "fast",
 "fmesh",
 "fssh",
 "ftamc",
 "GEMET - INSPIRE themes, version 1.0",
 "geonames",
 "geonet",
 "gnd",
 "gtn",
 "gtt",
 "GyBeDBIZ",
 "GyFmDB",
 "henn",
 "http://co-ops.nos.noaa.gov/pub.html",
 "https://id.loc.gov/authorities/names",
 "Icsh",
 "idsbb",
 "idszbz",
 "idszbzzk",
 "ifzs",
 "iso15924",
 "ISO19115TopicCategory",
 "iso3166",
 "iso639-2b",
 "itrt",
 "jhpb",
 "jhpk",
 "jlabsh/3",
 "jlabsh/4",
 "Jussieu",
 "KBslagord",
 "kktb",
 "kssb",
 "lacc",
 "larpcal",
 "lcc",
 "lcgft",
 "lcsh",
 "LCSH",
 "lcshac",
 "lctgm",
 "lemb",
 "local",
 "local_cujas",
 "loovs",
 "lsch",
 "ltcsh",
 "lu-luope",
 "marcgac",
 "marcrelator",
 "Meran <1988>. DB",
 "mesh",
 "moys",
 "msc",
 "naf",
 "nal",
 "nasat",
 "NASAT.",
 "nbc",
 "ncsclt",
 "NDC8",
 "NDC9",
 "ndllsh",
 "ndlsh",
 "NDLSH",
 "njb",
 "njb/9",
 "nli",
 "nlm",
 "nta",
 "obspm",
 "olc-ssg",
 "Pica-GOO",
 "precis",
 "psychit",
 "qlsp",
 " ram",
 "ram",
 "ram.",
 "rasuqam",
 "rbbin",
 "renib",
 "reo",
 "rero",
 "Retrolet",
 "rpb",
 "rswk",
 "rvk",
 "rvm",
 "sao",
 "sbb",
 "sbt",
 "scgdst",
 "sdnb",
 "sears",
 "sfb",
 "sigle",
 "sk",
 "ssg",
 "ssgn",
 "sswd",
 "stub",
 "stw",
 "sudocs",
 "swd",
 "SWD",
 "SWD.",
 "swd651",
 "swd/690",
 "tgn",
 "tlsh",
 "topic",
 "trt",
 "udc",
 "ukslc",
 "unbisn",
 "unbist",
 "uole",
 "wiki",
 "wikidata",
 "wot",
 "z",
 "zdbs"]

and here's the sql I used:

SELECT DISTINCT(jsonb_path_query(description, '$.subject.**.source.code')#>>'{}') as code FROM dros