query-9836671249c5151014ad9e286d2076e7

rq turtle/ttl

NFL teams(Q17156793)American football team . w:National_Football_League_team_captainsThere are 32 current NFL teams. See That gives better query result: 54 teams. (Q1215884)National Football League for a time and then (Q464508)American Football League being (P118)league or competition Query returns 20 (gets old teams such as Brooklyn Dodgers). Buffalo Bills are missing. It has Solved by filtering out dissolved teams. Asking for head coach gets only 13 items with some duplicates. Need to filter for start and end time. See Kansas City Chiefs and Andy Reid. Why not instance of NFL Americal Football Team?

Use at

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 ?team ?teamLabel ?coach ?coachLabel
{
  # instance of American football team
  ?team wdt:P31 wd:Q17156793 .

  # member of National Football League
  # ?team wdt:P463 wd:Q1215884 .

  # league is NFL
  ?team wdt:P118 wd:Q1215884 .

  FILTER NOT EXISTS {
    # no dissolved date
    ?team wdt:P576 ?date .
  }

  optional {
    # head coach
    ?team wdt:P286 ?coach .
  }

  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }

} ORDER BY ?teamLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?coach"):::projected v3("?date") v2("?team"):::projected v1("?teamLabel"):::projected c5(["wd:Q1215884"]):::iri c8(["bd:serviceParam"]):::iri c10(["en"]):::literal c3(["wd:Q17156793"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P576"--> e0v2 e0v2("?date"):::projected e0v1("?team"):::projected end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> v3 v2 --"wdt:P576"--> v3 v2 --"wdt:P31"--> c3 v2 --"wdt:P118"--> c5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P286".-> v4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end