query-2396e8ad51e4e53a5f13e6383071ba13

rq turtle/ttl

HAVING paraméter szűrőként? 08:37, 2 December 2018 (UTC)) talk (PasztillaValahogy be lehet rakni a HAVING paramétert egy lekérdezés szűrői (FILTER) közé? Jelentősen felgyorsítaná, amit csinálok, jelenleg csak a kimeneti paraméterek között tudom használni, de gyakran egyéb kényszerű filterekkel kell bővítenem a lekérdezést, például itt lent születési intervallumok szerint haladok, máskülönben elakad a nagy adatmennyiségtől.

Use at

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 schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?politik ?politikLabel ?politikDescription (COUNT(distinct ?sitelink) AS ?sitelinks) WHERE {
    ?politik wdt:P106 wd:Q82955 .
    ?politik wdt:P569 ?szul .
    OPTIONAL { ?sitelink schema:about ?politik FILTER REGEX(STR(?sitelink), ".wikipedia.org/wiki/") } .
    FILTER (?szul > "1947-01-01T00:00:00Z"^^xsd:dateTime) .
    FILTER (?szul < "1950-01-01T00:00:00Z"^^xsd:dateTime) .
    FILTER NOT EXISTS { ?politik wdt:P570 ?date } . # Nem halt még meg.
    FILTER NOT EXISTS { [] schema:about ?politik; schema:isPartOf <https://hu.wikipedia.org/> } .
    SERVICE wikibase:label { bd:serviceParam wikibase:language "hu,en,fr" }
}
GROUP BY ?politik ?politikLabel ?politikDescription
HAVING (?sitelinks > 29)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?date") v2("?politik"):::projected v5("?sitelink"):::projected v6("?sitelinks") v4("?szul") a1((" ")) c10(["wd:Q82955"]):::iri c4([https://hu.wikipedia.org/]):::iri c13(["bd:serviceParam"]):::iri c15(["hu,en,fr"]):::literal f0[["?sitelinks > '29^^xsd:integer'"]] f0 --> v6 f1[["not "]] subgraph f1e0["Exists Clause"] e0a1 --"schema:about"--> e0v1 e0a1 --"schema:isPartOf"--> e0c3 e0v1("?politik"):::projected e0a1((" ")):::projected e0c3([https://hu.wikipedia.org/]):::iri end f1--EXISTS--> f1e0 f1 --> a1 f1 --> c2 f1 --> v2 f1 --> c3 f1 --> c4 a1 --"schema:about"--> v2 a1 --"schema:isPartOf"--> c4 f2[["not "]] subgraph f2e1["Exists Clause"] e1v1 --"wdt:P570"--> e1v2 e1v2("?date"):::projected e1v1("?politik"):::projected end f2--EXISTS--> f2e1 f2 --> v2 f2 --> c5 f2 --> v3 v2 --"wdt:P570"--> v3 f3[["?szul < '1950-01-01T00:00:00Z^^xsd:dateTime'"]] f3 --> v4 f4[["?szul > '1947-01-01T00:00:00Z^^xsd:dateTime'"]] f4 --> v4 v2 --"wdt:P106"--> c10 v2 --"wdt:P569"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."schema:about".-> v2 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end bind6[/"count(?sitelink)"/] v5 --o bind6 bind6 --as--o v6