query-1e0a675694f90f2858ee25508f19cb6b

rq turtle/ttl

Bouzinac

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?metroline ?metrolineLabel ?endpoints ?carte_d_itin_raire WHERE {
  {
    SELECT ?metroline (COUNT(?endpoint_statement) AS ?endpoints) WHERE {
      ?metroline wdt:P31 wd:Q15079663;
        p:P559 ?endpoint_statement.
      ?endpoint_statement a wikibase:BestRank.
      FILTER NOT EXISTS { ?endpoint_statement pq:P582 []. }
    }
    GROUP BY ?metroline
    HAVING (?endpoints > 2 )
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  OPTIONAL { ?metroline wdt:P15 ?carte_d_itin_raire. }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?carte_d_itin_raire"):::projected v2("?endpoint_statement") v4("?endpoints"):::projected v3("?metroline"):::projected a1((" ")) c9(["bd:serviceParam"]):::iri c7(["wikibase:BestRank"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal c4(["wd:Q15079663"]):::iri f0[["?endpoints > '2^^xsd:integer'"]] f0 --> v4 f1[["not "]] subgraph f1e0["Exists Clause"] e0v1 --"p:qualifier/P582"--> e0a1 e0v1("?endpoint_statement"):::projected e0a1((" ")):::projected end f1--EXISTS--> f1e0 f1 --> v2 f1 --> c2 f1 --> a1 v2 --"p:qualifier/P582"--> a1 v3 --"p:direct/P31"--> c4 v3 --"p:P559"--> v2 v2 --"a"--> c7 bind3[/"count(?endpoint_statement)"/] v2 --o bind3 bind3 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P15".-> v4 end