Talk:Q38074555

From Wikidata
Jump to navigation Jump to search

Autodescription — QID milestone (Q38074555)

description: milestone related to the numbering of items in Wikidata
Useful links:
See also


Source[edit]

Dates are from Wikidata:News or edit history of item.

Queries[edit]

Query for milestone chart over time[edit]

#defaultView:LineChart
# by Jura1, 2017-08-28
SELECT ?date ?qid  (URI(CONCAT("https://www.wikidata.org/w/index.php?title=Q",str(?qid),"&action=history")) as ?check)
{
  wd:Q38074555 p:P1114 [ ps:P1114 ?qid ; pq:P585 ?date ]
}
ORDER BY ?qid

Try it!

Query for approximate creation dates of a series of items[edit]

# by Jura1, 2019-06-08
# Number of items about Australia created at a given milestone
#defaultView:AreaChart
SELECT ?date ?cumulativecount 
{
    hint:Query hint:optimizer "None".
    {   SELECT ?milestonep (COUNT(?item) as ?cumulativecount)
        WHERE
        {
          { SELECT ?item { ?item wdt:P17 wd:Q408 }  LIMIT 190000 }
          BIND( xsd:integer( substr(str(?item), 33)) as ?qid)
          wd:Q38074555 p:P1114 ?milestonep .
          ?milestonep ps:P1114 ?milestone .
          FILTER( ?milestone > ?qid ) 
        }
        GROUP BY ?milestonep
    }          
    ?milestonep pq:P585 ?date
}

Try it!

Neat idea! --Daniel Mietchen (talk) 03:55, 13 June 2019 (UTC)[reply]

Query for approximate creation dates of a series of items (> 200,000 items)[edit]

#adapted by 99of9, 11 June 2019
#[[Wikidata:Request_a_query/Archive/2019/06#dateCreated_instead_of_dateModified?]]
# Number of items about France created at a given milestone
#defaultView:LineChart
SELECT (SAMPLE(?date) AS ?date) (SUM(?count) AS ?cumulative_count) ?milestone
{

  { SELECT ?qid_rounded (count(?item) AS ?count) (SAMPLE(?item) AS ?exampleitem) WHERE {
 
      ?item ?property wd:Q142  .
    
      BIND( xsd:integer( substr(str(?item), 33)) as ?qid)
      BIND(xsd:integer(?qid/50000) as ?qid_cut)
      BIND(?qid_cut*50000 as ?qid_rounded)
               
      #SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } .
    }
    GROUP BY ?qid_rounded
  }
  wd:Q38074555 p:P1114 ?milestonep .
  ?milestonep ps:P1114 ?milestone .
  FILTER(?milestone > ?qid_rounded) .
  ?milestonep pq:P585 ?date .
}
GROUP BY ?milestone

Try it!

Items with approximate age (in years)[edit]

# by Jura1, 2019-09-13
SELECT 
  ?item ?itemLabel ?itemDescription 
  ?st ?ids ?sl
  (MIN(?age) as ?age_years) 
WHERE
{ 
  ?item wdt:P31 wd:Q186875 .
  ?item wikibase:statements ?st ; wikibase:identifiers ?ids ; wikibase:sitelinks ?sl . 
  wd:Q38074555 p:P1114 [ ps:P1114 ?milestone ; pq:P585 ?d ]
  FILTER( ?milestone < xsd:integer(STRAFTER(str(?item),"Q"))) 
  BIND(ROUND((NOW()-?d)/36.5)/10 as ?age)              
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } 
}
GROUP BY ?item ?itemLabel ?itemDescription ?st ?ids ?sl
ORDER BY ?age_years

Try it!

See also[edit]

Discussion[edit]