# Query Language

The Verifier’s query language defines precise requirements for acceptable credentials. By specifying fields and applying JSON Schema filters, you ensure that only credentials meeting exact criteria are accepted.

## Key Concepts

* **Paths**:\
  Identify data fields in a credential’s JSON structure using JSONPath syntax.
* **Filters**:\
  Apply JSON Schema rules (e.g., type, enum, pattern) to validate content at the specified path.

## Example

**Proof of Purchase Credential Requirement:**

* `type` includes "ProofOfPurchase".
* `credentialSubject.id` matches the pattern `^did:empe:.*$`.

```json
[
  {
    "fields": [
      {
        "path": ["$.type"],
        "filter": {
          "type": "array",
          "contains": {"const": "ProofOfPurchase"}
        }
      },
      {
        "path": ["$.credentialSubject.id"],
        "filter": {
          "type": "string",
          "pattern": "^did:empe:.*$"
        }
      }
    ]
  }
]
```

By combining paths and filters, the Verifier ensures that only credentials meeting your defined requirements pass the verification process.
