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

Added a prefix filter and support for different column types to filters #145

Merged
merged 6 commits into from
Nov 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
65 changes: 65 additions & 0 deletions e2e/scientists_queries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -399,3 +399,68 @@ queries:
- selected: ["?scientist", "?height"]
- contains_row: ["<Granville_Woods>", '2.1336']
- contains_row: ["<Charles_Bradley_(Chemist)>", '1.98']
- query : having-avg-height
solutions:
- type: no-text
sparql: |
SELECT ?profession (AVG(?height) as ?avg) WHERE {
?s <Profession> ?profession .
?s <Height> ?height .
}
GROUP BY ?profession
HAVING (?avg > 1.9)
ORDER BY DESC(?avg)
checks:
- num_rows: 17
- num_cols: 2
- selected: ["?profession", "?avg"]
- contains_row: ["<Anatomist>", '1.94']
- contains_row: ["<Peace_activist>", '1.91']
- query : having-number-of-awards
solutions:
- type: no-text
sparql: |
SELECT ?profession (COUNT(DISTINCT ?s) as ?count) WHERE {
?s <Profession> ?profession .
?s <Award_Won> ?award .
}
GROUP BY ?profession
ORDER BY DESC(?count)
HAVING (?count > 300)
checks:
- num_rows: 6
- num_cols: 2
- selected: ["?profession", "?count"]
- contains_row: ["<Chemist>", '603']
- contains_row: ["<Professor>", '352']
- query : having-group-concat
solutions:
- type: no-text
sparql: |
SELECT ?profession (GROUP_CONCAT(DISTINCT ?award) as ?awards) WHERE {
?s <Profession> ?profession .
?s <Award_Won> ?award .
}
GROUP BY ?profession
HAVING (?awards = <Victoria_Cross>)
checks:
- num_rows: 1
- num_cols: 2
- selected: ["?profession", "?awards"]
- contains_row: ["<Apothecary>", '<Victoria_Cross>']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are still missing e2e queries for prefix filtering

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a 'regex-albert-physics-award' query that uses the prefix filter. I can add more, but I couldn't think of a significantly different test case for prefix filters.

- query : prefix-filter-on-group-concat
solutions:
- type: no-text
sparql: |
SELECT ?s (GROUP_CONCAT(?award) as ?awards) WHERE {
?s <is-a> <Scientist> .
?s <Award_Won> ?award .
}
GROUP BY ?s
HAVING regex(?awards, "^<Nobel_Prize")
checks:
- num_rows: 139
- num_cols: 2
- selected: ["?s", "?awards"]
- contains_row: ['<Eric_Betzig>', '<Nobel_Prize_in_Chemistry>']
- contains_row: ['<Alan_MacDiarmid>', '<Nobel_Prize_in_Chemistry> <Rutherford_Medal>']