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

eliminate rdflib.term.Genid and rdflib.term.RDFLibGenid #1828

Open
aucampia opened this issue Apr 15, 2022 · 0 comments · May be fixed by #2459
Open

eliminate rdflib.term.Genid and rdflib.term.RDFLibGenid #1828

aucampia opened this issue Apr 15, 2022 · 0 comments · May be fixed by #2459
Labels
breaking change This involves or proposes breaking RDFLib's public API. cleanup concept: skolemization good first issue Good for newcomers

Comments

@aucampia
Copy link
Member

aucampia commented Apr 15, 2022

I don't think there is any situation in which RDFLib will create instances of these classes (after #1821 is merged) and it is not clear why they exist. I think it would be best to remove them entirely.

rdflib/rdflib/term.py

Lines 358 to 389 in 57f993d

class Genid(URIRef):
__slots__ = ()
@staticmethod
def _is_external_skolem(uri: Any) -> bool:
if not isinstance(uri, str):
uri = str(uri)
parsed_uri = urlparse(uri)
gen_id = parsed_uri.path.rfind(skolem_genid)
if gen_id != 0:
return False
return True
class RDFLibGenid(Genid):
__slots__ = ()
@staticmethod
def _is_rdflib_skolem(uri: Any) -> bool:
if not isinstance(uri, str):
uri = str(uri)
parsed_uri = urlparse(uri)
if (
parsed_uri.params != ""
or parsed_uri.query != ""
or parsed_uri.fragment != ""
):
return False
gen_id = parsed_uri.path.rfind(rdflib_skolem_genid)
if gen_id != 0:
return False
return True

@aucampia aucampia added backwards incompatible will affect backwards compatibility, this includes things like breaking our interface 7.0 Changes planned for version 7 labels Jul 29, 2022
@aucampia aucampia added good first issue Good for newcomers breaking change This involves or proposes breaking RDFLib's public API. and removed backwards incompatible will affect backwards compatibility, this includes things like breaking our interface 7.0 Changes planned for version 7 labels May 22, 2023
aucampia added a commit to aucampia/rdflib that referenced this issue Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This involves or proposes breaking RDFLib's public API. cleanup concept: skolemization good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant