Quantcast

Apply Citation in bulk?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Apply Citation in bulk?

Ron Johnson
I want add a Citation to every Person with a specific tag. Unfortunately,
that's 886 people, so manually doing it, even via the clipboard, seems out
of the question.

So, is there any other method of adding a citation to all these people
besides "drag from the clipboard, and then remove tag" 886 times?  Maybe
write a program to directly manipulate an XML backup file which I'd then
import into a new tree?

Or should I wait for Gramps v5.0 which might let me manipulate the sqlite
database from outside of Gramps?

Thanks

--
World Peace Through Nuclear Pacification


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Apply Citation in bulk?

Gil da Costa
On 31/03/2017 06:50, Ron Johnson wrote:

> I want add a Citation to every Person with a specific tag. Unfortunately,
> that's 886 people, so manually doing it, even via the clipboard, seems out
> of the question.
>
> So, is there any other method of adding a citation to all these people
> besides "drag from the clipboard, and then remove tag" 886 times?  Maybe
> write a program to directly manipulate an XML backup file which I'd then
> import into a new tree?
>
> Or should I wait for Gramps v5.0 which might let me manipulate the sqlite
> database from outside of Gramps?
>
> Thanks
>
I'm also waiting for an SQL database, although it will not probably be
easy to use, as it seems that dates are stored as BLOBs...

In the meantime, I discovered XPath/XQuery, which permits to use the XML
export as a database, for example with tools like "BaseX" and "XmlStarlet".

Of course, it's yet an other technology to learn. Furthermore, it does
not solve the issue of manipulating dates, as it's just a character
string in the XML file.


G.Da Costa


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Apply Citation in bulk?

enno
In reply to this post by Ron Johnson
Hello Ron,

> I want add a Citation to every Person with a specific tag. Unfortunately,
> that's 886 people, so manually doing it, even via the clipboard, seems out
> of the question.
>
> So, is there any other method of adding a citation to all these people
> besides "drag from the clipboard, and then remove tag" 886 times?  Maybe
> write a program to directly manipulate an XML backup file which I'd then
> import into a new tree?
>
> Or should I wait for Gramps v5.0 which might let me manipulate the sqlite
> database from outside of Gramps?
Gramps 5.0 won't solve your problem, because the optional SQLite
database still stores Python objects, meaning that you can't see much in
the person table with the standard SQLite tools.

You can however export your current 3.4 or 4.2 database to a normalized
SQLite database using an add-on, which can also import from the same
database. And since this format is normalized, you should be able to use
any available tool that supports SQLite to select the persons with those
tags, and attach a citation to them.

I have not tested this much yet, but the add-on should be able to do an
export and import without loosing anything. It's up to you to figure out
how the database is structured, and see whether you want to attach an
existing citation, which is probably the easiest, or attach a new one
using plain SQL.

As long as you import into a new tree, I think the method itself is
pretty safe.

regards,

Enno


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Apply Citation in bulk?

Gerhard Killesreiter
Am 01.04.2017 um 14:20 schrieb Enno Borgsteede:

> Hello Ron,
>> I want add a Citation to every Person with a specific tag. Unfortunately,
>> that's 886 people, so manually doing it, even via the clipboard, seems out
>> of the question.
>>
>> So, is there any other method of adding a citation to all these people
>> besides "drag from the clipboard, and then remove tag" 886 times?  Maybe
>> write a program to directly manipulate an XML backup file which I'd then
>> import into a new tree?
>>
>> Or should I wait for Gramps v5.0 which might let me manipulate the sqlite
>> database from outside of Gramps?
> Gramps 5.0 won't solve your problem, because the optional SQLite
> database still stores Python objects, meaning that you can't see much in
> the person table with the standard SQLite tools.
>
> You can however export your current 3.4 or 4.2 database to a normalized
> SQLite database using an add-on, which can also import from the same
> database. And since this format is normalized, you should be able to use
> any available tool that supports SQLite to select the persons with those
> tags, and attach a citation to them.
>
> I have not tested this much yet, but the add-on should be able to do an
> export and import without loosing anything. It's up to you to figure out
> how the database is structured, and see whether you want to attach an
> existing citation, which is probably the easiest, or attach a new one
> using plain SQL.
>
> As long as you import into a new tree, I think the method itself is
> pretty safe.
>

I'd make double sure to have a backup in any case. I've found issues
with the 3rd party addon.

If you'd want to use some external tool to operate on Gramps data I'd
work on the XML storage files. The im- and export of these gets tested
by the gramps developers after all.

Cheers,
Gerhard



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Apply Citation in bulk?

enno
Op 1-4-2017 om 14:46 schreef Gerhard Killesreiter:
> I'd make double sure to have a backup in any case. I've found issues
> with the 3rd party addon.
Can you elaborate on that? The SQLite add-ons were made by Doug Blank,
who also is the main author of the new DB API that supports BSDDB and
SQLite (and other DBs) in Gramps 5.0, so I expect them to be quite well
tested. Did you loose data with them, and if so, was that in 3.4 or 4.2?

> If you'd want to use some external tool to operate on Gramps data I'd
> work on the XML storage files. The im- and export of these gets tested
> by the gramps developers after all.
I have considered that too, and it would be a nice way to get more
experience with C#, which I already use in my job. I'm not doing much
with XML there at the moment, but it may sure help me to get more out of
Visual Studio.

Are there any other tools that you can recommend for XML? I mainly run
Gramps 3.4 in Linux Mint, but work with Windows too.

thanks,

Enno


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Loading...