# bugreports\_EnvAndUrb test seems contrary to disambiguation rules

**URL:** <https://discourse.citationstyles.org/t/bugreports-envandurb-test-seems-contrary-to-disambiguation-rules/1801>\
**Category:** CSL Development\
**Created:** [March 9, 2023, 1:17am UTC](https://discourse.citationstyles.org/t/bugreports-envandurb-test-seems-contrary-to-disambiguation-rules/1801 "2023-03-09T01:17:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason-Abbott](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/jason-abbott/32/449_2.png) [@Jason-Abbott](https://discourse.citationstyles.org/u/Jason-Abbott)\
**Post date:** [March 9, 2023, 1:17am UTC](https://discourse.citationstyles.org/t/bugreports-envandurb-test-seems-contrary-to-disambiguation-rules/1801/1 "2023-03-09T01:17:29Z")

</div>

[Here is a link to the test](https://github.com/citation-style-language/test-suite/blob/0c366b60b35bd20cdc9d1a1e3b9c04756645868f/processor-tests/humans/bugreports_EnvAndUrb.txt)

It expects the output to be

```auto
>>[0] Baines, T S, O Benedettini and J M Kay, ‘Title One’; Baines, T S, F Gump and J M Kay, ‘Title Two’.
..[1] See reference 1, Baines et al.
>>[2] See reference 1, Baines et al.

```

These are still ambiguous because

- Note [1] refers to the _first_ cite in note [0], and
- Note [2] refers to the _second_ cite in note [0]

It needn’t be that way because the CSL offers two `<if disambiguate="true”>` elements. One adds the author and the other adds the title. The title _would_ disambiguate.

The [rule](https://docs.citationstyles.org/en/stable/specification.html#choose) for `<if disambiguate="true”>` elements is

> element content is only rendered if it disambiguates two otherwise identical citations

By that rule, it seems the output of the test should be

```auto
>>[0] Baines, T S, O Benedettini and J M Kay, ‘Title One’; Baines, T S, F Gump and J M Kay, ‘Title Two’.
..[1] See reference 1, ‘Title One’.
>>[2] See reference 1, ‘Title Two’.

```

The test is keeping the choice that _does not_ disambiguate and discarding the choice that _does_. Why?

This is the relevant CSL:

```xml
<group delimiter=", ">
	<text variable="first-reference-note-number" prefix="See reference "/>
	<choose>
		<if disambiguate="true">
			<names variable="author">
				<name form="short" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="never" et-al-min="3" et-al-use-first="1" initialize-with=" "/>
			</names>
		</if>
	</choose>
	<choose>
		<if disambiguate="true">
			<text variable="title" quotes="true" text-case="title" form="short"/>
		</if>
	</choose>
</group>

```

---

<div class="post-metadata">

**Author:** ![Sebastian\_Karcher](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/sebastian_karcher/32/176_2.png) [@Sebastian\_Karcher](https://discourse.citationstyles.org/u/Sebastian_Karcher)\
**Post date:** [March 9, 2023, 2:05am UTC](https://discourse.citationstyles.org/t/bugreports-envandurb-test-seems-contrary-to-disambiguation-rules/1801/2 "2023-03-09T02:05:44Z")

</div>

I agree this doesn’t seem right (presumably that’s why there was a bug report?). Maybe @Frank_Bennett recalls or can reconstruct the logic of the test from the initial note?

---

<div class="post-metadata">

**Author:** ![Jason-Abbott](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/jason-abbott/32/449_2.png) [@Jason-Abbott](https://discourse.citationstyles.org/u/Jason-Abbott)\
**Post date:** [March 9, 2023, 2:29am UTC](https://discourse.citationstyles.org/t/bugreports-envandurb-test-seems-contrary-to-disambiguation-rules/1801/3 "2023-03-09T02:29:27Z")

</div>

I am also wondering now why the first citation should be

> Baines, T S, O Benedettini and J M Kay, ‘Title One’; Baines, T S, F Gump and J M Kay, ‘Title Two’

rather than

> Baines, Benedettini and Kay, ‘Title One’; Baines, Gump and Kay, ‘Title Two’.

Baines and Kay are the same person in both cites (or at least have the same complete name) and the style has `<name initialize="false”/>`.

Maybe that too is part of the bug? Or I could well be missing something.

For now I’m editing my local copy of the test to

```auto
>>===== RESULT =====>>
>>[0] Baines, Benedettini and Kay, ‘Title One’; Baines, Gump and Kay, ‘Title Two’.
..[1] See reference 1, ‘Title One’.
>>[2] See reference 1, ‘Title Two’.
<<===== RESULT =====<<

```

and tagging it for follow-up so I can move on. 🙂

---

<div class="post-metadata">

**Author:** ![zepinglee](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/zepinglee/32/278_2.png) [@zepinglee](https://discourse.citationstyles.org/u/zepinglee)\
**Post date:** [June 25, 2023, 5:30am UTC](https://discourse.citationstyles.org/t/bugreports-envandurb-test-seems-contrary-to-disambiguation-rules/1801/4 "2023-06-25T05:30:28Z")

</div>

> [@Jason-Abbott](#):
>
> By that rule, it seems the output of the test should be
> 
> ```auto
> >>[0] Baines, T S, O Benedettini and J M Kay, ‘Title One’; Baines, T S, F Gump and J M Kay, ‘Title Two’.
> ..[1] See reference 1, ‘Title One’.
> >>[2] See reference 1, ‘Title Two’.
> 
> ```

I agree.

> [@Jason-Abbott](#):
>
> I am also wondering now why the first citation should be
> 
> > Baines, T S, O Benedettini and J M Kay, ‘Title One’; Baines, T S, F Gump and J M Kay, ‘Title Two’
> 
> rather than
> 
> > Baines, Benedettini and Kay, ‘Title One’; Baines, Gump and Kay, ‘Title Two’.
> 
> Baines and Kay are the same person in both cites (or at least have the same complete name) and the style has `<name initialize="false”/>`.

The cites in the the first note match `position="first"` and the `<else>` branch takes effect (see `position` attribute in [https://docs.citationstyles.org/en/stable/specification.html#choose](https://docs.citationstyles.org/en/stable/specification.html#choose)). Thus the `<name>` in that branch doesn’t have `form="short"` and the names are rendered with all parts.

```xml
      <choose>
        <if position="subsequent">
          ...
        </if>
        <else>
          <group delimiter=", ">
            <names variable="author">
              <name and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="never" initialize-with=" " name-as-sort-order="first" initialize="false"/>
            </names>
            <text variable="title" quotes="true"/>
          </group>
        </else>
      </choose>

```

---

<div class="post-metadata">

**Author:** ![zepinglee](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/zepinglee/32/278_2.png) [@zepinglee](https://discourse.citationstyles.org/u/zepinglee)\
**Post date:** [June 26, 2023, 7:45am UTC](https://discourse.citationstyles.org/t/bugreports-envandurb-test-seems-contrary-to-disambiguation-rules/1801/5 "2023-06-26T07:45:35Z")

</div>

> [@Jason-Abbott](#):
>
> It needn’t be that way because the CSL offers two `<if disambiguate="true”>` elements. One adds the author and the other adds the title. The title _would_ disambiguate.
> 
> The [rule](https://docs.citationstyles.org/en/stable/specification.html#choose) for `<if disambiguate="true”>` elements is
> 
> > element content is only rendered if it disambiguates two otherwise identical citations
> 
> By that rule, it seems the output of the test should be
> 
> ```auto
> >>[0] Baines, T S, O Benedettini and J M Kay, ‘Title One’; Baines, T S, F Gump and J M Kay, ‘Title Two’.
> ..[1] See reference 1, ‘Title One’.
> >>[2] See reference 1, ‘Title Two’.
> 
> ```

In [`disambiguate_IncrementalExtraText.txt`](https://github.com/citation-style-language/test-suite/blob/759e6fd0e1ba2a7d11489e54062a85c57a42bb63/processor-tests/humans/disambiguate_IncrementalExtraText.txt), the contents of `<if disambiguate="true">` branches are added incrementally for disambiguation method (3). This means the reasonable result for `bugreports_EnvAndUrb.txt` should be as follows.

```auto
>>[0] Baines, T S, O Benedettini and J M Kay, ‘Title One’; Baines, T S, F Gump and J M Kay, ‘Title Two’.
..[1] See reference 1, Baines et al., ‘Title One’.
>>[2] See reference 1, Baines et al., ‘Title Two’.

```
