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

Translate Query(Enum) into ancp-bids terms #18

Open
effigies opened this issue Dec 9, 2022 · 1 comment
Open

Translate Query(Enum) into ancp-bids terms #18

effigies opened this issue Dec 9, 2022 · 1 comment
Labels
effort: low Estimated low effort task impact: medium Estimated medium impact task

Comments

@effigies
Copy link
Collaborator

effigies commented Dec 9, 2022

In PyBIDS we have the idea of layout.get(desc=Query.REQUIRED) (where desc is an arbitrarily selected entity) that indicates that any non-null value is permitted. Query.OPTIONAL permits the value to be present or absent. Query.NONE only matches files do not have that entity.

These queries should be translated to ANCP equivalents.

@effigies effigies added effort: low Estimated low effort task impact: medium Estimated medium impact task labels Dec 9, 2022
@erdalkaraca
Copy link
Collaborator

This is already (partially) implemented in the query language expressions, but need to be reflected in the BIDSLayout.get() docs:

        filters : dict
            Any optional key/values to filter the entities on.
            Keys are entity names, values are regexes to filter on. For
            example, passing filters={'subject': 'sub-[12]'} would return
            only files that match the first two subjects. In addition to
            ordinary data types, the following values are defined:
                * None: The named entity must not be defined.
                * '*': the named entity must be defined, but can have any value.

What is missing is Query.REQUIRED, though there might be semantic overlap with Query.OPTIONAL:

layout.get(desc=Query.REQUIRED) == layout.get(desc=Query.OPTIONAL)

translates to:

layout.get(desc='*')

=> value can be anything, i.e. optional but not None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: low Estimated low effort task impact: medium Estimated medium impact task
Projects
None yet
Development

No branches or pull requests

2 participants