[09:10:29] good morning. I've got a query that returns organizations (i.e., p31/p279 has an id of wd:Q4830453) - yet a lot of the instances returned by this have the more specific type in the p31 snak (i.e., "this is a hotel," not "this is an organization"). Is there a good way to work out that the particular values for p31 in question *derive from* Q4830453? I can manually resolve the types, but if there's a [09:10:30] programmatic derivation I'd like to use that instead [09:19:12] (I will need to do this for p31 with a type of Q5, too, i.e., detecting both organizations *and* people separately) [09:48:25] mevodad: what do you mean by 'work out' ? [09:51:53] LotR: well, okay. So I request an entity, let's say Q1630833, it has a claim of P31, which is the type. The actual type of the ID is Q27686, which is "hotel." Q27686 is a subclass of Q4830453 (not sure of the exact derivation, but it's there somewhere): a Q27686 *is a* Q4830453. I know this, but my *code* does not. [09:52:30] I would like to figure out how I can tell my code how to recognize that derivations of Q4830453 are organizations. [09:53:08] If I was doing RDF (and I'm... trying not to, in the code) I could just say "oh, tell me if this is an instance of..." using a reasoner. [09:54:15] I have an alternative approach but it's brute force; a reasoner will be exorbitantly expensive to use *especially* for this sole purpose (and since I need to consider many, many entities of different types). [09:55:11] I also want to avoid hitting wikidata more than I already do; I have a throttle in place to respect wikidata TOS, but it's already VERY MUCH a limiting factor, and adding to it seems unwise if I have an alternative (and I do: the brute force method) [09:56:08] (I have a seed query that returns all organizations; what I'm doing in "brute force" is just *assigning the type* from that query. This is unworkable for types not contained in that seed query.) [10:23:51] mevodad: but you're asking for instances(P31) of subclasses(P279) of business(Q4830453) Why do you need to then verify that the answers you get are in fact instances of subclasses of business? [11:39:15] LotR: that's just it: I'm not JUST asking for those. I'm actually crawling other types too - and the nested retrieval is the bit that needs to detect it [11:39:41] (Sorry for delay, had to take son to school) [11:58:47] mevodad: how about this? https://w.wiki/7M8 [12:02:23] LotR: actually getting a list of businesses is easy (and accomplished) - I *have* a query that returns the initial set of businesses to query. It's when I crawl the snaks associated with the entities that I need to programmatically determine types; I could run queries against the snaks (they're wikibase entities) but I already have the overhead of retrieving them in the first place [12:04:08] my actual top level query is something like "select ?id, ?label, ?dateModified where { ?id (wdt:P31/wdt:P279*) wd:Q483053; rdfs:label ?label; schema:dateModified ?dateModified. } [12:04:30] Are petscan's timeouts more restrictive? [12:04:51] but those refer to a lot of wikibase items, obviously, some of which I need to classify as other types, and I don't know for sure if those types are direct instances of given types or not [12:05:16] I have a query in 41181 ms... [15:02:01] Is it possible to delete a catalog in Mix'n'match? [17:25:08] anybody from WMDE Wikidata team around here per chance? We have UBN that needs to be looked at: https://phabricator.wikimedia.org/T230974 [17:34:08] Hi, I have problems with merging of Q3631465 with Q270791 [17:34:24] Error while "Merge with: Q270791": The two items cannot be merged because one of them links to the other using the properties: P279 [17:34:24] If you believe it's an error, please report it here with source and destination of merge. [17:34:32] It shows as error [17:34:39] What I should do? [17:35:25] I tried to remove P279 from page but same effect [17:37:37] Ok, it works now I removed P508 instead of P279 and it was problem