-
Notifications
You must be signed in to change notification settings - Fork 3
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
Questions regarding QueryByExample
structure and handling
#23
Comments
The group discussed this issue in the 2024-07-30 telecon: The group agreed that QueryByExample is under-specified today and the only way to answer the questions asked in this issue is to write one or more PRs that clearly answers each question. |
@geel9 wrote:
The
For For
Yes, those are safe assumptions to make.
It's intended for arbitrary key/values to query against the verifiable credential.
Comparison is only to be performed based on the primitive types. Matching string "5" vs. integer 5 is not expected to be performed. Comparisons of objects is also intuitive -- just recurse. Yes, correct.
Yes, that is correct.
In general, we've tried to stay away from complex queries such as the ones you suggest because the use cases that most of the community is tackling doesn't require that sort of fine-grained querying. That said, arrays are presumed to be "unordered" so if there is a match, you return the credential (even if items are out of order). IOW, the query you provided would match and the credential should be returned. The group will try to clarify these items in a future PR. |
@msporny — Please code fence the |
Hello,
I have some questions regarding the proper handling of
QueryByExample
objects.I understand that many of these questions may not yet have answers, but I'd appreciate any insight that can be provided.
@context
andtype
fields required or optional?string | string[]
-- is this fair?@context
andtype
fields to be handled?@context
array (whether it be expressed as an array of strings or a string itself) must be present in the credential's@context
array, but additional values may be present in the credential's@context
array. Is this fair?type
field.credentialSubject
limited to onlyid
andname
fields, or is it intended for arbitrary key/values to query against the credential'scredentialSubject
?You can request a specific subject id
, which implies that that is the only intended usage.credentialSubject
is not limited toid
andname
, how is comparison meant to be handled?5
match"5"
?) should be clarified.example.credentialSubject
tocredential.credentialSubject
comparison itself) are loose in the sense that the object on the credential may have additional fields not specified by the example object.Array Comparison in
credentialSubject
(This is all assuming that the
credentialSubject
field in the example query is not restricted toid
andname
fields)Given the following query:
And the following
credentialSubject
from a VerifiableCredential:It's not entirely clear how to handle this query by example.
primitive_array_one
primitive_array_one
contains all values of the example'sprimitive_array_one
, in the same order and position, but it has additional entries.primitive_array_two
primitive_array_two
contains all values of the example'sprimitive_array_two
, and has no additional values, but they are not in the same order.complex_array
a
value equal to1
, and an object with ab
value equal to2
.a
value equal to1
, and an object with ab
value equal to2
.The text was updated successfully, but these errors were encountered: