-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Styles to 2015 or even 2021 BJCP Guidelines #125
Comments
This really needs to be done. Ugh. Guess I will play with it this weekend. |
How did it go with this? |
Still open, really. The BJCP has changed in the decade since beerXML was designed, and I couldn't find any reasonable mapping between the two. This sent me on one of my (unfortunately common) tirades about how horrible beerXML is. I then sat down and designed a JSON schema (for validation) for both BJCP and the Brewer's Association styles, hoping to leverage the work already done by brewerwall. I never could quite figure out how to combine the two schema definitions though. And there it sits, because every time I think about picking it up again, I start to get a headache. |
Is there any possibility to see the work you have done so far? Den 10 nov. 2016 5:18 fm skrev "mikfire" [email protected]:
|
https://github.com/mikfire/brewtarget/tree/feature/json Because I lack imagination, the files are in the json directory. If you want the input XML for the BJCP guide, you will need to get it from meanphil (https://github.com/meanphil/bjcp-guidelines-2015). I included the scripts I used to generate the JSON from XML (xmltojson.pl), as well as the script I was using to test the validation (validate.pl). |
I'm happy to work on this if it'll be helpful (no promises on actually doing anything useful, since I just started trying to develop BrewTarget a week or two ago). @mikfire, can you explain briefly explain what you're hoping to do with the JSON style definitions, once you have them? AFAICT, you're hoping to create on or more JSON files that are compatible with a modified version of From poking around the style table in default_db.sqlite, it seems like we're going to need to make a lot of changes to fully reflect the new style guides. The current schema doesn't include a The other issue I see is that the style numbers have changed significantly, so we need to completely overhaul the list of styles used. I imagine we'd go about it something like the following:
That was way more long-winded than I expected. Do these changes make sense, or am I over-thinking this somehow? |
The problems you mentioned at the beginning are why I gave up. I couldn't find any reasonable mapping from the current guides into the festering sore that is BeerXML. My goal was to use this as a launch pad to killing BeerXML and replacing it with something more in line with modern data exchange, something that could be validated, something that allowed us to easily consume external resources (like brewerwall and the BJCP XML files) so we didn't have to maintain this by hand, etc. In the order you put them forward, here are some ideaas:
|
If modifying the database is hard (and you know far better than I on this) it seems that we're stuck with the fact that BrewTarget's internal representation is based on BeerXML. I like your idea of pulling data from various external sources automatically, but we're still stuck with the fields we have within the working database. The easiest short-term solution would be to shoe-horn the more detailed descriptive features (aroma, flavor, mouthfeel, etc.) from BJCP 2015 into the Notes field in BeerXML and the BrewTarget style database. I'm thinking of using YAML for this so that all the fields are still user-readable if they get exported to other software. For now, it shouldn't be hard for me to write a Python script (or modify your Perl one) to format things into the appropriate format, and in the future this could be fully automated. The more complex change of automatically importing new styles and ingredients sounds really cool, but IMO isn't worth holding up the BJCP 2015 style guidelines at this point. |
Can't this be done manually? It's seemingly taking 2+ years to update this AND the BJCP hasn't been updated in that time so creating a script to do this once seems like a bit of a waste. Is it just cracking the SQLite and entering the data (and adding new fields/columns)? It would also be nice to either change category_number to something that sorts better or to add a leading zero. Give me direction and I'll go with it. |
OK, so after looking at this, I have a better understanding of most things.
|
I manually created/modified tables. Created style_category, deleted style_children, renamed style to style_subcategory. I then wrote a C# .NET to rip the XML and dump it into the new fields. Worked perfect. SO. Now comes the automation of all of that. Grab old data, create/modify tables, return old data, import new data. Apparently in Python? I'd rather not learn Python but I am willing to do all of the leg work with writing the SQLite comands if someone else will do the Python. If anyone is interested in looking at my file or the CREATE commands. I can get them to them. |
Not sure if it's in a useable format for brewtarget, but https://github.com/beerjson/beerjson/blob/master/tests/styles/bjcp_styleguide-2015.json might be of assistance. |
I took one look at it, YES. Formatted much better. Changing the database is turning into quite the sprawl. Edit here, edit there, create new here..... |
Aside from the database mapping or manual entry if it comes to it. @bdleedy Are you still working on this? I What I think would be great is to have style groups for the different organizations (BJCP 2008, bjcp 2015, GABF, Brewers association, etc). Then the style editor window should be outlined similar to the ingredients, where the style letter and category number are easily visible and sortable, and can be quicksearched by typing "american" or "pale" etc. This will give us more flexibility with changing styles, and increase workflow and usability. The window on the left (no idea what this is called in brewtarget) was updated during the 2.3->2.4 development but the style editor was not. |
I am not.
(Sent from my iPhone)
On Aug 22, 2018, at 10:44 AM, Mark Price <[email protected]> wrote:
Aside from the database mapping or manual entry if it comes to it. @bdleedy Are you still working on this? I
What I think would be great is to have style groups for the different organizations (BJCP 2008, bjcp 2015, GABF, Brewers association, etc). Then the style editor window should be outlined similar to the ingredients, where the style letter and category number are easily visible and sortable, and can be quicksearched by typing "american" or "pale" etc.
This will give us more flexibility with changing styles, and increase workflow and usability.
Ideally the ability to import/export styles should be available as well. If a small revision, or additional styles are created, they can be sent out via a style file instead of having to redownload an updated version of brewtarget just for a single style change.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I'm going to try and take this on. No promises, but I think I've figured out how to map the files from https://github.com/beerjson/beerjson/tree/master/tests/styles back into beerxml, at which point I can either pass it off to someone to mass add them to the brewtarget db, or else I can import them one by one if necessary. |
https://github.com/couchguy/BJCP-Style-Guide-to-BeerXML/blob/master/2018styles.xml Found this, appears to be formatted correctly! @dpettersson Should I just add these styles to my db manually then submit a PR with an updated db or is there a quicker way? |
Thanks for the link! Updated mine manually by truncating styles, then loading that file (sorted with python and umlauts removed). It exits the app when you import it, but it appears to work fine after doing a restore. |
@Wyrmwood can you submit a PR with the updated styles then? I never got around to doing it manually. |
Well, I removed the 2008 styles from mine... |
Gotcha. Well could you make a fork, or upload your db somewhere like Dropbox or something then I can just merge the two db. |
OK. Noticed some issues when I exported, so started over. Here's couchguy's, sorted and converted to utf-8, then imported to the default database, so it shows up after the 2008. Please Note: his is missing the specialty IPAs. After I add those back to mine, I'll post the xml file. |
2015_styles_ext.zip |
I have a suggestion about styles and some other resources. Maybe better add some function to app for loading such xml (or json) by user. So if somebody want to use bjcp 2008 or any other style library (or translated in native language) it can do it. We can ship resource xml (or json) file with program and load at first start or give user opportunity to do it by himself. |
@xzfantom The good news is that this functionality already exists. I'm doing some work to improve XML importing but I think even the current version of the software can import styles from BeerXML. If you do "File > Import Recipe", it can actually import not just recipes but any other BeerXML document, including styles, hops, etc. I am going to change the name of the menu item to "Import from File" to make this clearer. And my new version of the import will be a bit more robust (ie less likely to crash!) and more helpful about error messages and telling you what it has read in, but I'm not changing the base functionality. |
@matty0ung that's cool. I just started to learn BT and it's code so this part was not obvious) |
@xzfantom FYI, I took the "2015_styles_ext.zip" file uploaded by @Wyrmwood, extracted "2015_styles_ext.xml" and, with one small edit, was able to import all 142 style records into Brewtarget patched with #515. (The patch tells you how many records you imported, and will skip over duplicates if you try to import the same file twice by the way.) The edit was to insert the following line at the beginning of the file: |
I have added the BJCP 2021 styles to our default content as part of #799. |
The text was updated successfully, but these errors were encountered: