RDFLib / prez

Prez is a data-configurable Linked Data API framework that delivers profiles of Knowledge Graph data according to the Content Negotiation by Profile standard.
BSD 3-Clause "New" or "Revised" License
18 stars 7 forks source link

Update codebase structure to improve maintenance #175

Open edmondchuc opened 7 months ago

edmondchuc commented 7 months ago

The below text originally taken from comment in https://github.com/RDFLib/prez/pull/168#pullrequestreview-1714228261.


I think the PR is fine for now as it addresses the immediate issues with the way we run tests. Nice work! šŸŽ‰ I can see that the tests run around 4 times faster, which is a nice bonus.

A follow-up to improve the structure of the codebase for long-term maintenance can look something like this:

/
ā”œā”€ā”€ repositories/
ā”‚   ā”œā”€ā”€ __init__.py
ā”‚   ā”œā”€ā”€ remote_sparql.py
ā”‚   ā”œā”€ā”€ pyoxigraph.py
ā”‚   ā””ā”€ā”€ oxrdflib.py
ā”œā”€ā”€ services/
ā”‚   ā”œā”€ā”€ __init__.py
ā”‚   ā”œā”€ā”€ object.py
ā”‚   ā”œā”€ā”€ listing.py
ā”‚   ā””ā”€ā”€ etc...
ā””ā”€ā”€ routers/
    ā”œā”€ā”€ __init__.py
    ā”œā”€ā”€ object.py
    ā”œā”€ā”€ listing.py
    ā”œā”€ā”€ sparql.py
    ā”œā”€ā”€ vocprez.py
    ā”œā”€ā”€ catprez.py
    ā””ā”€ā”€ spaceprez.py

I think by having these three layers at a minimum will allow us all to conceptually understand Prez and its implementation details a bit clearer.

Anyway, I think this can probably be followed up in a separate PR as it's more maintenance-related. If you agree with the above's proposed structure, I can create an issue and reference this PR's comment.