FAQ for !CATEGORY and !KEYWORDS meta-statements
This FAQ should get you started with keywords and categories. If you have more questions, please ask on the LDraw forum.
What are '0 !CATEGORY' and '0 !KEYWORDS'?
Both !CATEGORY and !KEYWORDS are used exclusively in part files and subpart files. They don't appear in models or primitives. They provide information for organizing and searching the part library. Before the !CATEGORY and !KEYWORDS meta-statements were defined, the only way to organize the part library was by the descriptive name and part number. While useful, the name and number do not provide enough information to thoroughly catalog a large directory of parts (currently some 3000 files!).
What is the difference between !CATEGORY and !KEYWORDS, i.e. what belongs to the one and what to the other?
!KEYWORDS provides a method to associate freeform search terms with a part.
!CATEGORY is good for locating a part by drilling into the list of categories. !KEYWORDS are good for locating a part by doing text searches.
The Partsref pages (at http://guide.lugnet.com/partsref/) illustrate how both !KEYWORDS and !CATEGORY can be used. The list of categories on Partsref is based on the !CATEGORY entries in the LDraw parts, and Partsref's Search allows users to search for specific words and terms contained in the !KEYWORDS of parts (as well as their names, numbers, and categories).
What is the syntax for these two meta-statements?
The !CATEGORY meta-statement, if present, must appear in the part header, as defined by the LDraw.org Official Library Header Specification.
What is the exact purpose of the "0 !CATEGORY" statement?
More specifically, the 0 !CATEGORY meta-statement provides a way to specify the categorization/classification of parts in the LDraw parts library.
Currently, any program or service that recognizes 0 !CATEGORY uses it as a single-level classification. Whatever text is included after !CATEGORY is used as a single category name.
So if a part contained the statement:
it would specify that the part belongs in the category "Minifig Accessory".
Are there any "rules" for what you can put in 0 !CATEGORY?
Currently, the 'categories' of the LDraw parts library are mostly limited to the first word in each of the various part names. We will get beyond this, because the descriptive part names should not have to include all the classification information.
It's simpler/easier to have part names like "Minifig Sword" rather than "Minifig Accessory Sword". If a part has a 0 !CATEGORY setting, there is more freedom to give the part a name that is easy to use.
Is it allowed to name more than one category?
As the LDraw parts library continues to grow, the advantages of a multi-level classification system may become more obvious.
Why should category names be restricted to some kind of "official" list?
Everybody's got their own ideas for classifying LEGO pieces. Some categories are common ('basic brick', 'sloped piece', etc.). But most everyone is going to have some unusual categories for unusual pieces ('gizmo', '>10 studs', etc.) The LDraw classification should avoid these 'unusual' categories, since they tend to be non-intuitive for everyone except the person who thought of them.
Classification will be most useful when there is a balance between the number of categories, the number of parts in each category, and clear definition for each category. If every author defined their own categories, the overall classification would be much less clear.
What is the current list of categories?
But some of these default categories are less useful than they could be. Some are too narrow/small, such as 'Tap'. Some are not very useful for clear classification, such as 'Town' and 'Space'.
For new parts, the category names should be selected from the following list:
In the near future, this list will be changing, as more parts are deliberately classified. Overall, there should be fewer categories, with a better balance between the categories.
What is the purpose of the 0 !KEYWORDS meta-statement?
Any rules for !KEYWORDS?
We should probably start compiling a list of suggested keywords. Just like with categories, having standard keywords will make it easier to locate parts.
Do !KEYWORDS allow multiple entries?
Entries on a 0 !KEYWORDS meta-statement have to be comma-delimited. Any white-space should be reduced to a single space, and leading and trailing spaces on the keyword ignored.
Each entry can be any string of text. Most search-engines will probably perform searches on all the entries, as a single string of text. So internal delimiters are probably not all that important.
- Manfred Moolhuysen, initial question asker
© 2001-2018 LDraw.org, see Legal Info for details.
LEGO® is a registered trademark of the LEGO Group, which does not sponsor, endorse, or authorize this site. Visit the official Lego website at http://www.lego.com/.
The LDraw system is a completely unofficial, community run free CAD system which represents official parts produced by the LEGO company.
The LDraw Parts Tracker is maintained and developed by voluntary members of the LDraw organisation.