Skip to content

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

@aucampia

Description

@aucampia

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions