diegodlh / zotero-cita

Cita: a Wikidata addon for Zotero with citations metadata support
GNU General Public License v3.0
220 stars 10 forks source link

Problems with items that are instances of a subclass of a supported class #93

Open scannopolis opened 3 years ago

scannopolis commented 3 years ago

When I want to add a "cites work" that is not an academic work (i.e. a decision on a court case), Cita says that the element can't be added because the element is not supported.

See the work here: https://www.wikidata.org/wiki/Q106938937 (with the "cites work" there).

I'm guessing this is not an issue of Cita but rather of something else but would be interesting to see if something can be done about it -- some papers heavily cite court decisions or constitution clauses etc.

diegodlh commented 3 years ago

This is because getting citations from Wikidata relies on a custom translator (Wikidata JSON) widely based on Zotero's translator for Wikidata. This translator uses a map from Wikidata's "instance of" to Zotero's "item type".

In the example provided, one of the "cites work" statements points to item Q713593, which has "instance of" Q19692072 (United States Supreme Court decision). This "instance of" value is not mapped to any "item type" in the translator, hence Cita complains that the cited item is of an unsupported type. This occurs even though Q19692072 is a subclass of Q2334719 (legal case), which is mapped to item type "case" in the translator.

One possible solution would be to fix Zotero's Wikidata translator (or the custom Wikidata JSON) to support subclasses of supported "instance of" values. To do this, the map could include all subclasses of supported "instance of" values. Alternatively, a separate SPARQL query could be run to determine if an "instance of" value not found in the map is, in fact, a subclass of a supported value.

Another possible fix would be to change these translators to return item type "webpage" for unsupported "instance of" values, in a way similar to what the Zotero browser connectors do with non-supported sites (which are translated by generic translators as a "webpage" item).

diegodlh commented 3 years ago

Alternatively, consider asking the user how they would like to import these unsupported citation types. Maybe have one row per unsupported type, each indicating how many citations of that type were found, and a drop-down menu to choose among Zotero item types (plus an "ignore/do not import" option) to map to.

diegodlh commented 2 years ago

fix Zotero's Wikidata translator (or the custom Wikidata JSON) to support subclasses of supported "instance of" values

However, some items may be an instance of a class (not supported by the translator) which is a subclass of two or more classes mapped to different Zotero item types, as described here.

Another possible fix would be to change these translators to return item type "webpage" for unsupported "instance of" values

Using report as default item type may be considered as well. As stated in the Zotero documentation, "This item type can also be adapted to fit many types of unusual items."