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

discuss motivation / strategy behind the __call__ usage inside config_builder #34

Open
marc-portier opened this issue Apr 6, 2024 · 1 comment
Milestone

Comments

@marc-portier
Copy link
Member

not quite self-explaining at the moment

also unclear what the current benefit is

it feels like we could get maybe use it to "activate" some of these objects (i.e. make the transition from pure passive configs to objects that also use access to rdf_store to make some active decisions

regardless that last part, if we keep the _call strategy around, we should at least opt for some naming convention that makes this less surprising (or rock bottom: make sure we have good docs for this part of the (mostly internal) API / usage)

@marc-portier
Copy link
Member Author

when reconsidering the way we handle the config (also see #44 #35 #48) we should reconsider the way property paths are handled

the current regex

REGEXP = r"(?:\w+:\w+|<[^>]+>)"
simply cannot be checking for / delimitors, meaning it will behave similarly for any other (or even no) delimitor between the parts -- which I assume is not what we want?

the recent code sample added in #35 (comment) contains an alternative approach --> adding a slash to the string to match as well as to the regex pattern (with optional whitespace) keeps the pattern fairly simple + guarantees the delimitor

cedricdcc added a commit that referenced this issue May 7, 2024
- Added helper.py containing functions that allow for prefix support in sparql queries and traversal harvesting paths.
- deleted call functions and refactored code in config_builder and all subsequent files that used this __call__ method.
- replaced and refactored all files that worked with the GraphNameMapper, now the maper of py-rdf-store is being used.
- refactored the config builder propery subjects so that when they are called they will get the subjects from the graph if
that is required (when SPARQL query is given instead of list of subjects).
- edited the .yml files that are used as configs to now not contain the <> anymore in the prefixes since these will now cause issues for the helper functions resolve_uri()

Issues that were affecting by the changes in this commit are:
- #35
- #43
- #48
- #34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant