2

Let's say I'm looking for Wikidata cats who have their place of birth (P19) listed, using this query (also at https://w.wiki/5mdp):

SELECT ?item ?itemLabel ?placeofbirthLabel ?date
WHERE 
{
  ?item wdt:P31 wd:Q146;
        wdt:P19 ?placeofbirth;
        schema:dateModified ?date.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

This retrieves: item id, item label, (the label of) the place of birth, and the date that any part of the item was last updated.

What if I also want to retrieve the date that the place of birth (P19) was last edited?

Thanks in advance!

relizt
  • 375
  • 2
  • 11
  • I don't think it's possible per statement unless anything changed in the past, see also the accepted answer here: https://stackoverflow.com/questions/61761025/retrieving-properties-last-updated-before-after-arbitrary-date – UninformedUser Oct 03 '22 at 07:15

1 Answers1

1

Place items can also have a schema:dateModified property:

SELECT ?item ?itemLabel ?item_modified ?placeofbirthLabel ?placeofbirth_modified
WHERE 
{
  
  ?item wdt:P31 wd:Q146 ;
        wdt:P19 ?placeofbirth ;
        schema:dateModified ?item_modified .
  
  ?placeofbirth schema:dateModified ?placeofbirth_modified .
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
  
} LIMIT 10