|
| 1 | +Feature: select values by type using multiple attributes |
| 2 | + As a developer working with JSON-LD |
| 3 | + I want to be able to use familiar syntax to query a JSON-LD document |
| 4 | + So that I don't need to manually parse the expanded JSON tree |
| 5 | + |
| 6 | + Background: Load sample data |
| 7 | + Given the sample data containing selection tests is loaded |
| 8 | + And I construct an ldQuery object using the loaded data and <context> |
| 9 | + | context | |
| 10 | + | { "ex": "http://www.example.org#" } | |
| 11 | + |
| 12 | + Scenario: Query for index and attribute, then first value |
| 13 | + When I query for "ex:type[@id=ex:type1][@index=index1] ex:grabThis @value" |
| 14 | + Then the result should be "One-Two" |
| 15 | + |
| 16 | + Scenario: Query for index and attribute, then direct value |
| 17 | + When I query for "ex:type[@id=ex:type1][@index=index1] > ex:grabThis @value" |
| 18 | + Then the result should be "One" |
| 19 | + |
| 20 | + Scenario: Stacked queries must match the same node |
| 21 | + When I query for "ex:type[@id=ex:type1][@index=index2] ex:grabThis @value" |
| 22 | + Then there should be no result |
| 23 | + |
| 24 | + Scenario: Query by id on one node and index on another |
| 25 | + When I query for "ex:type[@id=ex:type1] ex:type[@index=index2] ex:grabThis @value" |
| 26 | + Then the result should be "One-Two" |
| 27 | + |
| 28 | + Scenario: Query should match any part of the tree |
| 29 | + When I query for "ex:type[@id=ex:type4][@index=index4] ex:grabThis @value" |
| 30 | + Then the result should be "Three-Four" |
| 31 | + |
| 32 | + Scenario: Query by two values of the same attribute |
| 33 | + When I query for "ex:type[@type=ex:type-child][@type=four-noindex] > ex:grabThis @value" |
| 34 | + Then the result should be "Three-NoIndex" |
0 commit comments