1"use strict";(self.webpackChunkparadicms_org=self.webpackChunkparadicms_org||[]).push([[9098],{8547:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>d,contentTitle:()=>r,default:()=>p,frontMatter:()=>o,metadata:()=>l,toc:()=>s});var n=a(7462),i=(a(7294),a(3905));const o={sidebar_position:2},r="Tutorial: Edit file-based collection data",l={unversionedId:"tutorials/edit-directory",id:"tutorials/edit-directory",title:"Tutorial: Edit file-based collection data",description:"The tutorial will guide you in editing collection data stored in files.",source:"@site/docs/tutorials/edit-directory.md",sourceDirName:"tutorials",slug:"/tutorials/edit-directory",permalink:"/docs/tutorials/edit-directory",draft:!1,tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Tutorial: generate a digital exhibition from files in a GitHub repository",permalink:"/docs/tutorials/directory-ssg/"},next:{title:"Tutorial: generate a timeline interface for data in Google Sheets",permalink:"/docs/tutorials/spreadsheet-ssg/"}},d={},s=[{value:"Before you start",id:"before-you-start",level:3},{value:"Creating a directory",id:"creating-a-directory",level:4},{value:"Data entry workflow",id:"data-entry-workflow",level:3},{value:"Enter a <code>Person</code>",id:"enter-a-person",level:3},{value:"Enter an <code>Image</code>",id:"enter-an-image",level:3},{value:"Add image data",id:"add-image-data",level:3},{value:"Enter an <code>Event</code>",id:"enter-an-event",level:3},{value:"Next steps",id:"next-steps",level:3}],c={toc:s},m="wrapper";function p(e){let{components:t,...a}=e;return(0,i.kt)(m,(0,n.Z)({},c,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"tutorial-edit-file-based-collection-data"},"Tutorial: Edit file-based collection data"),(0,i.kt)("p",null,"The tutorial will guide you in editing collection data stored in files."),(0,i.kt)("h3",{id:"before-you-start"},"Before you start"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Create a directory. See below."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Review the ",(0,i.kt)("a",{parentName:"strong",href:"/docs/introduction/conceptual-data-model"},"Paradicms conceptual data model")," and ",(0,i.kt)("a",{parentName:"strong",href:"/docs/reference/logical-data-models"},"logical data models"),".")),(0,i.kt)("li",{parentName:"ul"},"Optionally, ",(0,i.kt)("strong",{parentName:"li"},"review the ",(0,i.kt)("a",{parentName:"strong",href:"/docs/reference/directory-format"},"reference documentation on the Paradicms directory format"),"."))),(0,i.kt)("h4",{id:"creating-a-directory"},"Creating a directory"),(0,i.kt)("p",null,"For this tutorial you will need a place to store files. It can be any directory. As you enter data the directory will conform to the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/directory-format"},"expected structure"),"."),(0,i.kt)("p",null,"You can create directories and ",(0,i.kt)("a",{parentName:"p",href:"https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files"},"edit YAML files")," directly on GitHub or clone the GitHub repository to your machine and perform these operations locally."),(0,i.kt)("h3",{id:"data-entry-workflow"},"Data entry workflow"),(0,i.kt)("p",null,"The remaining sections of this document follow a subset of the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/data-entry-workflow"},"repeatable data entry workflow"),". We will not attempt to create instances of every class in the data model, but only enough to demonstrate the editing process."),(0,i.kt)("h3",{id:"enter-a-person"},"Enter a ",(0,i.kt)("inlineCode",{parentName:"h3"},"Person")),(0,i.kt)("p",null,"Create a subdirectory named ",(0,i.kt)("inlineCode",{parentName:"p"},"schema-person")," if it doesn't exist already, then create a file ",(0,i.kt)("inlineCode",{parentName:"p"},"andrew-bolton.yaml")," in that directory with the following content:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml",metastring:'title="schema-person/andrew-bolton.yaml"',title:'"schema-person/andrew-bolton.yaml"'},"familyName: Bolton\ngivenName: Andrew\nname: Andrew Bolton\n")),(0,i.kt)("h3",{id:"enter-an-image"},"Enter an ",(0,i.kt)("inlineCode",{parentName:"h3"},"Image")),(0,i.kt)("p",null,"Create a subdirectory named ",(0,i.kt)("inlineCode",{parentName:"p"},"schema-image-object")," if it doesn't exist already, then create a file ",(0,i.kt)("inlineCode",{parentName:"p"},"camp-notes-on-fashion.yaml")," in that directory with the following content:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml",metastring:'title="schema-image-object/camp-notes-on-fashion.yaml"',title:'"schema-image-object/camp-notes-on-fashion.yaml"'}
1,"creatorLiteral: Wikipedia user Rhododendrites\nlicense: http://creativecommons.org/licenses/by-sa/4.0/\n")),(0,i.kt)("p",null,"The new ",(0,i.kt)("inlineCode",{parentName:"p"},"Image")," references the Creative Commons BY-SA 4.0 ",(0,i.kt)("inlineCode",{parentName:"p"},"License"),", which is implicitly included in the data."),(0,i.kt)("h3",{id:"add-image-data"},"Add image data"),(0,i.kt)("p",null,"Save the ",(0,i.kt)("a",{parentName:"p",href:"https://upload.wikimedia.org/wikipedia/commons/e/e5/Camp_-_Notes_on_Fashion_at_the_Met_%2873879%29.jpg"},"JPEG file from Wikimedia Commons")," to the file ",(0,i.kt)("inlineCode",{parentName:"p"},"camp-notes-on-fashion.jpg")," in the ",(0,i.kt)("inlineCode",{parentName:"p"},"schema-image-object")," directory."),(0,i.kt)("h3",{id:"enter-an-event"},"Enter an ",(0,i.kt)("inlineCode",{parentName:"h3"},"Event")),(0,i.kt)("p",null,"Create a subdirectory named ",(0,i.kt)("inlineCode",{parentName:"p"},"schema-event")," if it doesn't exist already, then create a file ",(0,i.kt)("inlineCode",{parentName:"p"},"camp-notes-on-fashion.yaml")," in that directory with the following content:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-yaml",metastring:'title="schema-event/camp-notes-on-fashion.yaml"',title:'"schema-event/camp-notes-on-fashion.yaml"'},'endDate: "2019-09-09"\nname: "Camp: Notes on Fashion"\norganizer: "md-schema-person:andrew-bolton"\nsameAs: "http://www.wikidata.org/entity/Q65043088"\nstartDate: "2019-05-08"\nurl: "https://www.metmuseum.org/exhibitions/listings/2019/camp-notes-on-fashion"\n')),(0,i.kt)("p",null,"The new ",(0,i.kt)("inlineCode",{parentName:"p"},"Event"),"'s ",(0,i.kt)("inlineCode",{parentName:"p"},"organizer")," property references the generated IRI of the new ",(0,i.kt)("inlineCode",{parentName:"p"},"Person"),"."),(0,i.kt)("h3",{id:"next-steps"},"Next steps"),(0,i.kt)("p",null,"You now have a directory with data about a ",(0,i.kt)("inlineCode",{parentName:"p"},"Event"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"Image"),", and ",(0,i.kt)("inlineCode",{parentName:"p"},"Person"),". From here you can enter more data, following the ",(0,i.kt)("a",{parentName:"p",href:"/docs/reference/logical-data-models"},"logical data models reference"),", or use the data you've entered to generate a website by following the appropriate ",(0,i.kt)("a",{parentName:"p",href:"/docs/tutorials/directory-ssg"},"tutorial"),"."))}p.isMDXComponent=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.