Removing media from one person

I attached the 1920 Census to the people displayed in the window below:
Pic 1.jpg
I want to remove the media from Sophia only.and leave the media attached to the remaining people.

Actual Results:
I have Sophia’s record open, selected the media column for the fact, highlighted Sophia and pressed the Remove media button. It removes the media from everyone in the list. I have to re-add the media to everyone again. That is not good. That is a lot of wasted time.

Expected Results:
I expected to highlight the person I wanted to remove the media from. Select Remove media and the media only would be removed from only the person selected. I would expect the event to still be there. If I wanted to have the media removed from everyone, I would highlight/select everyone and then press remove media.

If the actual results is the way it is supposed to work, may I suggest an enhancement for the expected results?

Discussions & comments from Wikispaces site


ve3meo

Removing a media item from a specific person/event…

ve3meo
19 October 2017 04:12:54

Use Delete tag for what you wanted to have happen. The controls across the top are for the Media file or Album – Remove Media removes the media item from the Media Gallery and eliminates all its tags, as you discovered.

For RM user issues or questions having nothing to do with SQLite, please post to the RM Forum or FB Page.

Tom

Where is the data stashed

Pic 1.jpg
Pic 1
The explanation for the Details field in the EventTable of the Data Definitions states Content of Description field in Edit Person fact/event pane.
Pic 2.jpg
Pic 2
I take that to mean it should contain Marital Status: MarriedRelation to Head of House: Head in the above print screen.

I created the following query to get those details:

select et.eventid, et.eventtype, ft.Name, et.placeid, pt.name, substr(et.date,4,4), pt.name, et.Details, et.note

from eventtable et,
facttypetable ft,
placetable pt

where et.eventtype = ft.facttypeid
and et.placeid = pt.placeid
and ownerid = 70
;
I got the following results:
Pic 3.jpg
Pic 3

What file(s) do I find the Place details (address, Hospital, cemetery, etc.) field and the Descriptions: field on the Edit Person window above? I am trying to find where testing and Marital Status: MarriedRelation to Head of House: Head is stashed.

Discussions & comments from Wikispaces site


thejerrybryan

Place Details Location

thejerrybryan
18 October 2017 00:43:43

The Place Details are in the PlaceTable. The format is the same as for the Place info itself except that the PlaceType is 2 for PlaceDetails. The corresponding PlaceID is in the MasterID field. The basic idea is that you have to do a JOIN of the PlaceTable to itself so that you are joining the PlaceDetails values to the Place values on MasterID for the PlaceDetails and PlaceID for the Place.


ve3meo

ve3meo
18 October 2017 02:31:01

The text you are looking for is in the Blob type field Details. You need to convert the binary data to Text. See the different results between:
SELECT Details FROM EventTable;
and
SELECT TRIM(Details) FROM EventTable;

Tom


thejerrybryan

Descriptions field location

thejerrybryan
18 October 2017 00:46:59

This field has many names in RM, like all the multiple names for one person in a Russian novel. It is Description in the Edit Person screen, Details in the EventTable if you are using SQLite, and Value if you are in the Find/Search dialog in the RM user interface.


thejerrybryan

Individual Facts and Family Facts

thejerrybryan
18 October 2017 00:55:18

Your query for info about person 70 looks like it’s fine for individual events such as birth and death, but it will not work correctly for “family” event such as marriage. RM’s “family” events are really just for the couple, not for the children.

When you are first starting out with SQLite and RM, it’s probably easier to make two separate queries, one for individual events and one for couple events. The trick in the EventTable is to test the OwnerType field with a WHERE clause such that OwnerType = 0 for individual events and OwnerType = 1 for couple events. Individual events are easy. For couple events, OwnerID points to the FamilyTable rather than to the PersonTable. So depending on what you are trying to accomplish with couple events, you will probably have to JOIN the EventTable to the FamilyTable and the FamilyTable to the PersonTable or the NameTable (or to both).

Alternate Names List

I created alternate names for wives so I can find the wife with her married name.
I put the given and maiden name in the given for the alternate name. I put her husband’s surname in surname. I use Married as Name Type, Mrs. As Prefix and the husbands given name with parenthesis around it as the suffix.

I am using the following query to get the alternate names: (See Pic 1)
Pic 1.jpg
It works great if there is only one alternate name. It is a problem if there is more than one alternate name for each husband as displayed in Pic 1.

Pic 2.jpg
This is the print screen of Rootsmagic. (See Pic 2)

Pic 3.jpg
If I do a data view of the nametable and do a custom on ownerid of 590, I get the following: (See Pic 3)

Pic 4.jpg
If I do a data view of the familytable and do a custom on ownerid of 590, I get the following: (See Pic 4)

Pic 5.jpg
How do I get the original query to display the correct husband with the wife like displayed below? (See Pic 5)

Pic 6.jpg
I copy all of the results of the query into a spreadsheet to verify there aren’t any typos in the alternate name. (See Pic 6)

Is it possible to create the query to get the results contained in the spreadsheet? (Column O and Column P)

How could I put a where statement in thee query to select only certain ownerid’s? I need to be able to hard code it and to be able to input the ownerid.

Discussions & comments from Wikispaces site


ve3meo

Add Married Name as Alternate

ve3meo
15 September 2017 16:15:15

Are you acquainted with this script? Names+-+Add+Married


ve3meo

ve3meo
15 September 2017 16:22:41

Okay, I understand that you have already manually created these Alternate Names and are looking for a way to detect errors. Is that your objective?

If we are to tinker wit your script, it would be helpful if you would post the script file or copy the script onto the page.

Query to Add Parents Events to RM Database #facttypes #events #sharedevent

I have recently added a Parents “fact” to everyone in my RM database who has parents. These Parents events really are new rows added to the EventTable, even though parentage is already denoted in RM by entries in the ChildTable joined with entries in the FamilyTable. The reasons for the new events are two-fold. First, it provides a good place in the RM user interface to attach evidence of parentage. Second, it improves RM narrative reports. A person’s parents are listed explicitly as a fact in a narrative report. The evidence of parentage appears with its respective Parents fact in a narrative report. And a “birth of child” event appears in a narrative report in the parents’ timelines.

The parents fact looks something like the following in my narrative reports.

1. Elza Cordelia (Elzie) Peters12.
Birth: 21 Dec 1898, Anderson County, Tennessee.12
Parents: Alva Edward Peters and Sallie Jane Cole.

The birth of child role looks something like the following in my narrative reports.

1. Alva Edward Peters13.
Birth: 14 Oct 1870, Scarbrough, Anderson County, Tennessee.1,46
Marriage: 28 Nov 1893, Anderson County, Tennessee, age 23, to Sallie Jane Cole.1,3
Birth of Child: 21 Dec 1898, Elza Cordelia (Elzie) Peters.

In order to make this work, a Parents fact has to be added to RM’s FactTypeTable from the RM user interface via Lists->Fact Type List. A sentence template must be added for the Principle role for the Parents fact. In addition, a Parent role must be added to the Parents fact.

Because I use point form sentences, my two sentence templates for the Principle and Parent role for the Parents fact are as follows.

{cr}
<b>Parents:</b>< [Parent].>
 
{cr}
<b>Birth of Child: </b> <[Date:plain]><, [Person:Full]>.

where {cr} is an actual carriage return and line feed sequence entered into the template simply be depressing the Enter key on the PC’s keyboard. The [Parent] variable works in an amazing way in RM because it lists both persons with the Parent role (the father and mother) and separates their names with “and”. The parents names are stored in the Description field of the Parents fact, so the [Parent] variable could be replaced by the [Desc] variable, but the use of the [Parent] variable causes the parents names to included in the Index of Names in a narrative report.

I used the following query to create the Parents fact for everybody in the database who has parents, with the following exceptions. The query is designed not to add the Parents fact if it’s already there. The query is designed not to add the Parents fact for dummy people in my database. The query is designed not to add the Parents fact for people without Birth facts because it uses the Birth fact to create a date and sortdate for the Parents fact.

Jerry

-- Create a view of the EventTable
-- containing only Parents events.
-- This view will be used to prevent
-- creating a Parents event for
-- any individuals who already have
-- a Parents event. The main data needed
-- is the PersonID of the individuals
-- who already have a Parents event.
-- The PersonID manifests itself in
-- the EventTable as OwnerId.
 
 
DROP VIEW IF EXISTS ParentEventView;
CREATE TEMP VIEW ParentEventView AS
SELECT E.*
FROM EventTable AS E
       JOIN
     FactTypeTable AS FT  ON FT.FactTypeID = E.EventType
     WHERE FT.Name LIKE('Parents');
 
 
 
-- Create a view of the EventTable
-- containing only Birth events.
-- These events provides an initial list
-- of candidates of people to receive
-- a Parents event. Also, many of the
-- fields for newly created Parents
-- events will be replicated from the
-- corresponding Birth event.
 
DROP VIEW IF EXISTS BirthEventView;
CREATE TEMP VIEW BirthEventView AS
SELECT Birth.*
FROM EventTable AS Birth
       JOIN
     FactTypeTable AS FT  ON FT.FactTypeID = Birth.EventType
     WHERE FT.Name LIKE('Birth');
 
 
-- Create a view of Birth events for people
-- that don't have a Parent event. This is the
-- first filtering on the list of candidates
-- of people to receive a Parents event.
 
 
DROP VIEW IF EXISTS BirthWithoutParentsEventView;
CREATE TEMP VIEW BirthWithoutParentsEventView AS
SELECT Birth.*
FROM BirthEventView AS Birth
          LEFT JOIN
     ParentEventView AS Parent ON Parent.Ownerid = Birth.OwneriD
WHERE Parent.OwnerID IS NULL;
 
-- Create a view of the NameTable
-- containing only primary names.
-- This view will be a source of
-- the names needed for the newly
-- created Parents events and will
-- prevent any names other than the
-- primary ames from being loaded
-- into -- Parents events. This
-- view also prevents Parents events
-- from being created for any dummy
-- people, designated with an asterisk
-- in the name.
 
DROP VIEW IF EXISTS NameView;
CREATE TEMP VIEW NameView AS
SELECT N.*
FROM NameTable AS N
WHERE N.IsPrimary = 1
  AND N.Surname NOT LIKE('%*%')
  AND N.Given   NOT LIKE('%*%');
 
-- This view performs most of the
-- main processing for this project.
-- It determines which people actually
-- do have parents. Actually having
-- parents is based on being in the
-- ChildTable and has nothing to do
-- with whether a Parents event exists
-- or not. This list of people with parents
-- is then matched against people who are not
-- dummy people, who do have birth
-- events, and who don't already have
-- Parents events. This view also
-- develops the data that will need to
-- be stored in the newly created
-- Parents events.
 
 
DROP VIEW IF EXISTS ChildParentsView;
CREATE TEMP VIEW ChildParentsView AS
SELECT Child.ChildID,  Child.Given  || ' ' || Child.Surname  AS ChildName,
       Father.FatherID, Father.Given || ' ' || Father.Surname AS FatherName,
       Mother.MotherID, Mother.Given || ' ' || Mother.Surname AS MotherName,
       CASE
       WHEN Father.FatherID = 0 THEN Mother.Given || ' ' || Mother.Surname
       WHEN Mother.MotherID = 0 THEN Father.Given || ' ' || Father.Surname
       ELSE Father.Given || ' ' || Father.Surname || ' and ' || Mother.Given || ' ' || Mother.Surname
       END CombinedNames,
       B.DATE,
       B.SortDate,
       B.EditDate
 
FROM  (  SELECT C.RecID,
                C.ChildID,
                N.Given,
                N.Surname
         FROM   ChildTable AS C
                  JOIN
                NameView AS N ON N.Ownerid = C.ChildID
      ) AS Child
 
           JOIN
 
      (  SELECT C.RecID,
                FM.FatherID,
                N.Given,
                N.Surname
         FROM ChildTable AS C
                JOIN
              FamilyTable AS FM ON C.FamilyID =  FM.FamilyID
                LEFT JOIN
              NameView AS N ON N.OwnerID = FM.FatherID
      ) AS Father ON Father.RecID = Child.RecID
 
           JOIN
 
      (  SELECT C.RecID,
                FM.MotherID,
                N.Given,
                N.Surname
         FROM   ChildTable AS C
                  JOIN
                FamilyTable AS FM ON C.FamilyID =  FM.FamilyID
                  LEFT JOIN
             NameView AS N ON N.OwnerID = FM.MotherID
       ) AS Mother ON Mother.RecID = Father.RecID
 
            JOIN
 
       BirthWithoutParentsEventView AS B ON B.OwnerID = Child.ChildID;
 
-- The data from the ChildParentsView needs to be used
-- twice, once to load Parents events into the EventTable
-- and again to load roles into the WitnessTable. The
-- Parents events have to be loaded into the EventsTable
-- first, and one Insert statment in SQLite cannot load
-- data into two tables. However, loading Parents Events
-- into the EventTable will cause the ChildParentsView
-- not to produce the correct results the second time it
-- is used. Therefore, the results from applying the
-- ChildParentsView will be saved into a temporary table
-- called ChildParentsTable. As a table instead of a view,
-- the data in ChildParentsTable can be used two different
-- times and remain the same data both times it is used.
 
DROP TABLE IF EXISTS ChildParentsTable;
CREATE TEMP TABLE ChildParentsTable
(ChildID,ChildName,FatherID,FatherName,MotherID,Mothername,CombinedNames,DATE,SortDate,EditDate);
INSERT INTO ChildParentsTable
(ChildID,ChildName,FatherID,FatherName,MotherID,Mothername,CombinedNames,DATE,SortDate,EditDate)
SELECT CP.*
FROM ChildParentsView AS CP;
 
 
 
-- Load new Parents facts into the EventTable.
 
INSERT OR ROLLBACK INTO EventTable
SELECT NULL AS EventID
    ,(SELECT FT.FactTypeID FROM FactTypeTable AS FT WHERE FT.Name LIKE('Parents') ) AS EventType
    ,0 AS OwnerType
    ,ChildID AS OwnerID
    ,0 AS FamilyID
    ,0 AS PlaceID
    ,0 AS SiteID
    ,DATE AS DATE
    ,SortDate AS SortDate
    ,0 AS IsPrimary
    ,0 AS IsPrivate
    ,0 AS Proof
    ,0 AS STATUS
    ,EditDate AS EditDate
    ,CAST('' AS TEXT) AS Sentence
    ,CAST(CombinedNames AS TEXT) AS Details
    ,CAST('' AS TEXT) AS Note
 FROM ChildParentsTable;
 
 
 
 --   ===========================================================================================================
 --     The following is adapted from Tom Holden to rank same date sort dates.
 --
 --     There are a number of changes by Jerry Bryan that are specific to his
 --     use case.
 --
 --        * The list of fact types which are supported is greatly increased.
 --        * Sort dates including ranked sort dates (date-n) are ranked and even re-ranked
 --          whether or not they match the date from from the fact itself, provided only
 --          that the sort dates in question match each other.
 --             . This allows same "ABT" dates to be ranked.
 --             . This allows same "year only" dates to be ranked if the sort date is
 --               1 July of the year.
 --             . This allows same "year and month only" dates to be ranked if the
 --             . sort date is the 15th of the month.
 --
 --   ===========================================================================================================
 
/* SortDateSameDayOrderCustom.sql
   2011-12-20 ve3meo
   Alters SortDates of any set of Fact types
   to a natural order when any pair or more occur on the same date.
   Could be extended to order other facts also. SortDates are effectively assigned
   (by arithmetical offsets) an absolute suffix -1, -2, ... related to the rank of the FactType.
   Affects only those events whose SortDates correspond to the Fact Date, as computed
   by a Date encoding algorithm. The algorithm does not handle Date modifiers so not all
   Event dates are handled, e.g. "Bef 1960".
*/
DROP TABLE IF EXISTS TmpFactOrder
;
CREATE TEMP TABLE IF NOT EXISTS TmpFactOrder
(Rank INTEGER PRIMARY KEY, FactName TEXT)
;
 
/* list of Fact Names, standard and custom, to be sorted, in rank order.
   Revise the list to suit your needs */
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Birth');
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Parents');             -- added by JB
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Birth Certificate');   -- added by JB
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Christen');
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Baptism');
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Death');
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Obituary');            -- moved up by JB
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Death Certificate');   -- added by JB
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Funeral');
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Cremation');
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Burial');
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Burial Inscription');  -- Added by JB
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Burial GPS');          -- Added by JB
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Memorial');
/* revise SortDates */
UPDATE EventTable
SET SortDate = SortDate
  -6692012023  -- this offset goes to Date-1 if the event is a ranked event
  *( (
      SELECT Rank
      FROM TmpFactOrder,
           FactTypeTable
      WHERE FactName LIKE Name
      AND FactTypeID = EventType
      )>0
    )
  +1048576  -- this offset adds steps of 1 to Date-1 multiplied by (rank-1)
  *( (
      SELECT Rank
      FROM TmpFactOrder,
           FactTypeTable
      WHERE FactName LIKE Name
      AND FactTypeID = EventType
      )-1
    ) -- maps the FactType to its order
WHERE EventID
IN (SELECT EventID FROM EventTable
    INNER JOIN
    (SELECT -- matching dates
     SortDate, OwnerID, COUNT()-1 AS Matches
     FROM EventTable
     INNER JOIN FactTypeTable
     ON EventType = FactTypeID
     WHERE EventTable.OwnerType = 0
     AND Name IN (SELECT FactName FROM TmpFactOrder)
/*     AND    -- commented out by JB to handle sort dates not matching fact date when sort dates are equal to each other.
     SortDate =   -- equals encoded event Date (if not a match, suggests that user has modified SortDate so don't touch it)
       (CASE
        WHEN DATE LIKE '.%'
        THEN 1
        ELSE Substr(DATE,3,5) END
        +10000
        )*562949953421312
        + Substr(DATE,8,2)*35184372088832
        + Substr(DATE,10,2)*549755813888
        + 17178820620 */
      GROUP BY SortDate, OwnerID, EventTable.OwnerType
     )
     USING (OwnerID, SortDate)
     INNER JOIN FactTypeTable
     ON EventType = FactTypeID
     WHERE Matches
     AND EventTable.OwnerType = 0
     AND Name IN (SELECT FactName FROM TmpFactOrder)
    )
;
 
 
-- We now add Parent roles to each Parents event.
-- It is most convenient to add the Parent role
-- for the father in one INSERT and to add the
-- Parent role for the mother as a separate insert.
-- So we first create a view that joins the
-- Parent events with the ChildTable and FamilyTable
-- to get a list of Parent events and their
-- respective fathers and mothers.
 
DROP VIEW IF EXISTS ParentRoleView;
CREATE TEMP VIEW ParentRoleView AS
SELECT PEV.*,
       FM.FatherID, FM.MotherID
FROM ParentEventView AS PEV
        JOIN
     ChildTable AS CT ON CT.ChildID = PEV.OwnerID
        JOIN
     FamilyTable AS FM ON CT.FamilyID =  FM.FamilyID;
 
 
-- Load Parents roles for fathers into the WitnessTable
 
INSERT OR ROLLBACK INTO WitnessTable
SELECT NULL AS WitnessID
    ,PE.EventID AS EventID
    ,Parents.FatherID AS PersonID
    ,0       AS WitnessOrder
    ,(SELECT R.RoleID FROM RoleTable AS R WHERE R.RoleName LIKE ('Parent') ) AS ROLE
    ,CAST('' AS TEXT) AS Sentence
    ,CAST('' AS TEXT) AS Note
    ,CAST('' AS TEXT) AS Given
    ,CAST('' AS TEXT) AS Surname
    ,CAST('' AS TEXT) AS Prefix
    ,CAST('' AS TEXT) AS Suffix
 FROM ChildParentsTable AS Parents
         JOIN
      ParentEventView AS PE ON PE.OwnerID =  Parents.ChildID AND PE.Details = Parents.CombinedNames;
 
-- Load Parents roles for mothers into the WitnessTable
 
INSERT OR ROLLBACK INTO WitnessTable
SELECT NULL AS WitnessID
    ,PE.EventID AS EventID
    ,Parents.MotherID AS PersonID
    ,0       AS WitnessOrder
    ,(SELECT R.RoleID FROM RoleTable AS R WHERE R.RoleName LIKE ('Parent') ) AS ROLE
    ,CAST('' AS TEXT) AS Sentence
    ,CAST('' AS TEXT) AS Note
    ,CAST('' AS TEXT) AS Given
    ,CAST('' AS TEXT) AS Surname
    ,CAST('' AS TEXT) AS Prefix
    ,CAST('' AS TEXT) AS Suffix
 FROM ChildParentsTable AS Parents
         JOIN
      ParentEventView AS PE ON PE.OwnerID =  Parents.ChildID AND PE.Details = Parents.CombinedNames;
;
 

Identifying Events with Individual Sentence Template Customization

I recently went through an exercise of removing all sentence customization for specific events in my RM database. The purpose of this change was to allow my Point Form sentence templates from the Fact Type Table to be used in all cases.

It is not possible in the RM user interface to search for specific events that have their own customized sentence templates. To that end, I developed the following query. This is pretty specific to my own research, but it did occur to me that there might be other reasons that someone might wish to find all events with individualized sentence customization.

I removed each sentence customization in RM by hand and I used this query only to find the customizations that needed to be removed. I could have done the removals with a query, but as I was removing the sentence customizations I was also updating the Fact note and in some cases the Fact description. So it was essentially impossible to do a complete automation of the the project.

Jerry

-- Finds events with individually customized sentence templates.
-- Sentence templates that are customized in the Fact Type table are not
-- identifed, only those that are customized for a particular event for a
-- particular person in the Edit Person sceen.
--
-- This query is for standard facts only, not for shared facts.
--
-- For a query such as this, most typically I would create
-- three queries and form their UNION. The reason for the
-- three queries is to find the PersonID for individual facts,
-- the FatherID for family facts, and the MotherID for family
-- facts. But for this query, I changed the logic a bit and
-- created a single query with three result columns. Some of
-- the column values will therefore be null, but each row
-- of the query includes at least one person of interest.
--
-- There is a subtle but important point in this query. The
-- query contains a sub-query within a couple of CASE statements.
-- These sub-queries must test the OwnerID from the EventTable
-- that's outside the sub-query rather than the OwnerID from the
-- EventTable that's inside the sub-query. I'm not quite sure why
-- this is so, but the query does not work correctly otherwise.
 
SELECT CASE E.OwnerType
       WHEN 0 THEN E.OwnerID      -- individual fact, get the PersonID
       END PersonID,
 
       CASE E.OwnerType   -- family fact, get the FatherID
       WHEN 1 THEN (SELECT F.FatherID
                    FROM FamilyTable AS F
                           JOIN
                         EventTable ON E.OwnerID = F.FamilyID)
       END FatherID,
 
       CASE E.OwnerType
       WHEN 1 THEN (SELECT F.MotherID   -- family fact, get the MotherID
                    FROM FamilyTable AS F
                           JOIN
                         EventTable ON E.OwnerID = F.FamilyID)
       END MotherID,
 
       FT.Name AS Fact,
       E.Sentence AS Sentence
FROM EventTable AS E
        JOIN
      FactTypeTable AS FT ON E.EventType = FT.FactTypeID
WHERE LENGTH(E.Sentence) > 0                                   -- test to see if sentence template exists
ORDER BY FatherID, MotherID, PersonID, E.DATE;

Duplicate Search Merge Database #datadefinitions #duplicates

RootsMagic 4+ creates a database file with the same root name as the .rmgc file but with the extension .DUP when Tools > Merge > Duplicate Search Merge is started. It contains one table that serves the Merge dialog until it is exited. This database is unused thereafter until the next Duplicate Search Merge is launched at which time it is emptied and re-filled. When in use, this database is ATTACHed to the main database connected to RM’s SQLite engine.

See Sheet: ‘DUP database’ on Database Design Spreadsheets.


Query: MarkNotProblem

-- MarkNotProblem.sql
-- 2010-02-21 ve3meo
-- equivalent to a hypothetical Select All not Merged and
-- mark as 'Not a Problem' in the Duplicate Search Merge dialog,instead
-- of having to hit Alt-N repeatedly.
-- Uses the database file RMdatabasename.DUP created by Duplicate Search Merge
-- to update the ExclusionTable.
-- Use it after merging all those that are truly duplicate (sets Merged flag=1).
 
ATTACH DATABASE 'path and filename of .DUP' AS DUP;
BEGIN TRANSACTION;
INSERT OR ROLLBACK INTO ExclusionTable
SELECT NULL, 1, ID1, ID2 FROM DupTable WHERE Merged=0
EXCEPT SELECT NULL,1,ID1,ID2 FROM ExclusionTable;
END TRANSACTION;
-- END SQL

MarkNotProblem.sql

Data Definitions #datadefinitions

RootsMagic 4+ Data Definitions

See spreadsheets “DataDefsMstr” and “DataDefsFieldSort” on Database Design Spreadsheets.

Discussions & comments from Wikispaces site


romermb

Adding To/Updating File

romermb
08 January 2010 21:35:48

A few of us so far have been trying to add the Notes, etc details to the various table fields in the file referenced in this page.

Much of being able to accurately describe the fields depends upon breadth of data in one’s RM4 database, as well as of features used within the software. The more and varied the data, the more likely that an accurate and complete portrayal of the database fields and values can be made. Sometimes just an extra pair of eyes can make a difference in seeing a particular aspect, as well.

Ultimately, the more people that are able to help try to validate the Notes added and to find any discrepancies or shortcomings in them, the better the contents of the file will become.

By the way, we chose the ODS format since it’s used by the spreadsheet software package contained within the OpenOffice suite and because a number of people are likely not to own Excel.

OO is similar in scope to Microsoft Office, but is freeware. It can be downloaded at http://www.openoffice.org.

I own Excel, but we found that opening an OO ODS file in Excel and saving in ODS format within Excel resulted in some issues/discrepancies between the products. As a result, I went ahead and downloaded OO in order to also be able to work in the Calc environment so that we’d all be able to contribute to saving a file without any worry of repurcussions.

Thanks very much for any help that anyone can provide, whether taking on defining of the Notes for fields within a table, making sure that all values for a field are represented and portrayed accurately, etc. Anyone using LDS support and/or nFS (particularly) within RM4 may be of real help.


romermb
romermb
25 January 2010 14:02:39

Well, our first pass through the fields in the RM4 database tables has been completed, so the hardest part and bulk of the work are essentially done. We managed to do so all during RM 4.0.7.1, which was fortunate since the database layout or behavior of fields, etc. may’ve potentially changed between releases.

I’ve just sent comments about observations made on some fields in tables that I didn’t submit within the ODS file, so corrections to some fields in those tables could be forthcoming. After that time, we’d all certainly appreciate others looking at the data in their various RM4 database tables/fields for variations. Any feedback relating to corrections to the field descriptions in the DataDefsMstr sheet of the ODS file would be most welcome.

Thanks very much for any contributions that you’re able to make!


ve3meo

ResearchTable: Correction of Status def

ve3meo
18 January 2010 16:15:04

I found the workbook really helpful in doing the To_Do query. Found and corrected errors in the Status def.

232 ResearchTable Status I 0-3 Status (Status, from Edit ToDo item screen (TaskType = 0): 0 = Open, 1 = Completed, 2 = Pending, 3 = Problem; Sent or Received, from Edit Correspondence screen (TaskType = 1): 0 = Sent, 1 = Received)


ve3meo

ve3meo
18 January 2010 16:24:59

Oops. I posted this without realising that Romer had uploaded a revised workbook so my corrections have yet to be incorporated. Great work, Romer!


ve3meo

CitationTable.Quality misrepresented on web page

ve3meo
18 January 2010 17:23:08

Three tildes in a row is used as an example of Quality (Don’t Know x3). Wikitext detects two tildes as a code for the user who last edited the page, e.g. ve3meo ve3meo , thus misrepresenting the value. Weird!


ve3meo

ve3meo
18 January 2010 19:36:22

Surrounding with backtick characters should do the trick:
ve3meo ve3meo or `ve3meo ve3meo`
ve3meo ve3meo Jan 18, 2010 oe `ve3meo ve3meo Jan 18, 2010`
ve3meo ve3meo or `~`~~ or `~~~`

But then it will look funny in the spreadsheet.


ve3meo

CitationTable.OwnerType = 7 ???

ve3meo
29 January 2010 14:21:47

I’ve encountered a few records in the CitationTable where the OwnerType=7. Some of them correspond to odd results in RM4’s Reports > Lists > Source List report:
1. The first (and sometimes only) listed citation for the source is the source itself.
2. In one case, a citation with a unique detail that shows in the Edit Person screen of a woman’s Alternate Name fact is reported against her husband’s Birth fact. The same source is cited with different detail for his Birth fact and is correctly reported.
3. There remain some others with the value 7 for which no anomalous behaviour is readliy detected in the Source List report.

The CitationTable.OwnerID value for these does not make any sense. They do not point to any relevant records in the same or any other table.


romermb

romermb
30 January 2010 06:13:39

Very strange! I couldn’t locate any in my database, but the only thing that I might suggest would be to go ahead and try the following query and see if any patterns emerge (or at least any thoughts as to how the sources themselves might’ve been used):

SELECT *
FROM CitationTable
LEFT OUTER JOIN SourceTable ON
CitationTable.SourceID = SourceTable.SourceID
WHERE CitationTable.OwnerType = 7


ve3meo

DataDefs for DUP database added.

ve3meo
21 February 2010 04:16:28

Spreadsheet revised with a sheet added for DUP database, the .DUP file created by the Duplicate Search Merge tool. maybe it should be integrated with the Master DataDefs sheet because it does function as a temporary table in relation with the permanent tables.


thejerrybryan

PersonTable.UniqueID

thejerrybryan
01 July 2011 15:35:28

PersonTable.UniqueID appears as hex in both SQLite and MS Access. The usual tricks to coerce it into appearing as text don’t seem to work – CAST for SQLite and StrConv – because the functions leave the UniqueID field in hex. Does anybody know how to coerce UniqueID into text?

Jerry


ve3meo

ve3meo
02 July 2011 03:52:16

UniqueID is a hex coded string, viz.the table def:
CREATE TABLE PersonTable (PersonID INTEGER PRIMARY KEY, UniqueID TEXT, …
I’m not sure what the problem is. Concatenating it with text results in text:
SELECT ‘UID=’||UniqueID FROM PersonTable;

Tom

RM Database Design #datadefinitions #database

RootsMagic 4+ Database Design

You will need to know a little about the RootsMagic database to design your own queries and modify others to suit your needs. A picture is worth many words so here is a series of Entity Relationship Diagrams by different authors:

RM9 Database Diagram #rm9 #database

Roots Magic 8 Database – Database Diagram

Entity Relationship Diagram for RootsMagic v7.5+ by Bill Girimonti, forum 2019-09-21

The following dig deeper into details but are not necessarily updated to the latest version:

File Typesinstalled and created by RootsMagic 4+
each .rmgc database fileTable Summariesrole of each table in the database
Database System Catalogtables and indexes along with SQL commands for their creation
Data Definitionsfield names and types, indexes, and keys from above in tabular form, expanded with typical values and notes on each field
Fact Typescontent of fresh facttypetable
Role Typescontent of fresh witnesstable
RootsMagic.stSource Templatesexternal file that defines built-in Citation Source templates in sourcetemplatetable
databasename.DUPDuplicate Search Merge Databasetemporary database with same filename as .rmgc file, created during Duplicate Search Merge

Database Documents

Version Monitoring: RM4 RM5 RM6
Database System Catalog: RM4 RM5 RM6
The following contain all versions, more or less.
Table Summaries
Data Definitions
Fact Types
Role Types
Source Templates
ConfigTable RecID 1
Duplicate Search Merge Database
Most of the spreadsheets used in the above pages are from the workbook: Database Design Spreadsheets. Refer to to it for latest updates.