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

Add explicit remove_namespace() method #37

Open
xAlessandroC opened this issue Nov 17, 2022 · 3 comments
Open

Add explicit remove_namespace() method #37

xAlessandroC opened this issue Nov 17, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@xAlessandroC
Copy link

It would be helpful to add an explicit remove_namespace(prefix: str) method to remove a specific namespace from a database in a triplestore. I'm aware that, currently, the bind method could also perform namespace deletion in case the prefix is None.

It would be an optional method for triplestores that actually support the namespace management.

@jesper-friis Does it make sense to you?

@xAlessandroC xAlessandroC added the enhancement New feature or request label Nov 17, 2022
@jesper-friis
Copy link
Contributor

Do you think about something as simple this?

    def remove_namespace(prefix: str):
        self.bind(prefix, None)

This would just be a more explicit way to remove a prefix that does not require any support from the backends.

@xAlessandroC
Copy link
Author

Actually, we need support from the backends since different triplestores may delete the namespaces in different ways (e.g. different paths for the REST API). My idea was to define a new method

    def remove_namespace(prefix: str):
        self.backend.remove_namepsace(prefix)

instead of using self.bind(prefix, None) as a way to remove namespaces.
Of course, we can also use your method proposal, in that case, each backend should check if the URI is None and apply the logic for the namespace deletion.

@xAlessandroC
Copy link
Author

We could add this feature in #39.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants