I have some old SRG [incr tsdb()] profiles, and when I load them and try to use the logon version of the SRG with them, I get this error message when trying to click on a sentence to parse it: “out-of-date profile `mrs’” (or any other profile name; it’s not just the MRS one). Can I do something about this? The grammar generally works, i.e. if I enter the same sentence in the parse window, it will be parsed.
The profiles look normal to me, but I don’t know; what should I check about them?.. Or what further information I could provide here for someone to give me advice?
The [incr tsdb()] database schema has changed over time, and I think this message means that the profiles are using an older version of the schema. I wouldn’t be surprised if there were a conversion tool that can update profiles in pydelpin, but I wouldn’t know how to invoke it if so.
You can see what has changed in the schema by comparing the `relations’ file in that old profile with the one that appears when you create a new profile. Sometimes the number of fields in one of the tables has been increased by one or two, and it is possible to use a simple script to add those empty fields to each line of the relevant table in your old profile. (Of course it is safer to reparse that profile and update any annotations, but that can be more work.)
@Dan’s advice to check the relations file before refreshing the profile is good, in case there are any important changes requiring manual steps. If that’s not the case, see below…
Correct. You just need to use delphin mkprof with the new relations file. You can either make a new profile or overwrite the old one with the following commands:
[incr tsdb()] does not really work with arbitrary changes as described above. It has a hard-coded notion of what a relations file contains. It has some support to import from old profiles but won’t write to profiles with relations files not matching what it currently has. So when you refresh you probably want to use the official relations file (I think I use http://svn.delph-in.net/trunk/lingo/lkb/src/tsdb/skeletons/english/Relations for this).
You can add --gzip to the command to compress non-empty files. The original files may have been compressed, and running the command above without --gzip will decompress them.
I appreciate all the responses, thanks, especially @Dan and @goodmami !
I am still confused though, because I think I am still missing the principle understanding of how this is supposed to work.
In principle, is the same (up-to-date) Relations file supposed to work for any test suite?.. I guess not, I guess there is something unique to each one, and for that reason, it should be automatically created each time, using some robust tools?.. I thought, however, that it was the former, but copying a Relations file from a profile that does work currently leads to error “arity mismatch for item (X)”.
@goodmami I appreciate the detailed instructions. I have not tried them yet, but only because I want to first better understand what is it that I would be doing and why :).
As I understand it, the Relations file lays out the structure of the database — gives an explanation of the fields in each of the other files. When the structure is updated, not only does the Relations file change, but one or more of the other files ends up with more/different/fewer fields. So, the scripts take existing profiles (matching an old Relations file) and make the required adjustments.
@ebender is exactly right. The relations file is the database schema. Just as you cannot simply swap out the schema in a SQLite (MySQL, Postgresql, etc.) databases and have it work, you cannot just swap out the relations file, but rather the database needs to be rebuilt following the new relations file. This is what the delphin mkprof command shown above does.
You may also find these documentation pages informative:
Thanks, @goodmami ! I’ve read that documentation but it presupposes some knowledge about databases, e.g. some intuition about what a “database schema” is (which is not that difficult to obtain, I guess, but one still needs to know what to look for first…)
I’ll try to figure all this out now and will report back :).
@olzama that error occurs when the relations file inside a profile doesn’t match the data that’s there. It seems like maybe a newer relations file was copied into the profile without updating it. You should try to put the old relations file back and try again.
Alright! In the end, I got to the result I wanted (being able to load an old profile in [incr tsdb()] and running the grammar over the items that it contains) as follows: