Source Webtags and Media

Quote from Matt Wilkins on 2023-03-02, 3:54 pmHi,
I am using RM8 (now RM 9) to copy source webtags and sources to Familysearch.
I would also like to start using RM 9 to upload a tree to Ancestry.com. The problem I have found is that Ancestry wants the source media and source webtags to be on the citation instead (You can't upload source media to ancestry). I tried looking through the stored files but could not find what I needed (stored sql files here). I would like to copy all the attached source media and source webtags to the citation. (my sources are split not lumped so all source media/webtags apply to the solitary citation).
Thanks,
Matt Wilkins
Hi,
I am using RM8 (now RM 9) to copy source webtags and sources to Familysearch.
I would also like to start using RM 9 to upload a tree to Ancestry.com. The problem I have found is that Ancestry wants the source media and source webtags to be on the citation instead (You can't upload source media to ancestry). I tried looking through the stored files but could not find what I needed (stored sql files here). I would like to copy all the attached source media and source webtags to the citation. (my sources are split not lumped so all source media/webtags apply to the solitary citation).
Thanks,
Matt Wilkins

Quote from Tom Holden on 2023-03-02, 7:01 pmHi Matt, with only one citation per source, that should be readily doable as a one-shot for each of the media and webtags.
Hi Matt, with only one citation per source, that should be readily doable as a one-shot for each of the media and webtags.

Quote from Matthew Friend on 2023-03-02, 7:07 pmMaybe this one you wrote can be edited to copy from source to citation instead of citation to source:
https://sqlitetoolsforrootsmagic.com/wp-content/uploads/asgarosforum/730/WebTags-CopyCitations_to_Source-RM8.sql
Matthew
Maybe this one you wrote can be edited to copy from source to citation instead of citation to source:
Matthew

Quote from Matt Wilkins on 2023-03-02, 7:38 pmThe sources are split so each has one citation. While most have one source media and one source webtag, some do have a few media and more than one source webtag.
Matt
The sources are split so each has one citation. While most have one source media and one source webtag, some do have a few media and more than one source webtag.
Matt

Quote from Tom Holden on 2023-03-02, 11:27 pmThat took me a little longer than I thought doing the Media Tags. Haven't touched the WebTags yet and, must admit, I'd forgotten about the Feb 24 script (creeping senility, I guess).
Here's what I worked up for the media.
That took me a little longer than I thought doing the Media Tags. Haven't touched the WebTags yet and, must admit, I'd forgotten about the Feb 24 script (creeping senility, I guess).
Here's what I worked up for the media.
Uploaded files:
Quote from Matt Wilkins on 2023-03-03, 12:50 pmTom:
Thanks, the Media files are all copied to the citation media now.
Matt
Tom:
Thanks, the Media files are all copied to the citation media now.
Matt
Uploaded files:
Quote from Tom Holden on 2023-03-03, 10:55 pmGood to know. I've yet to start on the WebTags. I'm playing with an Entity Relationship Diagram and updating some metadata about RM8 and RM9.
Good to know. I've yet to start on the WebTags. I'm playing with an Entity Relationship Diagram and updating some metadata about RM8 and RM9.

Quote from Matt Wilkins on 2023-03-03, 11:04 pmTom: I tried reversing the Ownertype (the 3 and 4) for citations/source and some other combinations of 3 for source and 4 for citation but it didn't seem to work right. Do I need to modify something other than swapping the 3 and 4?
--WebTags-CopyCitations_to_Source-RM8.sql /* 2023-02-24 Tom Holden ve3meo Having done extreme splitting on Sources, user wanted to copy WebTags from Citations to Sources. Repeated use of this script results in duplication so it is advisable to run the script WebTags-DeleteDuplicates-RM8.sql afterwards. URL Owner Type (0 = Individual, 3 = Source, 4 = Citation, 5 = Place, 15 = Research Item) */ INSERT OR REPLACE INTO URLTable ------- Citation WebTags -------- WITH LastEditDate AS (SELECT julianday('now') - 2415018.5 AS LastEditDate) -- to get one value for all new webtags SELECT DISTINCT NULL AS LinkID --,Src.Name -- for debugging SELECT ,3 AS OwnerType --Source ,Src.SourceID ,URL.LinkType ,URL.Name ,URL.URL ,URL.Note ,LastEditDate AS UTCModDate --URL.UTCModDate FROM URLTable AS URL, LastEditDate JOIN CitationLinkTable AS CL ON URL.OwnerID = CL.LinkID AND URL.OwnerType=4 JOIN CitationTable AS Cit USING(CitationID) JOIN SourceTable AS Src USING(SourceID) ;
Tom: I tried reversing the Ownertype (the 3 and 4) for citations/source and some other combinations of 3 for source and 4 for citation but it didn't seem to work right. Do I need to modify something other than swapping the 3 and 4?
--WebTags-CopyCitations_to_Source-RM8.sql
/* 2023-02-24 Tom Holden ve3meo
Having done extreme splitting on Sources,
user wanted to copy WebTags from Citations to Sources.
Repeated use of this script results in duplication so it is advisable to
run the script WebTags-DeleteDuplicates-RM8.sql afterwards.
URL Owner Type (0 = Individual, 3 = Source, 4 = Citation, 5 = Place, 15 = Research Item)
*/
INSERT OR REPLACE INTO URLTable
------- Citation WebTags --------
WITH LastEditDate AS
(SELECT julianday('now') - 2415018.5 AS LastEditDate) -- to get one value for all new webtags
SELECT DISTINCT
NULL AS LinkID
--,Src.Name -- for debugging SELECT
,3 AS OwnerType --Source
,Src.SourceID
,URL.LinkType
,URL.Name
,URL.URL
,URL.Note
,LastEditDate AS UTCModDate --URL.UTCModDate
FROM URLTable AS URL, LastEditDate
JOIN CitationLinkTable AS CL
ON URL.OwnerID = CL.LinkID AND URL.OwnerType=4
JOIN CitationTable AS Cit
USING(CitationID)
JOIN SourceTable AS Src
USING(SourceID)
;

Quote from Tom Holden on 2023-03-03, 11:53 pmOK, I should be in bed. Try this - I haven't checked but it might work.
OK, I should be in bed. Try this - I haven't checked but it might work.
Uploaded files:
Quote from Matt Wilkins on 2023-03-04, 10:33 amThanks Tom, That copied them perfectly. I spot check a dozen or so ancestors and their attached citations/media and looks great.
Matt
Thanks Tom, That copied them perfectly. I spot check a dozen or so ancestors and their attached citations/media and looks great.
Matt