1

I am trying to find a path in WikiData from animal entities to the Animal entity (Q729). To do so, for some entites, the only way appears to be this (example from jellyfish):

Using a SPARQL query, I would need in this example to go from the jellyfish entity (Q30178) to the Medusozoa entity (Q6596143). To do so, I have to use the properties instance of (P31), of (P642) and the class 'organisms known by a particular common name' (Q55983715). I haven't been able to figure out the right combination.

Here are a few combinations I've tried in an ASK query :

wd:Q208342 wdt:P31 wd:Q25510.              # false
wd:Q208342 wdt:P31 wdt:Q55983715;
           wdt:P642 wd:Q25510.             # false
wd:Q208342 wdt:P31 wd:Q55983715.           # true
wd:Q208342 wdt:P31 [ wdt:P642 wd:Q25510 ]. # false

I can't seem to find any relevant Documentation regarding the usage of 'of' and 'common name'. Could you please help me connecting the two entities ? Here is the WikiData SPARQL query launcher.

Thank you for your time ! :)

  • 1
    the "of" is a statement qualifier in the Wikidata data model. You have to use a SPARQL query like `select * { wd:Q30178 p:P31 ?stmt . ?stmt ps:P31 ?o . ?stmt pq:P642 ?of }` – UninformedUser Jun 06 '23 at 05:32
  • 1
    or if you just want the "of" value and this being required, a more compact query: `select * { wd:Q30178 p:P31/pq:P642 ?of }` – UninformedUser Jun 06 '23 at 05:34

0 Answers0