query-c57c19658ece34b877f4ac13dbec3e45
Number of generations 13:03, 13 July 2021 (UTC)) talk (Simon Villeneuve chain) ? (P40)child How can we get the items having the longuest lineage (Hi, has a report for that yet, but it might not be possible.Wikidata:WikiProject_GenealogyI don't think 14:11, 13 July 2021 (UTC) Jura and counting number of generations. --- Wikidata:WikiProject_Genealogy/numbers/descendantsMaybe you can find it be picking one of the persons (or their parents) on
Use at
- https://query.wikidata.org/sparql
PREFIX gas: <http://www.bigdata.com/rdf/gas#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT (MAX(?depth) as ?max_generations) (SAMPLE(?item) as ?descendant)
WHERE
{
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.SSSP" ;
gas:in wd:Q3044 ;
gas:traversalDirection "Forward" ;
gas:out ?item ;
gas:out1 ?depth ;
gas:maxIterations 100 ;
gas:linkType wdt:P40 .
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?depth"):::projected
v4("?descendant")
v1("?item"):::projected
v3("?max_generations")
c2(["gas:program"]):::iri
c4(["com.bigdata.rdf.graph.analytics.SSSP"]):::literal
c14(["wdt:P40"]):::iri
c12(["100^^xsd:integer"]):::literal
c8(["Forward"]):::literal
c6(["wd:Q3044"]):::iri
subgraph s1["http://www.bigdata.com/rdf/gas#service"]
style s1 stroke-width:4px;
c2 --"gas:gasClass"--> c4
c2 --"gas:in"--> c6
c2 --"gas:traversalDirection"--> c8
c2 --"gas:out"--> v1
c2 --"gas:out1"--> v2
c2 --"gas:maxIterations"--> c12
c2 --"gas:linkType"--> c14
end
bind2[/"max(?depth)"/]
v2 --o bind2
bind2 --as--o v3
bind3[/"sample(?item)"/]
v1 --o bind3
bind3 --as--o v4