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

Derive structured patterns for referrer at schema compilation time #2280

Open
eecavanna opened this issue Nov 27, 2024 · 1 comment
Open
Labels
backlog Issue not assigned to a sprint or not completed during a sprint. Needs to be reprioritized. cleanup

Comments

@eecavanna
Copy link
Collaborator

eecavanna commented Nov 27, 2024

Currently, structured patterns are hard-coded at both the reference source (some slots) and the reference target (the id slot of some class). This creates an opportunity for the two to fall out of sync.

I propose only defining them at the reference target, and not at the reference source; and then, programmatically constructing the pattern for the reference source at schema compilation time.

The algorithm (in pseudocode) I have in mind is:

# Combine sub-patterns into a single pattern, with "OR" operators.
existing_pattern = ""
for target_class_definition in range:
    target_class_id_pattern = target_class_definition.id_slot_definition.pattern
    existing_pattern = f"{existing_pattern}|{target_class_id_pattern}"

source_slot_definition.pattern = existing_pattern

CC: @turbomam

@eecavanna eecavanna added backlog Issue not assigned to a sprint or not completed during a sprint. Needs to be reprioritized. cleanup labels Nov 27, 2024
@eecavanna
Copy link
Collaborator Author

eecavanna commented Nov 27, 2024

During today's metadata meeting, several team members expressed concerns about this approach: It depends upon the range defined on the referring slot being accurate and specific (i.e. sufficiently constrained).

CC: @aclum and @kheal

Example issue about a range not being properly constrained:

I said that I may prototype it and demonstrate it to the group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issue not assigned to a sprint or not completed during a sprint. Needs to be reprioritized. cleanup
Projects
None yet
Development

No branches or pull requests

1 participant