Skip to content

Commit

Permalink
[v2.1] New additions to the main table...
Browse files Browse the repository at this point in the history
- Classification
- Catalogue Raisonne
- Call Number
- Status Flag
- Signed
- Inscribed
- Markings
- CreditLine
- Chat
- Description
- Notes
- Provenance
- Pub References
- Curatorial Remarks
- Related Works
- Public Access
- Paper File Ref
- User Number 1
- Object State
- Hist Attributions
- Bibliography
- Edition
- Paper Support
- Is Template
- Date Remark

And removed "Title_From_Objects"
  • Loading branch information
tonyfischetti committed Dec 18, 2024
1 parent 7df9d7d commit ca66f59
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib/column-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const fieldClip = (s: string) => clipStringAtLengthN(s, FIELD_CHARACTER_LIMIT);
columnDefs = addNewKeyValToColumnDefs(columnDefs, 'main', 'Title', 'render', titleClip);

/* other fields that have to be tamed */
const mainFieldsToClip = ["Home_Location", "Dimensions", "Title_From_Objects"]
const mainFieldsToClip = ["Home_Location", "Dimensions"]
mainFieldsToClip.forEach(field => {
columnDefs = addNewKeyValToColumnDefs(columnDefs, 'main', field, 'render', fieldClip);
});
Expand Down
104 changes: 100 additions & 4 deletions lib/proto-column-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ export const protoColumnDefs = {
"data": "Object_Number",
"title": "Object Number"
},
{
"data": "Classification",
"title": "Classification"
},
{
"data": "Title",
"title": "Title"
Expand Down Expand Up @@ -182,10 +186,22 @@ export const protoColumnDefs = {
"data": "Nationality",
"title": "Nationality"
},
{
"data": "Catalogue_Raisonne",
"title": "Catalogue Raisonne"
},
{
"data": "Call_Number",
"title": "Call Number"
},
{
"data": "Home_Location",
"title": "Home Location"
},
{
"data": "StatusFlag",
"title": "StatusFlag"
},
{
"data": "Object_Count",
"title": "Object Count"
Expand Down Expand Up @@ -234,10 +250,6 @@ export const protoColumnDefs = {
"data": "Non_Display_Title",
"title": "Non Display Title"
},
{
"data": "Title_From_Objects",
"title": "Title From Objects"
},
{
"data": "Link",
"title": "Link"
Expand Down Expand Up @@ -309,6 +321,90 @@ export const protoColumnDefs = {
{
"data": "Locus",
"title": "Locus"
},
{
"data": "Signed",
"title": "Signed"
},
{
"data": "Inscribed",
"title": "Inscribed"
},
{
"data": "Markings",
"title": "Markings"
},
{
"data": "CreditLine",
"title": "CreditLine"
},
{
"data": "Chat",
"title": "Chat"
},
{
"data": "Description",
"title": "Description"
},
{
"data": "Notes",
"title": "Notes"
},
{
"data": "Provenance",
"title": "Provenance"
},
{
"data": "PubReferences",
"title": "PubReferences"
},
{
"data": "CuratorialRemarks",
"title": "CuratorialRemarks"
},
{
"data": "RelatedWorks",
"title": "RelatedWorks"
},
{
"data": "PublicAccess",
"title": "PublicAccess"
},
{
"data": "PaperFileRef",
"title": "PaperFileRef"
},
{
"data": "UserNumber1",
"title": "UserNumber1"
},
{
"data": "ObjectState",
"title": "ObjectState"
},
{
"data": "HistAttributions",
"title": "HistAttributions"
},
{
"data": "Bibliography",
"title": "Bibliography"
},
{
"data": "Edition",
"title": "Edition"
},
{
"data": "PaperSupport",
"title": "PaperSupport"
},
{
"data": "IsTemplate",
"title": "IsTemplate"
},
{
"data": "DateRemarks",
"title": "DateRemarks"
}
]
};
89 changes: 80 additions & 9 deletions mk-ppd-db/01_make-each-table/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,41 @@ rm(departments)
# --------------------------------------------------------------- #



# --------------------------------------------------------------- #
# CLASSIFICATION ------------------------------------------------- #

objs <- mstobjs[, .(ObjectID, ClassificationID)]
classifications <- read.table.dump("Classifications")
classifications <- classifications[, .(ClassificationID, Classification)]
classifications
objs %>% merge(classifications, all.x=TRUE) -> withclassifications
withclassifications <- withclassifications[, .(ObjectID, Classification)]

main %<>% merge(withclassifications, all.x=TRUE)

# --------------------------------------------------------------- #



# --------------------------------------------------------------- #
# STATUS FLAGS -------------------------------------------------- #

objs <- mstobjs[, .(ObjectID)]
statusflags <- read.table.dump("StatusFlags")
statusflags <- statusflags[, .(ObjectID, FlagID)]
flaglabels <- read.table.dump("FlagLabels")
flaglabels <- flaglabels[, .(FlagID, StatusFlag=FlagLabel)]
statusflags %<>% merge(flaglabels)
statusflags[, FlagID:=NULL]
statusflags

main %<>% merge(statusflags, all.x=TRUE)

# --------------------------------------------------------------- #



# --------------------------------------------------------------- #
# OBJECT TITLES ------------------------------------------------- #

Expand Down Expand Up @@ -67,7 +102,7 @@ titles <- titles[, .(ObjectID, Title=MainTitle, Collection=Title.Collection,
Subtitle=Title.SubtitleorTitleTranslation)]

main %<>% merge(titles)
main %<>% unique
main %<>% unique # TODO revisit this decision

# --------------------------------------------------------------- #

Expand Down Expand Up @@ -120,18 +155,19 @@ media.files <- read.table.dump("MediaFiles")
media.files <- media.files[, .(FileID, RenditionID, PathID, FileName)]

thumbs <- media.files %>% merge(media.paths, all=FALSE)
thumbs[FileID==43426]
# thumbs[FileID==43426]
thumbs <- thumbs[, .(FileID, RenditionID, Link=sprintf("%s/%s", Path, FileName))]

thumbs <- objs %>% merge(thumbs, all=FALSE, by="RenditionID")

thumbs[ObjectID==153812]
# thumbs[ObjectID==153812]

thumbs <- thumbs[, .(ObjectID, Link)]

main %<>% merge(thumbs, all.x=TRUE)

# # --------------------------------------------------------------- #
# --------------------------------------------------------------- #




Expand Down Expand Up @@ -203,11 +239,11 @@ main %<>% merge(constituents, all.x=TRUE)
# GEOGRAPHY ----------------------------------------------------- #

objgeo <- read.table.dump("ObjGeography")
objgeo
# objgeo
objgeo <- objgeo[PrimaryDisplay==1, .(ObjectID, Country, State,
County, City, Locus,
GeoSearchValue=KeyFieldsSearchValue)]
objgeo # !!!
# objgeo # !!!
main <- main %>% merge(objgeo, all.x=TRUE)

# --------------------------------------------------------------- #
Expand All @@ -217,7 +253,16 @@ main <- main %>% merge(objgeo, all.x=TRUE)
# OBJECT VARS PREVIOUSLY LEFT OUT ------------------------------- #

mstobjs <- read.table.dump("Objects")
obj <- mstobjs[, .(ObjectID, ObjectNumber, ObjectCount, Medium, Dimensions, Dated)]
obj <- mstobjs[, .(ObjectID, ObjectNumber, ObjectCount, Medium, Dimensions,
Dated, Signed, Inscribed, Markings, CreditLine, Chat,
Description, Provenance, PubReferences, Notes,
CuratorialRemarks, RelatedWorks, PublicAccess,
PaperFileRef, UserNumber1, ObjectState=State, CatRais,
HistAttributions, Bibliography, Edition, PaperSupport,
IsTemplate, DateRemarks, SortNumber2)]




main %>% nrow
obj %>% nrow
Expand All @@ -227,6 +272,7 @@ main <- main %>% merge(obj)
final <- main[, .(Object_ID=ObjectID,
Department,
Object_Number=ObjectNumber,
Classification, # NEW
Title,
Role,
First_Name=FirstName,
Expand All @@ -235,7 +281,10 @@ final <- main[, .(Object_ID=ObjectID,
Dated,
Display_Date=DisplayDate,
Nationality,
Catalogue_Raisonne=CatRais, # NEW
Call_Number=SortNumber2, # NEW
Home_Location=HomeLocation,
StatusFlag, # NEW
Object_Count=ObjectCount,
Dimensions,
BeginDate,
Expand All @@ -248,7 +297,7 @@ final <- main[, .(Object_ID=ObjectID,
Folder,
Depicted_Location=Location_Depicted,
Non_Display_Title,
Title_From_Objects,
# Title_From_Objects, NEW
Link,
Display_Name=DisplayName,
Institution,
Expand All @@ -266,7 +315,29 @@ final <- main[, .(Object_ID=ObjectID,
State,
County,
City,
Locus)]
Locus,
# NEW
Signed,
Inscribed,
Markings,
CreditLine,
Chat,
Description,
Notes,
Provenance,
PubReferences,
CuratorialRemarks,
RelatedWorks,
PublicAccess,
PaperFileRef,
UserNumber1,
ObjectState,
HistAttributions,
Bibliography,
Edition,
PaperSupport,
IsTemplate,
DateRemarks )]

setnames(cons, separate_words_with_hyphens(names(cons)))

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Prints and Photographs Discovery tool",
"version": "2.0.0",
"version": "2.1.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
26 changes: 25 additions & 1 deletion types/record-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ declare interface MainRecord {
Object_ID: number;
Department: string;
Object_Number: string;
Classification: string;
Title: string;
Role: string;
First_Name: string;
Expand All @@ -58,7 +59,10 @@ declare interface MainRecord {
Dated: string;
Display_Date: string;
Nationality: string;
Catalogue_Raisonne: string;
Call_Number: string;
Home_Location: string;
StatusFlag: string;
Object_Count: number;
Dimensions: string;
BeginDate: number;
Expand All @@ -71,7 +75,6 @@ declare interface MainRecord {
Folder: string;
Depicted_Location: string;
Non_Display_Title: string;
Title_From_Objects: string;
Link: string;
Display_Name: string;
Institution: string;
Expand All @@ -90,4 +93,25 @@ declare interface MainRecord {
County: string;
City: string;
Locus: string;
Signed: string;
Inscribed: string;
Markings: string;
CreditLine: string;
Chat: string;
Description: string;
Notes: string;
Provenance: string;
PubReferences: string;
CuratorialRemarks: string;
RelatedWorks: string;
PublicAccess: number;
PaperFileRef: string;
UserNumber1: string;
ObjectState: string;
HistAttributions: string;
Bibliography: string;
Edition: string;
PaperSupport: string;
IsTemplate: number;
DateRemarks: string;
}

0 comments on commit ca66f59

Please sign in to comment.