Reputation: 12736
The subjectScheme in DITA is a suitable format for creating a taxonomy of metadata, but how should it really be used? Specifically, my question regards the following:
Upvotes: 2
Views: 1432
Reputation: 643
I'm going to do my best to address your original questions. Overall, the subjectScheme specialization is designed to create subject classifications and controlled values. It has great functionality for defining subject classifications that can be used for retrieval, as well as defining and controlling attribute values. Currently, the DITA-OT only provides functionality in the area of controlled values for attributes.
Question: "Can it be used to represent metadata elements or only metadata attributes"?
Answer: I would not say that its purpose is to "represent elements or attributes". It is designed to represent subjects and controlled values. Its design is based on keys and so makes heavy use of attributes.
Question: If you want to add a definition for an attribute value, where do you do so?
Answer: You have several options for doing this:
Question: Can you use the subjectScheme specialization with metadata elements?
Answer: Yes. Off the top of my head, here is one immediate possibility and design for an HTML-based output format:
Question: Can you publish subject schemes?
Answer: Yes, if topics are referenced for subjectdef elements using the @href attribute. While by default, the @processing-role attribute for the subjectScheme element is set to "resource-only" and the @toc attribute is set to "no," you can modify those values and they will cascade throughout the map, making it possible to generate output. Of course, this is simply what one can currently do using the DITA-OT; with custom processing implementations, the possibilities are boundless.
I think subjectScheme maps and the classification domain offer lots of exciting possibilities, including faceted and filtered browsing (for output) and faceted searching (for DITA source).
I hope that people building implementations that make use of subjectScheme and classification will share stories, demo their implementations, and so forth. I think that would make what can be done with this part of the DITA architecture clearer and more accessible for people.
Upvotes: 5
Reputation: 760
As far as the DITA-OT goes, I think you can only use it for conditional processing (filtering and flagging) of elements using DITAVAL files.
I think subject scheme maps have far more potential than this. They could be used for faceted browsing so we could dispense with static topic maps. Static content just seems to belong to the pre-web era. DITA's slightly staid aura could be solved with this.
Anyway, here's what you can currently do:
Subject scheme map:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE subjectScheme PUBLIC "-//OASIS//DTD DITA Subject Scheme Map//EN" "map.dtd"> <subjectScheme> <hasInstance> <subjectdef keys="all_routes"> <subjectdef keys="every_route"> <subjectdef keys="anglia"/> <subjectdef keys="east_midlands"/> <subjectdef keys="kent"/> <subjectdef keys="lne_london_north_eastern"/> <subjectdef keys="lnw_london_north_western"/> <subjectdef keys="scotland"/> <subjectdef keys="wales"/> <subjectdef keys="sussex"/> <subjectdef keys="wessex"/> <subjectdef keys="western"/> </subjectdef> </subjectdef> </hasInstance> <enumerationdef> <attributedef name="route"/> <!-- Above is my new specialized attribute "routes"! --> <subjectdef keyref="all_routes"/> </enumerationdef>
Here is the topic text with the metadata:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA General Task//EN" "task.dtd"> <task id="task_ozd_ckn_qh"> <title>Route specialization test</title> <shortdesc route="">This tests the new route attribute!</shortdesc> <taskbody> <section> <title>Lines of text</title> <p route="anglia">Anglia text text text text text text.</p> <p route="sussex">Sussex text text text text text text.</p> <p route="east_midlands">East Midlands text text text text text.</p> <p route="kent">Kent text text text text text text.</p> <p route="lne_london_north_eastern"NE text text text text text text.</p> <p route="lnw_london_north_western">LNW text text text text text text.</p> <p route="scotland">Scotland text text text text text text.</p> <p route="sussex"Sussex text text text text text text.</p> <p route="wales">Wales text text text text text text.</p> <p route="western">Western text text text text text text.</p> <p route="wessex">Wessex text text text text text text.</p> <p route="every_route">Text.</p> <p>Not profiled.</p> </section> </taskbody>
Here's the DITAVAL filter:
<prop action="exclude" att="route"/> <prop action="include" att="route" val="scotland"/>
This will knock out all the other routes except the route marked with "scotland".
That's basically it.
You can add metadata into the subject scheme map like this:
<subjectdef keys="story_attributedef"> <subjectdef keys="monster"> <hasKind> <subjectdef keys="zarbi" href="glossary/contemporary.dita"> <topicmeta> <navtitle>The Zarbi</navtitle> <shortdesc>Ant-like creature</shortdesc> </topicmeta> </subjectdef>
Subject scheme maps are rendered as "resource-only" (whether they have that value or not) so it's not suitable for rendering.
Upvotes: 2