summaryrefslogtreecommitdiff
path: root/docs/rdf_terms.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/rdf_terms.rst')
-rw-r--r--docs/rdf_terms.rst66
1 files changed, 65 insertions, 1 deletions
diff --git a/docs/rdf_terms.rst b/docs/rdf_terms.rst
index c8468407..a9682325 100644
--- a/docs/rdf_terms.rst
+++ b/docs/rdf_terms.rst
@@ -6,7 +6,71 @@ RDF terms in rdflib
Terms are the kinds of objects that can appear in a quoted/asserted triples. Those that are part of core RDF concepts are: ``Blank Node``, ``URI Reference`` and ``Literal``, the latter consisting of a literal value and either a `datatype <https://www.w3.org/TR/xmlschema-2/#built-in-datatypes>`_ or an :rfc:`3066` language tag.
-All terms in RDFLib are sub-classes of the :class:`rdflib.term.Identifier` class.
+All terms in RDFLib are sub-classes of the :class:`rdflib.term.Identifier` class. A class diagram of the various terms can be seen in the :ref:`term_class_hierarchy` diagram.
+
+.. _term_class_hierarchy:
+.. kroki::
+ :caption: Term Class Hierarchy
+ :type: plantuml
+
+@startuml
+skinparam shadowing false
+skinparam monochrome true
+skinparam packageStyle rectangle
+skinparam backgroundColor FFFFFE
+
+class Node
+
+class Identifier {
+ eq(other) -> bool
+ neq(other) -> bool
+ startswith(prefix: str, start, end) -> bool
+}
+Identifier -up-|> Node
+
+class IdentifiedNode {
+ toPython() -> str
+}
+IdentifiedNode -up-|> Identifier
+
+class URIRef {
+ n3(namespace_manager) -> str
+ defrag() -> URIRef
+ de_skolemize() -> BNode
+}
+URIRef -up-|> IdentifiedNode
+
+
+class Genid
+Genid -up-|> URIRef
+
+class RDFLibGenid
+RDFLibGenid -up-|> Genid
+
+class BNode {
+ n3(namespace_manager) -> str
+ skolemize(authority, basepath) -> RDFLibGenid
+}
+BNode -up-|> IdentifiedNode
+
+class Literal {
+ datatype: Optional[str]
+ lang: Optional[str]
+ value: Any
+
+ normalize() -> Literal
+ n3(namespace_manager) -> str
+ toPython() -> str
+}
+Literal -up-|> Identifier
+
+class Variable {
+ n3(namespace_manager) -> str
+ toPython() -> str
+}
+Variable -up-|> Identifier
+
+@enduml
Nodes are a subset of the Terms that the underlying store actually persists.
The set of such Terms depends on whether or not the store is formula-aware.