Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HAVING with mutiple conditions does not work #234

Open
WolfgangFahl opened this issue Jul 30, 2022 · 0 comments
Open

HAVING with mutiple conditions does not work #234

WolfgangFahl opened this issue Jul 30, 2022 · 0 comments

Comments

@WolfgangFahl
Copy link

# truly tabular aggregate query for 
# Q1667921:novel series
# generated by trulytabular.py version 0.3.1 on 2022-07-30T07:44:32.582930
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX schema: <http://schema.org/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>
SELECT ?novel_series ?novel_seriesLabel
  (SAMPLE (?genre) AS ?genre_sample)
  (SAMPLE (?author) AS ?author_sample)
  (SAMPLE (?title) AS ?title_sample)
WHERE {
  # instanceof Q1667921:novel series
  ?novel_series wdt:P31 wd:Q1667921.
  # label
  ?novel_series rdfs:label ?novel_seriesLabel.  
  FILTER (LANG(?novel_seriesLabel) = "en").
  # genre (P136)
  OPTIONAL { 
    ?novel_series wdt:P136 ?genre. 
  }
  # author (P50)
  OPTIONAL { 
    ?novel_series wdt:P50 ?author. 
  }
  # title (P1476)
  OPTIONAL { 
    ?novel_series wdt:P1476 ?title. 
  }
}
GROUP BY ?novel_series ?novel_seriesLabel
HAVING 
  (COUNT(?genre)=1)
  (COUNT(?author)=1)
  (COUNT(?title)=1)

works on

but not on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant