Page 1 of 1

Ditaval + subject scheme: automatically filter parent subject

Posted: Wed May 10, 2017 3:13 pm
by jochemdevos
Hi all,

We're a bit stuck when working on a Taxonomy using a subject scheme. To try to understand this I've pulled out some demo data found at https://www.oxygenxml.com/doc/versions/ ... e-map.html

So the scheme is as follows:

Code: Select all

<subjectScheme>
<subjectdef keys="users">
<subjectdef keys="therapist">
<subjectdef keys="novice"/>
<subjectdef keys="expert"/>
</subjectdef>
<subjectdef keys="oncologist"/>
<subjectdef keys="physicist"/>
<subjectdef keys="radiologist"/>
</subjectdef>
<enumerationdef>
<attributedef name="audience"/>
<subjectdef keyref="users"/>
</enumerationdef>
</subjectScheme>
And the DITAVAL is as follows, for demo purposes:

Code: Select all

<val>
<prop action="exclude" att="audience" val="therapist" />
</val>
When profiling content (Select element, right click, edit profiling attributes) the audience attribute provides checkboxes as described by the scheme. When selecting a lower level subject to filter on, the parent is not automatically checked, which is okay I suppose as long as the processors can make the relation with the parent.

Question 1: When using 'Import from DITAVAL' to create a Profiling set, the filter in Author mode is applied as I would suspect: content flagged with 'novice', which is a novice therapist, is excluded. However, when running a PDF transformation with the DITAVAL set as filter it only excludes content tagged with 'therapist'. Why is this the case?

Question 2: Is it also possible to get this 'inherited filtering' when using the exclude unless included approach, e.g.:

Code: Select all

<val>
<prop action="exclude" att="audience"/>
<prop action="include" att="audience" val="therapist" />
</val>
Here's some demo content that I used:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic_vcz_2nm_vz">
<title>Test</title>
<body>
<p>Content marked with nothing</p>
<p audience="oncologist">Content marked with oncologist</p>
<p audience="therapist">Content marked with therapist</p>
<p audience="novice">Content marked with novice therapist</p>
</body>
</topic>
Thanks you, kind regards,
Jochem de Vos

Re: Ditaval + subject scheme: automatically filter parent subject

Posted: Wed May 10, 2017 4:01 pm
by Radu
Hi Jochem,

Support for filtering content based on subject schemes in the DITA Open Toolkit publishing engine is not really complete, so you may encounter various problems with it.
Please see some answers below:
When profiling content (Select element, right click, edit profiling attributes) the audience attribute provides checkboxes as described by the scheme. When selecting a lower level subject to filter on, the parent is not automatically checked, which is okay I suppose as long as the processors can make the relation with the parent.
Exactly.
Question 1: When using 'Import from DITAVAL' to create a Profiling set, the filter in Author mode is applied as I would suspect: content flagged with 'novice', which is a novice therapist, is excluded. However, when running a PDF transformation with the DITAVAL set as filter it only excludes content tagged with 'therapist'. Why is this the case?
The topicref to the subject scheme map needs to have the attribute type="subjectScheme" set on it otherwise the hierarchical filtering does not work. This is not required by the specification, it is a bug/limitation in the publishing engine.
Question 2: Is it also possible to get this 'inherited filtering' when using the exclude unless included approach, e.g.:
Not sure, you can try that after following the advice above.

Regards,
Radu

Re: Ditaval + subject scheme: automatically filter parent subject

Posted: Thu May 11, 2017 11:21 am
by jochemdevos
Thanks again for your help Radu.
Radu wrote:The topicref to the subject scheme map needs to have the attribute type="subjectScheme" set on it otherwise the hierarchical filtering does not work. This is not required by the specification, it is a bug/limitation in the publishing engine.
Perfect, including the type attribute did indeed filter the hierarchy properly during transformation. (exclude therapist when 'novice' is excluded in ditaval*)
Radu wrote:
Question 2: Is it also possible to get this 'inherited filtering' when using the exclude unless included approach, e.g.:
Not sure, you can try that after following the advice above.
Unfortunately this does not work. As I remember from documentation: the parent only inherits filtering if the ditaval does not specify what to do with it. It seems a general exclude (<prop action="exclude" att="audience"/>) gets priority over an include on a child subject (novice).

*edited: meant to say exclude instead of include

Re: Ditaval + subject scheme: automatically filter parent subject

Posted: Mon May 15, 2017 4:51 pm
by Radu
Hi Jochem,

I confirm your findings for (2), not sure if it's on purpose or a side effect of the Subject Scheme filtering support not being fully implemented.

Regards,
Radu

Re: Ditaval + subject scheme: automatically filter parent subject

Posted: Tue May 16, 2017 12:12 pm
by jochemdevos
Radu wrote: I confirm your findings for (2), not sure if it's on purpose or a side effect of the Subject Scheme filtering support not being fully implemented.
Hi Radu,

I guess this works as designed. Although I'm interested how you or others would work around this, for those that use a subjectscheme with nested subjectdef elements.

Kind regards,
Jochem de Vos