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 a class diagram for terms. #1682

Merged

Conversation

aucampia
Copy link
Member

@aucampia aucampia commented Jan 22, 2022

The diagram is based on the diagram created by
Graham Higgins (@gjhiggins) in #1526

This shows the class heirarchy of various terms such as Identifier,
IdentifiedNode, URIRef, Literal, etc.

The diagram is in plantuml and
compiled to svg by the
kroki extension for sphinx.

Diagrams can be rendered from the plantuml at https://kroki.io/.

Other changes:

  • Some updates to the "Writing RDFLib Documentation" page.

@aucampia
Copy link
Member Author

Preview:

screencapture-127-0-0-1-8080-rdf-terms-html-2022-01-22-01_00_04

@aucampia
Copy link
Member Author

aucampia commented Jan 22, 2022

The diagram itself can be seen in diagram

click the image to go to an editor for it.

The diagram is based on the diagram created by
Graham Higgins (@gjhiggins) in RDFLib#1526

This shows the class heirarchy of various terms such as Identifier,
IdentifiedNode, URIRef, Literal, etc.

The diagram is in [plantuml](https://plantuml.com/class-diagram) and
compiled to svg by the
[kroki extension for sphinx](https://github.com/sphinx-contrib/kroki).

Diagrams can be rendered from the plantuml at https://kroki.io/.

Other changes:
 - Some updates to the "Writing RDFLib Documentation" page.
@aucampia aucampia force-pushed the iwana-20220122T0047-term_class_diag branch from 26c2e0b to f87188b Compare January 22, 2022 00:10
@aucampia aucampia requested review from nicholascar and a user January 22, 2022 00:13
Copy link
Member

@nicholascar nicholascar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aucampia, as always! I think the diagram really helps and it looks really great. I think I'll do more of these in other Python projects of mine that have interesting class hierarchies (I am actually a data modeller, not a software engineer after all).

Sadly, looking at the diagram, I think we need to tidy up the classes more:

I think we should update URIRef to a more naturally-named IRI class - while retaining an alias so people can still call URIRef in code, if that's possible - and also consider renaming Identifier to Term to avoid overuse of the word identifier, while retaining a legacy alias too. Like the potential ConjunctiveGraph / Dataset deduplication, these structures and names matter for they cloud understanding if bad and help it greatly if good.

Something for rdflib 7.0.0...

Waiting for a review from @gjhiggins since he made the first class diagram.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puts my clumsy effort to shame, well worthwhile addition.

@ghost
Copy link

ghost commented Jan 22, 2022

Documentation note - Variable is noticeably missing from the docs. The docstring is laconic:

class Variable(Identifier):
    """
    A Variable - this is used for querying, or in Formula aware
    graphs, where Variables can stored in the graph
    """

But there are examples of the former and the W3's “Notation 3” document has a section devoted to Formulae which can usefully be mined for content to flesh out a description of the latter.

@nicholascar nicholascar merged commit d3f9453 into RDFLib:master Jan 22, 2022
@nicholascar
Copy link
Member

I had to make a small update to get the diagram rendering: tab in all in so Sphinx, at least on my computer, could interpret it correctly. Fix in a new PR I'm about to make for the multiple namespaces issue.

@aucampia
Copy link
Member Author

We should probably do some manner of publishing of the site from master so we can also spot potential issues with docs before a release.

@nicholascar
Copy link
Member

nicholascar commented Jan 23, 2022

We do already have master being built over at readthedocs into latest documentation, as opposed to the latest release being built into stable, so we should easily be able to see what the next release’ documentation will look like before a release

@edmondchuc
Copy link
Contributor

Maybe build a docs preview on each PR. You can see how it works here. ternaustralia/linkeddata-site#85. And here is the GitHub Actions workflow. https://github.com/ternaustralia/linkeddata-site/blob/master/.github/workflows/preview.yml. It utilises the free surge.sh service for serving the static site content.

Alternatively, render.com also has a generous free tier with PR previews for static sites as well.

@aucampia
Copy link
Member Author

Maybe build a docs preview on each PR. You can see how it works here. ternaustralia/linkeddata-site#85. And here is the GitHub Actions workflow. https://github.com/ternaustralia/linkeddata-site/blob/master/.github/workflows/preview.yml. It utilises the free surge.sh service for serving the static site content.

Alternatively, render.com also has a generous free tier with PR previews for static sites as well.

Thanks for this, I will have a look, will be very helpful to do.

@aucampia
Copy link
Member Author

We do already have master being built over at readthedocs into latest documentation, as opposed to the latest release being built into stable, so we should easily be able to see what the next release’ documentation will look like before a release

I had a look at https://readthedocs.org/projects/rdflib/builds/ and it seems latests was not built recently, what triggers an update there?

@nicholascar
Copy link
Member

what triggers an update there?

At the moment, I think it's all manual, as in someone has to go in an press 'build' for latest, stable and release builds (e.g. 5.0.0) when a new release is made.

Auto-building would be better but I don't know how to auto-build in reathedocs but I'm sure it's possible as I think many PyPI projects auto-build.

@edmondchuc
Copy link
Contributor

@aucampia I just noticed RTD also provides pull request previews. See https://docs.readthedocs.io/en/stable/pull-requests.html

@aucampia aucampia deleted the iwana-20220122T0047-term_class_diag branch April 9, 2022 14:14
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

Successfully merging this pull request may close these issues.

None yet

3 participants