Topic on User talk:Dhx1

instance or subclass of

8
Summary by Lucas Werkmeister (WMDE)

Removed instance or subclass of (Q30208840) from documentation again for now, and created phab:T169858.

Lucas Werkmeister (WMDE) (talkcontribs)

Hi! I just saw these three edits on the constraints documentation – can we discuss them?

  1. If you want to add a feature to the constraint checks, please open a task on Phabricator. Someone needs to add support for instance or subclass of (Q30208840) (currently, that would be me), and they might not even watch those documentation pages, or they might not check their Watchlist very often. I don’t like finding out about work I need to do in this way :)
  2. What is the intended meaning of instance or subclass of (Q30208840)? From the label, I assume that it’s the union of instance of (Q21503252) and subclass of (Q21514624) – the item can be an instance of the class, or a subclass of the class, and either way is fine. But in this edit, “a direct instance, subclass or instance of a subclass of the class” sounds like some other interpretation: it sounds like instance of (Q21503252) means “direct instance”, subclass of (Q21514624) means “direct subclass” and instance or subclass of (Q30208840) means “indirect instance” (instance of subclass). But that doesn’t match the current interpretation of instance of (Q21503252) and subclass of (Q21514624) at all: currently, those mean “direct or indirect instance” and “direct or indirect subclass”.
Jura1 (talkcontribs)

It's one that eventually needs to be created

Dhx1 (talkcontribs)

Oops, I had assumed that instance or subclass of (Q30208840) was official as I could see it in use on a few items already. I see some potential definitions:

  1. instance of (Q21503252) - the target item has a claim of instance of (P31) "class" (direct instance of (P31))
  2. subclass of (Q21514624) - the target item has a claim of subclass of (P279) "class" (direct subclass of (P279))
  3. instance or subclass of (Q30208840) - the target item has a claim of either instance of (P31) "class" or subclass of (P279) "class" (direct instance of (P31) or direct subclass of (P279))
  4. NotYetCreated - the target item has a claim of instance of (P31) "X" where "X" is either "class" or a subclass of (P279) "class" or one of its children (indirect instance of (P31) where recursion/any level of ancestor of "class" is OK)
  5. NotYetCreated - the target item has a claim of subclass of (P279) "X" where "X" is either "class" or a subclass of (P279) "class" or one of its children (indirect subclass of (P279) where recursion/any level of ancestor of "class" is OK)
  6. NotYetCreated - the target item has either a claim of instance of (P31) "X" or subclass of (P279) "X" where "X" is either "class" or a subclass of (P279) "class" or one of its children (indirect subclass of (P279) where recursion/any level of ancestor of "class" is OK)
Lucas Werkmeister (WMDE) (talkcontribs)

instance of (Q21503252) means “direct or indirect instance”, and subclass of (Q21514624) means “direct or indirect subclass” (your definitions 4 and 5). This has been their implementation for two years in the WikibaseQualityConstraints extension (except that they used to be template parameters relation=instance and relation=subclass), and I’m pretty sure that’s also how the database reports interpret them (but let’s ping User:Ivan A. Krestinin to confirm).

“direct instance” and “direct subclass” can both easily be implemented with item requires claim constraint (Q21503247) (type) or value requires claim constraint (Q21510864) (value type), and I only know of one or two classes that shouldn’t have any subclasses (human (Q5) and possibly taxon (Q16521)), so I don’t think it’s necessary to add extra support for these constraint types.

Do you have an example for a property where a “instance or subclass” constraint makes sense? I’m skeptical of this, because it feels like an indicator of a broken ontology to me.

Jura1 (talkcontribs)
Lucas Werkmeister (WMDE) (talkcontribs)

I know what it means, I want to know why it’s needed :) and the “occupation”/“profession” example looks exactly like what I thought, an unclear ontology that should be cleaned up instead of “sweeping it under the rug” with “instance or subclass of”…

On the other hand, the from fictional universe (P1080) and Sandrart.net person ID (P1422) examples are much more convincing, so I’ve created phab:T169858. Thanks for the link!

Dhx1 (talkcontribs)
Lucas Werkmeister (WMDE) (talkcontribs)

Good point, thanks – I’ve added it.