Skip to content

Data Modelling

Christopher Pollin edited this page Jan 5, 2021 · 27 revisions

Table of Contents

Related Ontologies

"Frontend Concepts"

"Frontend Concepts" comprises all concepts an editor is confronted if he/she wants to annotate a document according to the Bookkeeping-Ontology. The "Backend Concepts" are extending it in that way that they store information that can be deducted from the annotation (like bk:DataSet as an aggregation of data). So these concepts are represented e.g. by a @ana annotation

bk:Money

@prefix bk: <https://gams.uni-graz.at/o:depcha.bookkeeping#> .

<https://gams.uni-graz.at/o:depcha.wheaton.1#E692M21>
  a <https://gams.uni-graz.at/o:depcha.bookkeeping#Money> ;
  bk:unit <https://gams.uni-graz.at/context:depcha.wheaton#count> ;
  bk:quantity "1" .

<https://gams.uni-graz.at/o:depcha.wheaton.1#E692M22>
  a bk:Money ;
  bk:unit <https://gams.uni-graz.at/context:depcha.wheaton#cent> ;
  bk:quantity "50" .

bk:Commodity

@prefix bk: <https://gams.uni-graz.at/o:depcha.bookkeeping#> .

<https://gams.uni-graz.at/o:depcha.wheaton.1#E692M1>
  a <https://gams.uni-graz.at/o:depcha.bookkeeping#Commodity> ;
  bk:unit <https://gams.uni-graz.at/context:depcha.wheaton#count> ;
  bk:quantity "1" ;
  bk:commodity "hat" .

bk:Service

  • bk:spentTime ?
  • bk:typeOfWork ?
@prefix bk: <https://gams.uni-graz.at/o:depcha.bookkeeping#> .

<https://gams.uni-graz.at/o:depcha.wheaton.1#E277M1>
  a <https://gams.uni-graz.at/o:depcha.bookkeeping#Service> ;
  bk:unit "hours" ;
  bk:quantity "2" ;
  bk:commodity "work" .

bk:Total

  • Sum in the source
@prefix bk: <https://gams.uni-graz.at/o:depcha.bookkeeping#> .
<https://gams.uni-graz.at/o:depcha.leuven.1438#S0>
  a bk:Total ;
  bk:when "1438-08-01" ;
  bk:from <https://gams.uni-graz.at/o:depcha.leuven.1438#assize> ;
  bk:to <https://gams.uni-graz.at/context:depcha.leuven#leuven> ;
  bk:amount <https://gams.uni-graz.at/o:depcha.leuven.1438#S0M1> ;
  bk:entry "su(mma) van dat die rentmeest(er)s ontfaen hebben vand(er) stat vercocht
            ass(izen) bi(n)ne(n) den yersten q(ua)rt jaers compt op xiii[c] lxix guld(en) rijn(sch)
            xxiii(½) pl(acken) stuc te liii pl(acken) get(eld)".

<https://gams.uni-graz.at/o:depcha.leuven.1438#S0M1>
  a bk:Money ;
  bk:quantity "1459" ;
  bk:unit <https://gams.uni-graz.at/context:depcha.leuven#gulders> .

bk:Account

  • bk:Account rdfs:subClassOf bk:Between
  • explicitly define an account
@prefix bk: <https://gams.uni-graz.at/o:depcha.bookkeeping#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

<https://gams.uni-graz.at/context:depcha.leuven#timmerwerck> 
  a bk:Account ;
  bk:name "timmerwerck";
  skos:narrower <https://gams.uni-graz.at/context:depcha.leuven#buildingWork> .

<https://gams.uni-graz.at/context:depcha.leuven#buildingWork>
  a bk:Account ;
  bk:name "timmerwerck".

"Backend Concepts"

bk:Transaction

@prefix bk: <https://gams.uni-graz.at/o:depcha.bookkeeping#> .
@prefix gams: <https://gams.uni-graz.at/o:gams-ontology#> .

<https://gams.uni-graz.at/o:depcha.wheaton.1#T692>
  a bk:Transaction ;
  bk:consistsOf <https://gams.uni-graz.at/o:depcha.wheaton.1#T692T1>, <https://gams.uni-graz.at/o:depcha.wheaton.1#T692T2> ;
  bk:when "1833-11-02" ;
  bk:status "343" ;
  bk:entry "343 To a hat 9/ 1 50" ;
  gams:isMemberOfCollection <https://gams.uni-graz.at/context:depcha.wheaton> ;
  gams:isPartofTEI <https://gams.uni-graz.at/o:depcha.wheaton.1> ;
  gams:textualContent "343 To a hat 9/ 1 50 1 count hat 1 dollars #work 1x 3/4 day#Thomas Carpenter" .

bk:Transfer

@prefix bk: <https://gams.uni-graz.at/o:depcha.bookkeeping#> .

<https://gams.uni-graz.at/o:depcha.wheaton.1#T692T1>
  a <https://gams.uni-graz.at/o:depcha.bookkeeping#Transfer> ;
  bk:transfers <https://gams.uni-graz.at/o:depcha.wheaton.1#E692M1> ;
  bk:from <https://gams.uni-graz.at/o:depcha.wheaton.1#pers_WCDH002> ;
  bk:to <https://gams.uni-graz.at/o:depcha.wheaton.1#pers_WCDH221> .

<https://gams.uni-graz.at/o:depcha.wheaton.1#T692T2>
  a bk:Transfer ;
  bk:transfers <https://gams.uni-graz.at/o:depcha.wheaton.1#E692M21>, <https://gams.uni-graz.at/o:depcha.wheaton.1#E692M22> ;
  bk:from <https://gams.uni-graz.at/o:depcha.wheaton.1#pers_WCDH221> ;
  bk:to <https://gams.uni-graz.at/o:depcha.wheaton.1#pers_WCDH002> .

bk:DataSet

The class bk:DataSet contains aggregated data of a RDF file. Aggregated data is needed for visualizing data. If you want to create a barchart you need the sums of all bk:Transaction for a specific bk:when.

@prefix bk: <https://gams.uni-graz.at/o:depcha.bookkeeping#> .
@prefix ns1: <https://gams.uni-graz.at/o:gams-ontology#> .

<https://gams.uni-graz.at/o:depcha.wheaton.1#1828>
  a <https://gams.uni-graz.at/o:depcha.bookkeeping#DataSet> ;
  bk:date "1828" ;
  ns1:isMemberOfCollection <https://gams.uni-graz.at/context:depcha.wheaton> ;
  bk:income "330" ;
  bk:expense "0" ;
  bk:unit <https://gams.uni-graz.at/context:depcha.wheaton#dollar> .
  • bk:date: year of the bk:DataSet
  • gams:isMemberOfCollection: reference to the RDF file
  • bk:income:
  • bk:expense:
  • bk:unit: the main currency from which all sub-currencies can be derived on the basis of information in teiHeader or JSON input file.

Further bk:DataSet contains the information which bk:Between are connected to it, including with specific bk:income or/and bk:expense and its connected bk:EconomicGood

@prefix bk: <https://gams.uni-graz.at/o:depcha.bookkeeping#> .
@prefix gams: <https://gams.uni-graz.at/o:gams-ontology#> .

<https://gams.uni-graz.at/o:depcha.wheaton.1#1828>
  a bk:DataSet ;
  bk:date "1828" ;
  gams:isMemberOfCollection <https://gams.uni-graz.at/context:depcha.wheaton> ;
  bk:income "330" ;
  bk:expense "0" ;
  bk:unit <https://gams.uni-graz.at/context:depcha.wheaton#unit_dollars> ;
  bk:subDataSet <https://gams.uni-graz.at/o:depcha.wheaton.1#1828_pers_WCDH255>, <https://gams.uni-graz.at/o:depcha.wheaton.1#1828_pers_WCDH276> .

<https://gams.uni-graz.at/o:depcha.wheaton.1#1828_pers_WCDH255>
  a bk:DataSet ;
  bk:between <https://gams.uni-graz.at/context:depcha.wheaton#pers_WCDH255> ;
  bk:income "10" ;
  bk:expense "0" ;
  bk:unit <https://gams.uni-graz.at/context:depcha.wheaton#unit_dollars> ;
  bk:commodity <https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.6.1>, <https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.6.2> .

<https://gams.uni-graz.at/o:depcha.wheaton.1#1828_pers_WCDH276>
  a bk:DataSet ;
  bk:between <https://gams.uni-graz.at/context:depcha.wheaton#pers_WCDH276> ;
  bk:income "5.5" ;
  bk:expense "0" ;
  bk:unit <https://gams.uni-graz.at/context:depcha.wheaton#dollar> .
  • you can select all bk:subDataSet/bk:DataSet via bk:between/URI: to get all income and expense of a bk:Between
  • bk:commodity sets a reference to all bk:EconomicGood that are transferred in a specific bk:Dataset bk:subDataSet/bk:DataSet
    • ToDo add another bk:subDataSet/bk:DataSet inside to aggregate all bk:EconomicGoods for each bk:Between and each bk:when ?

bk:Between

  • Used to store infomration about the bk:Between.
  • tei:/particDesc/tei:listPerson[@ana='bk:Between'] is mapped to FOAF and other vocabularies ?
    • or [@ana='bk:Taxonomy']?
<person xml:id="pers_WCDH002">
            <persName>
              <forename type="first">Laban</forename>
              <forename type="middle">Morey</forename>
              <surname>Wheaton</surname>
              <addName>Husband</addName>
              <addName>Husb.</addName>
            </persName>
            <birth when="1796-09-14">
              <placeName>
                <settlement>Norton</settlement>
                <region>Massachusetts</region>
              </placeName>
            </birth>
            <sex value="1"/>
            <education>
              <orgName notAfter="1817" ref="#org_WCDH4">Brown University</orgName>
            </education>
            <education>read law</education>
            <faith>Congregational</faith>
            <state notBefore="1829-06-25" type="married"/>
            <occupation>
              <roleName>Postmaster</roleName>
            </occupation>
            <affiliation>
              <roleName>Representative <orgName ref="#org_WCDH5">Massachusetts General
                  Court</orgName>
              </roleName>
            </affiliation>
            <occupation>
              <roleName>Member <orgName ref="#org_WCDH6">Massachusetts Governor&apos;s
                  Council</orgName>
              </roleName>
            </occupation>
            <affiliation>
              <roleName>Trustee</roleName>
              <orgName ref="#org_WCDH7">State Industrial School for Girls</orgName>
            </affiliation>
            <death when="1865"/>
          </person>
  <bk:Between rdf:about="https://gams.uni-graz.at/o:depcha.wheaton.1#pers_WCDH002">
    <bk:name>Wheaton, Laban Morey</bk:name>
    <foaf:firstName>Laban Morey</foaf:firstName>
    <foaf:familyName>Wheaton</foaf:familyName>
    <t:occupation>Postmaster Member</t:occupation>
    <foaf:gender>male</foaf:gender>
  </bk:Between>

skos:Concept

  • Used to define taxonomies for bk:EconomicGood.
  • tei:taxonomy[@ana='bk:Taxonomy'] is mapped to SKOS
<skos:Concept rdf:about="https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.12">
    <skos:inScheme rdf:resource="https://gams.uni-graz.at/o:depcha.wheaton.1#"/>
    <skos:narrower rdf:resource="https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.12.1"/>
    <skos:narrower rdf:resource="https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.12.2"/>
    <skos:narrower rdf:resource="https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.12.3"/>
    <skos:narrower rdf:resource="https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.12.4"/>
    <skos:prefLabel>meat</skos:prefLabel>
    <skos:relatedMatch rdf:resource="wd:Q10990"/>
  </skos:Concept>
  <skos:Concept rdf:about="https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.12.1">
    <skos:inScheme rdf:resource="https://gams.uni-graz.at/o:depcha.wheaton.1#"/>
    <skos:broader rdf:resource="https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.12"/>
    <skos:prefLabel>beef</skos:prefLabel>
    <skos:relatedMatch rdf:resource="wd:Q192628"/>
  </skos:Concept>
  <skos:Concept rdf:about="https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.12.2">
    <skos:inScheme rdf:resource="https://gams.uni-graz.at/o:depcha.wheaton.1#"/>
    <skos:broader rdf:resource="https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.12"/>
    <skos:prefLabel>pork</skos:prefLabel>
    <skos:relatedMatch rdf:resource="wd:Q191768"/>
  </skos:Concept>
  <skos:Concept rdf:about="https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.12.3">
    <skos:inScheme rdf:resource="https://gams.uni-graz.at/o:depcha.wheaton.1#"/>
    <skos:broader rdf:resource="https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.12"/>
    <skos:prefLabel>salt beef</skos:prefLabel>
    <skos:relatedMatch rdf:resource="wd:Q1682434"/>
  </skos:Concept>
  <skos:Concept rdf:about="https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.12.4">
    <skos:inScheme rdf:resource="https://gams.uni-graz.at/o:depcha.wheaton.1#"/>
    <skos:broader rdf:resource="https://gams.uni-graz.at/o:depcha.wheaton.1#commodity.12"/>
    <skos:prefLabel>turkeys</skos:prefLabel>
    <skos:relatedMatch rdf:resource="wd:Q4200953"/>
  </skos:Concept>

om:Unit

  • represent the information about region, date and context necessary to understand a unit.
  • tei:unitDecl[ana='bk:Taxonomy']/tei:unitDef is mapped to Ontology of Units of Measure
    • ToDo: @ana ?
<om:Unit rdf:about="https://gams.uni-graz.at/o:depcha.wheaton.1#dollar">
  <rdfs:label>dollar</rdfs:label>
</om:Unit>
<om:Unit rdf:about="https://gams.uni-graz.at/o:depcha.wheaton.1#unit.1">
  <rdfs:label>bushels</rdfs:label>
</om:Unit>

Concepts to add and implement

  • bk:sum

BK-Ontology Annotations ~ "How to Bookkeep"

TEI-Annotation Guidlines

Add Images/Facsimiles

<facsimile>
<surface>
    <graphic url="file:///img/LedgerA_L28.jpg" xml:id="IMG.1" mimeType="image/jpeg"/>
  </surface>
  <surface>
    <graphic url="file:///img/LedgerA_R28.jpg" xml:id="IMG.2" mimeType="image/jpeg"/>
  </surface>
</facsimile>

Referencing the position of the image with setting a <pb> element.

<pb facs="IMG.1" n="1" xml:id="DIV.1"/>
<table>
  <row xml:id="wfp_29722" n="1" ana="bk:entry">
    <cell>
      <name ref="11833" ana="bk:to bk:debit">Cash</name>
    </cell>
   </row>
[...]