Closed ronaldtse closed 1 year ago
@ronaldtse should we just warn user that there is version without type, or return a document without type?
@andrew2net we should probably just warn user that there is a document does not have type, an return a failure in fetch.
@ronaldtse is this correct behaviour?
relaton fetch "ISO/TS 19103:2015"
[relaton-iso] ("ISO/TS 19103:2015") Fetching from ISO...
[relaton-iso] ("ISO/TS 19103:2015") TIP: No match for edition year 2015, but matches exist for 2005.
[relaton-iso] ("ISO/TS 19103:2015") Not found, trying without type ("ISO 19103:2015")...
[relaton-iso] ("ISO 19103:2015") Fetching from ISO...
[relaton-iso] ("ISO 19103:2015") TIP: Found without type, please use reference ("ISO 19103:2015").
No matching bibliographic entry found
@andrew2net can you change it to the following?
$ relaton fetch "ISO/TS 19103:2015"
[relaton-iso] ("ISO/TS 19103:2015") Fetching from ISO...
[relaton-iso] ("ISO/TS 19103:2015") TIP: No exact match. Trying modified identifiers...
[relaton-iso] ("ISO/TS 19103:2015") TIP: Matches exist for "ISO/TS 19103:2005", "ISO 19103:2015".
No matching bibliographic entry found
@ronald it could be many years of document versions. In that case we need to list all the possible years. I think better to have
[relaton-iso] ("ISO/TS 19103:2015") Fetching from ISO...
[relaton-iso] ("ISO/TS 19103:2015") TIP: No match for edition year 2015, but matches exist for 2005.
[relaton-iso] ("ISO/TS 19103:2015") TIP: Matches exist for "ISO/TS 19103:2005"
No matching bibliographic entry found
The relation-iso has also trying for ISO/IEC if ISO not found. In this case ISO/IEC document is returned if found. Should we keep this behavior? Or also return failure?
@ronaldtse I refactored the gem's warns. In case document is not found we get messages:
"(\"#{pubid}\") Not found."
# if there is/are document(s) with other years
"(\"#{pubid}\") TIP: No match for edition year #{pubid.year}, but matches exist for #{missed_years.join(', ')}."
# if there are documents without or with other type/stage/copublisher
"(\"#{pubid}\") TIP: Matches exist for #{other_ids}."
# if reference has part
"(\"#{pubid}\") TIP: If it cannot be found, the document may no longer be published in parts."
# if reference has no parts
"(\"#{pubid}\") TIP: If you wish to cite all document parts for the reference, use (\"#{pubid.to_s(format: :ref_undated)} (all parts)\")."
You can try it with a issue-147
branch. If everithing is ok, I'll merge the branc to main and release.
"(\"#{pubid}\") TIP: No match for edition year #{pubid.year}, but matches exist for #{missed_years.join(', ')}."
Can we give the full references of different edition years, so people can just copy and paste? Thanks.
Fixed in v1.15.5
$ relaton fetch "ISO/TS 19103:2015"
[relaton-iso] ("ISO/TS 19103:2015") Fetching from ISO...
[relaton-iso] ("ISO/TS 19103:2015") Not found.
[relaton-iso] ("ISO/TS 19103:2015") TIP: No match for edition year 2015, but matches exist for "ISO/TS 19103:2005".
[relaton-iso] ("ISO/TS 19103:2015") TIP: If you wish to cite all document parts for the reference, use ("ISO/TS 19103 (all parts)").
Thanks!
Can we make consistent the reference format for people to copy?
...TIP: No match for edition year 2015, but matches exist for "ISO/TS 19103:2005". ...TIP: If you wish to cite all document parts for the reference, use "ISO/TS 19103 (all parts)".
Thanks.
Can we make consistent the reference format for people to copy?
@ronaldtse what do you mean? Aren't "ISO/TS 19103:2005" and "ISO/TS 19103 (all parts)" references? We can place each reference in a separate line so people can select them with triple click and copy.
...TIP: No match for edition year 2015, but matches exist for:
ISO/TS 19103:2005
...TIP: If you wish to cite all document parts for the reference, use:
ISO/TS 19103 (all parts)
@andrew2net yes they are correct, but when we present them we should do it consistently. In the previous implementation, sometimes we use double quotes "..."
but sometimes we use parentheses (...)
to contain references. As long as we do them consistently, it's okay.
How about using backticks? (`...`
)
...TIP: No match for edition year 2015, but matches exist for: `ISO/TS 19103:2005`, [...]
...TIP: If you wish to cite all document parts for the reference, use: `ISO/TS 19103 (all parts)`
@ronaldtse Ok, I see. Let's use backticks for references.
@ronaldtse What if we use parentheses for user provided reference and backticks for TIPs and found reference?
[relaton-iso] (ISO/TS 19103:2015) TIP: No match for edition year 2015, but matches exist for `ISO/TS 19103:2005`.
[relaton-iso] (ISO 19115) Found `ISO 19115:2003`.
I think it's easier to read than:
[relaton-iso] (`ISO/TS 19103:2015`) TIP: No match for edition year 2015, but matches exist for `ISO/TS 19103:2005`.
[relaton-iso] (`ISO 19115`) Found `ISO 19115:2003`.
@andrew2net fully agree, let's do this.
Maybe it should be:
[relaton-iso] (query: "ISO 19115") Found `ISO 19115:2003`.
@ronaldtse in my opinion it's too verbose. The word "query" will be in each line. Displaying the query reference helps when async document searching is used. It shows which reference a message belongs to. I think any extra symbols will pollute logging.
Displaying the query reference helps when async document searching is used. It shows which reference a message belongs to.
Yes, so we need to keep showing the query reference anyway, just like now.
I think any extra symbols will pollute logging.
Maybe but the user may get confused what the first reference is...?
I agree that this works fine, let's do this:
[relaton-iso] (ISO 19115) Found `ISO 19115:2003`.
@andrew2net can I confirm that the messages are now consistent?
The word "query" will be in each line.
We could also use q: ...
instead. It's better for the user to know what's going on than not know.
@andrew2net can I confirm that the messages are now consistent?
They are consistent in the relaton-iso gem. Other relaton-* gems need to be updated.
We could also use
q: ...
instead. It's better for the user to know what's going on than not know.
Just (ISO 19115)
looks intuitive to me.
Actually, there are two identifiers that are similar:
I'm actually not sure what should be the default behavior. To best assist the user, I believe we should provide both in an "TIP:" message.
Perhaps the "edition year" is a better indicator than "doctype"?