query-ffef061da599396ad13bdbe6185724fa
Infovarius
Use at
- https://query.wikidata.org/sparql
PREFIX gas: <http://www.bigdata.com/rdf/gas#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?calculated_Erdős_number ?stored_Erdős_number
WHERE
{
{
SELECT ?item ?depth
WHERE
{
SERVICE gas:service
{
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.SSSP" .
gas:program gas:in wd:Q173746 .
gas:program gas:out ?item .
gas:program gas:out1 ?depth .
gas:program gas:linkType wdt:P50 .
gas:program gas:traversalDirection "Undirected" .
gas:program gas:maxIterations 6 .
}
FILTER (FLOOR(?depth / 2) * 2 = ?depth) # Use only even depths. The odd numbers are the written papers
}
} BIND (xsd:integer(?depth/2) AS ?calculated_Erdős_number)
OPTIONAL { ?item wdt:P2021 ?stored_Erdős_number . }
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
ORDER BY ?calculated_Erdős_number
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?calculated_Erdős_number"):::projected
v2("?depth")
v3("?item"):::projected
v4("?stored_Erdős_number"):::projected
c3(["gas:program"]):::iri
c5(["com.bigdata.rdf.graph.analytics.SSSP"]):::literal
c11(["wdt:P50"]):::iri
c18(["bd:serviceParam"]):::iri
c13(["Undirected"]):::literal
c15(["6^^xsd:integer"]):::literal
c7(["wd:Q173746"]):::iri
c20(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["numeric-floor(?depth / '2^^xsd:integer') * '2^^xsd:integer' = ?depth"]]
f0 --> v2
subgraph s1["http://www.bigdata.com/rdf/gas#service"]
style s1 stroke-width:4px;
c3 --"gas:gasClass"--> c5
c3 --"gas:in"--> c7
c3 --"gas:out"--> v3
c3 --"gas:out1"--> v2
c3 --"gas:linkType"--> c11
c3 --"gas:traversalDirection"--> c13
c3 --"gas:maxIterations"--> c15
end
bind1[/"http://www.w3.org/2001/XMLSchema#integer(?depth / '2^^xsd:integer')"/]
v2 --o bind1
bind1 --as--o v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P2021".-> v4
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c18 --"wikibase:language"--> c20
end