iolanta 2.1.14__tar.gz → 2.1.16__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. {iolanta-2.1.14 → iolanta-2.1.16}/PKG-INFO +2 -1
  2. iolanta-2.1.16/iolanta/entry_points.py +15 -0
  3. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/errors.py +11 -6
  4. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/facet.py +8 -11
  5. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_browser/app.py +26 -27
  6. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_browser/history.py +3 -3
  7. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_browser/page_switcher.py +16 -11
  8. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/node_to_qname.py +3 -3
  9. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/plugin.py +15 -14
  10. {iolanta-2.1.14 → iolanta-2.1.16}/pyproject.toml +2 -1
  11. iolanta-2.1.14/iolanta/entry_points.py +0 -18
  12. {iolanta-2.1.14 → iolanta-2.1.16}/README.md +0 -0
  13. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/__init__.py +0 -0
  14. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/base_plugin.py +0 -0
  15. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/cli/__init__.py +0 -0
  16. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/cli/formatters/__init__.py +0 -0
  17. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/cli/formatters/choose.py +0 -0
  18. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/cli/formatters/csv.py +0 -0
  19. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/cli/formatters/json.py +0 -0
  20. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/cli/formatters/pretty.py +0 -0
  21. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/cli/main.py +0 -0
  22. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/cli/models.py +0 -0
  23. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/cli/pretty_print.py +0 -0
  24. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/context.py +0 -0
  25. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/conversions.py +0 -0
  26. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/data/context.yaml +0 -0
  27. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/data/graph-triples.yamlld +0 -0
  28. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/data/iolanta.yaml +0 -0
  29. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/data/textual-browser.yaml +0 -0
  30. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/declension/__init__.py +0 -0
  31. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/declension/data/declension.yamlld +0 -0
  32. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/declension/facet.py +0 -0
  33. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/declension/sparql/declension.sparql +0 -0
  34. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/ensure_is_context.py +0 -0
  35. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/__init__.py +0 -0
  36. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/cli/__init__.py +0 -0
  37. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/cli/base.py +0 -0
  38. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/cli/default.py +0 -0
  39. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/cli/record.py +0 -0
  40. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/cli/sparql/link.sparql +0 -0
  41. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/cli/sparql/record.sparql +0 -0
  42. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/errors.py +0 -0
  43. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/foaf_person_title/__init__.py +0 -0
  44. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/foaf_person_title/facet.py +0 -0
  45. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/foaf_person_title/sparql/names.sparql +0 -0
  46. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/generic/__init__.py +0 -0
  47. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/generic/bool_literal.py +0 -0
  48. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/generic/date_literal.py +0 -0
  49. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/generic/default.py +0 -0
  50. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/generic/sparql/default.sparql +0 -0
  51. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/html/__init__.py +0 -0
  52. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/html/base.py +0 -0
  53. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/html/code_literal.py +0 -0
  54. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/html/default.py +0 -0
  55. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/icon.py +0 -0
  56. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/locator/sparql/get-query-to-facet.sparql +0 -0
  57. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/locator.py +0 -0
  58. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/mermaid_roadmap/__init__.py +0 -0
  59. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/mermaid_roadmap/facet.py +0 -0
  60. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/mermaid_roadmap/inference/blocks.sparql +0 -0
  61. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/mermaid_roadmap/inference/has-task-default-type.sparql +0 -0
  62. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/mermaid_roadmap/inference/task.sparql +0 -0
  63. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/mermaid_roadmap/inference/unblocked.sparql +0 -0
  64. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/mermaid_roadmap/mermaid_roadmap.yamlld +0 -0
  65. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/mermaid_roadmap/sparql/edges.sparql +0 -0
  66. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/mermaid_roadmap/sparql/nodes.sparql +0 -0
  67. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/mkdocs_material_insiders_markdown/__init__.py +0 -0
  68. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/mkdocs_material_insiders_markdown/data/mkdocs_material_insiders_markdown.yamlld +0 -0
  69. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/mkdocs_material_insiders_markdown/facet.py +0 -0
  70. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/mkdocs_material_insiders_markdown/templates/datatype.jinja2.md +0 -0
  71. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/page_title.py +0 -0
  72. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/qname.py +0 -0
  73. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/query/__init__.py +0 -0
  74. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/query/ask_result_csv.py +0 -0
  75. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/query/ask_result_json.py +0 -0
  76. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/query/ask_result_table.py +0 -0
  77. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/query/construct_result_csv.py +0 -0
  78. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/query/construct_result_json.py +0 -0
  79. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/query/construct_result_table.py +0 -0
  80. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/query/data/query_result.yamlld +0 -0
  81. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/query/select_result_csv.py +0 -0
  82. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/query/select_result_json.py +0 -0
  83. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/query/select_result_table.py +0 -0
  84. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_browser/__init__.py +0 -0
  85. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_browser/facet.py +0 -0
  86. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_browser/home.py +0 -0
  87. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_browser/location.py +0 -0
  88. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_browser/models.py +0 -0
  89. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_browser/page.py +0 -0
  90. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_class/__init__.py +0 -0
  91. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_class/facets.py +0 -0
  92. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_class/sparql/instances.sparql +0 -0
  93. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_class/textual-class.yamlld +0 -0
  94. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_default/__init__.py +0 -0
  95. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_default/facets.py +0 -0
  96. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_default/sparql/inverse-properties.sparql +0 -0
  97. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_default/sparql/label.sparql +0 -0
  98. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_default/sparql/nodes-for-property.sparql +0 -0
  99. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_default/sparql/properties.sparql +0 -0
  100. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_default/tcss/default.tcss +0 -0
  101. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_default/templates/default.md +0 -0
  102. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_default/textual-inverse-properties.yamlld +0 -0
  103. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_default/triple_uri_ref.py +0 -0
  104. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_default/widgets.py +0 -0
  105. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_graph/__init__.py +0 -0
  106. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_graph/facets.py +0 -0
  107. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_graph/sparql/triples.sparql +0 -0
  108. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_graph_triples.py +0 -0
  109. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_graphs/__init__.py +0 -0
  110. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_graphs/data/textual_graphs.yamlld +0 -0
  111. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_graphs/facets.py +0 -0
  112. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_graphs/sparql/graphs.sparql +0 -0
  113. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_link/__init__.py +0 -0
  114. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_link/facet.py +0 -0
  115. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_nanopublication/__init__.py +0 -0
  116. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_nanopublication/facet.py +0 -0
  117. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_nanopublication/models.py +0 -0
  118. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_nanopublication/nanopublication_widget.py +0 -0
  119. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_nanopublication/term_list_widget.py +0 -0
  120. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_nanopublication/term_widget.py +0 -0
  121. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_no_facet_found.py +0 -0
  122. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_ontology/__init__.py +0 -0
  123. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_ontology/facets.py +0 -0
  124. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_ontology/sparql/terms.sparql +0 -0
  125. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_ontology/sparql/visualization-vocab.sparql +0 -0
  126. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_property_pairs_table.py +0 -0
  127. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_provenance/__init__.py +0 -0
  128. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_provenance/facets.py +0 -0
  129. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_provenance/sparql/graphs.sparql +0 -0
  130. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/textual_provenance/sparql/triples.sparql +0 -0
  131. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/title/__init__.py +0 -0
  132. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/title/facets.py +0 -0
  133. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/title/sparql/title.sparql +0 -0
  134. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/title/title.yamlld +0 -0
  135. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/wikibase_statement_title/__init__.py +0 -0
  136. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/wikibase_statement_title/facets.py +0 -0
  137. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/facets/wikibase_statement_title/sparql/statement-title.sparql +0 -0
  138. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/iolanta.py +0 -0
  139. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/labeled_triple_set/__init__.py +0 -0
  140. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/labeled_triple_set/data/labeled_triple_set.yamlld +0 -0
  141. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/labeled_triple_set/labeled_triple_set.py +0 -0
  142. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/labeled_triple_set/sparql/triples.sparql +0 -0
  143. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/mcp/__init__.py +0 -0
  144. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/mcp/cli.py +0 -0
  145. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/mermaid/__init__.py +0 -0
  146. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/mermaid/facet.py +0 -0
  147. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/mermaid/mermaid.yamlld +0 -0
  148. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/mermaid/models.py +0 -0
  149. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/mermaid/sparql/ask-has-triples.sparql +0 -0
  150. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/mermaid/sparql/graph.sparql +0 -0
  151. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/mermaid/sparql/subgraphs.sparql +0 -0
  152. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/models.py +0 -0
  153. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/namespaces.py +0 -0
  154. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/parse_quads.py +0 -0
  155. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/query_result.py +0 -0
  156. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/reformat_blank_nodes.py +0 -0
  157. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/resolvers/__init__.py +0 -0
  158. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/resolvers/base.py +0 -0
  159. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/resolvers/dispatch.py +0 -0
  160. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/resolvers/pypi.py +0 -0
  161. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/resolvers/python_import.py +0 -0
  162. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/sparqlspace/__init__.py +0 -0
  163. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/sparqlspace/cli.py +0 -0
  164. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/sparqlspace/inference/wikidata-prop-label.sparql +0 -0
  165. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/sparqlspace/inference/wikidata-statement-label.sparql +0 -0
  166. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/sparqlspace/processor.py +0 -0
  167. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/sparqlspace/redirects.py +0 -0
  168. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/sparqlspace/sparqlspace.py +0 -0
  169. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/widgets/__init__.py +0 -0
  170. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/widgets/description.py +0 -0
  171. {iolanta-2.1.14 → iolanta-2.1.16}/iolanta/widgets/mixin.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iolanta
3
- Version: 2.1.14
3
+ Version: 2.1.16
4
4
  Summary: Semantic Web browser
5
5
  License: MIT
6
6
  Author: Anatoly Scherbakov
@@ -20,6 +20,7 @@ Requires-Dist: documented (>=0.1.1)
20
20
  Requires-Dist: dominate (>=2.6.0)
21
21
  Requires-Dist: fastmcp (>=2.12.4,<3.0.0)
22
22
  Requires-Dist: funcy (>=2.0)
23
+ Requires-Dist: jinja2 (>=3.1.0)
23
24
  Requires-Dist: loguru (>=0.7.3)
24
25
  Requires-Dist: more-itertools (>=9.0.0)
25
26
  Requires-Dist: nanopub (>=2.1.0,<3.0.0)
@@ -0,0 +1,15 @@
1
+ import sys
2
+ from typing import List, TypeVar
3
+
4
+ PluginClass = TypeVar("PluginClass")
5
+
6
+
7
+ if sys.version_info < (3, 10): # pragma: no cover
8
+ from importlib_metadata import entry_points
9
+ else: # pragma: no cover
10
+ from importlib.metadata import entry_points
11
+
12
+
13
+ def plugins(group_name: str) -> List[PluginClass]:
14
+ """List of plugin classes by group name."""
15
+ return [entry_point.load() for entry_point in entry_points(group=group_name)]
@@ -1,11 +1,16 @@
1
+ from __future__ import annotations
2
+
1
3
  from dataclasses import dataclass
2
- from typing import Optional
4
+ from typing import TYPE_CHECKING, Optional
3
5
 
4
6
  from documented import DocumentedError
5
7
  from rdflib.term import Node
6
8
 
7
9
  from iolanta.models import LDContext
8
10
 
11
+ if TYPE_CHECKING:
12
+ from iolanta.iolanta import Iolanta
13
+
9
14
 
10
15
  @dataclass
11
16
  class InsufficientDataForRender(DocumentedError):
@@ -14,7 +19,7 @@ class InsufficientDataForRender(DocumentedError):
14
19
  """
15
20
 
16
21
  node: Node
17
- iolanta: 'iolanta.Iolanta'
22
+ iolanta: Iolanta
18
23
 
19
24
  @property
20
25
  def is_hopeless(self) -> bool:
@@ -22,9 +27,9 @@ class InsufficientDataForRender(DocumentedError):
22
27
 
23
28
  if hopeless:
24
29
  self.iolanta.logger.error(
25
- '%s could not be rendered, we could not retrieve describing '
26
- 'data '
27
- 'from the Web.',
30
+ "%s could not be rendered, we could not retrieve describing "
31
+ "data "
32
+ "from the Web.",
28
33
  self.node,
29
34
  )
30
35
 
@@ -52,5 +57,5 @@ class UnresolvedIRI(DocumentedError):
52
57
 
53
58
  iri: str
54
59
  prefix: str
55
- file: Optional[str] = None # noqa: WPS110
60
+ file: Optional[str] = None # noqa: WPS110
56
61
  context: Optional[LDContext] = None
@@ -1,14 +1,19 @@
1
+ from __future__ import annotations
2
+
1
3
  import inspect
2
4
  from dataclasses import dataclass, field
3
5
  from functools import cached_property
4
6
  from pathlib import Path
5
- from typing import Any, Generic, Optional, TypeVar, Union
7
+ from typing import TYPE_CHECKING, Generic, Optional, TypeVar, Union
6
8
 
7
9
  from rdflib.term import Literal, Node
8
10
 
9
11
  from iolanta.models import NotLiteralNode
10
12
  from iolanta.query_result import QueryResult, SPARQLQueryArgument
11
13
 
14
+ if TYPE_CHECKING:
15
+ from iolanta.iolanta import Iolanta
16
+
12
17
  FacetOutput = TypeVar("FacetOutput")
13
18
 
14
19
 
@@ -17,17 +22,9 @@ class Facet(Generic[FacetOutput]): # noqa: WPS214
17
22
  """Base facet class."""
18
23
 
19
24
  this: Node
20
- iolanta: "iolanta.Iolanta" = field(repr=False)
25
+ iolanta: Iolanta = field(repr=False)
21
26
  as_datatype: Optional[NotLiteralNode] = None
22
27
 
23
- def __post_init__(self):
24
- if not isinstance(self.this, Node):
25
- facet_name = self.__class__.__name__
26
- this_type = type(self.this).__name__
27
- raise ValueError(
28
- f"Facet {facet_name} received a non-Node as this: {self.this} (type: {this_type})"
29
- )
30
-
31
28
  @property
32
29
  def stored_queries_path(self) -> Path:
33
30
  """Construct directory for stored queries for this facet."""
@@ -50,7 +47,7 @@ class Facet(Generic[FacetOutput]): # noqa: WPS214
50
47
  self,
51
48
  node: Union[str, Node],
52
49
  as_datatype: NotLiteralNode,
53
- ) -> Any:
50
+ ) -> object:
54
51
  """Shortcut to render something via iolanta."""
55
52
  return self.iolanta.render(
56
53
  node=node,
@@ -1,5 +1,6 @@
1
1
  import logging
2
2
  from concurrent.futures import ThreadPoolExecutor
3
+ from typing import Any, cast
3
4
 
4
5
  from rdflib.term import Node
5
6
  from rich.console import RenderableType
@@ -14,7 +15,7 @@ from iolanta.facets.textual_browser.page_switcher import (
14
15
  )
15
16
  from iolanta.iolanta import Iolanta
16
17
 
17
- POPUP_TIMEOUT = 30 # seconds
18
+ POPUP_TIMEOUT = 30 # seconds
18
19
 
19
20
 
20
21
  class DevConsoleHandler(logging.Handler):
@@ -31,9 +32,10 @@ class DevConsoleHandler(logging.Handler):
31
32
  self.console.write(message)
32
33
 
33
34
 
34
- def _log_message_to_dev_console(app: App):
35
+ def _log_message_to_dev_console(app: App[None]):
35
36
  """Log a message to the dev console."""
36
- def log_message_to_dev_console(message: str): # noqa: WPS430
37
+
38
+ def log_message_to_dev_console(message: str): # noqa: WPS430
37
39
  try:
38
40
  app.query_one(DevConsole).write(message)
39
41
  except NoMatches:
@@ -42,7 +44,7 @@ def _log_message_to_dev_console(app: App):
42
44
  return log_message_to_dev_console
43
45
 
44
46
 
45
- class IolantaBrowser(App): # noqa: WPS214, WPS230
47
+ class IolantaBrowser(App[None]): # noqa: WPS214, WPS230
46
48
  """Browse Linked Data."""
47
49
 
48
50
  def __init__(self, iolanta: Iolanta, this: Node):
@@ -53,19 +55,18 @@ class IolantaBrowser(App): # noqa: WPS214, WPS230
53
55
  super().__init__()
54
56
 
55
57
  BINDINGS = [ # noqa: WPS115
56
- ('t', 'toggle_dark', 'Toggle Dark Mode'),
57
- ('q', 'quit', 'Quit'),
58
+ ("q", "quit", "Quit"),
58
59
  ]
59
60
 
60
61
  def compose(self) -> ComposeResult:
61
62
  """Compose widgets."""
62
- yield Header(icon='👁️')
63
+ yield Header(icon="👁️")
63
64
  yield Footer()
64
- yield ConsoleSwitcher()
65
+ yield ConsoleSwitcher() # type: ignore[no-untyped-call]
65
66
 
66
67
  def on_mount(self):
67
68
  """Set title."""
68
- self.title = 'Iolanta'
69
+ self.title = "Iolanta"
69
70
 
70
71
  logging.basicConfig(
71
72
  level=logging.INFO,
@@ -79,38 +80,36 @@ class IolantaBrowser(App): # noqa: WPS214, WPS230
79
80
  )
80
81
 
81
82
  # Disable stderr logging, to not break the TUI.
82
- # Remove only the stderr handler, keep file handler
83
- for handler_id in list(self.iolanta.logger._core.handlers.keys()):
84
- handler = self.iolanta.logger._core.handlers[handler_id]
85
- if hasattr(handler, 'sink') and str(handler.sink) == '<stderr>':
86
- self.iolanta.logger.remove(handler_id)
83
+ # Remove only the stderr handler, keep file handler (loguru API)
84
+ loguru_logger = cast(Any, self.iolanta.logger)
85
+ logger_core = loguru_logger._core
86
+ for handler_id in list(logger_core.handlers.keys()):
87
+ log_handler = logger_core.handlers[handler_id]
88
+ if hasattr(log_handler, "sink") and str(log_handler.sink) == "<stderr>":
89
+ loguru_logger.remove(handler_id)
87
90
 
88
91
  # Log to the dev console.
89
- self.iolanta.logger.add(
92
+ loguru_logger.add(
90
93
  _log_message_to_dev_console(self),
91
- level='INFO',
92
- format='{time} {level} {message}',
94
+ level="INFO",
95
+ format="{time} {level} {message}",
93
96
  )
94
97
 
95
- self.iolanta.logger.add(
98
+ loguru_logger.add(
96
99
  lambda msg: self.notify(
97
100
  msg,
98
- severity='warning',
101
+ severity="warning",
99
102
  timeout=POPUP_TIMEOUT,
100
103
  ),
101
- level='WARNING',
102
- format='{message}',
104
+ level="WARNING",
105
+ format="{message}",
103
106
  )
104
107
 
105
- def action_toggle_dark(self) -> None:
106
- """Toggle dark mode."""
107
- self.dark = not self.dark
108
-
109
108
  def action_goto(
110
109
  self,
111
- destination: str,
110
+ destination: Node | str,
112
111
  facet_iri: str | None = None,
113
- ):
112
+ ) -> None:
114
113
  """Go to an IRI."""
115
114
  self.query_one(PageSwitcher).action_goto(destination, facet_iri)
116
115
 
@@ -2,16 +2,16 @@ from collections import deque
2
2
  from dataclasses import dataclass, field
3
3
  from typing import Generic, TypeVar
4
4
 
5
- LocationType = TypeVar('LocationType')
5
+ LocationType = TypeVar("LocationType")
6
6
 
7
7
 
8
8
  @dataclass
9
9
  class NavigationHistory(Generic[LocationType]):
10
10
  """Navigation history."""
11
11
 
12
- past: deque = field(default_factory=deque)
12
+ past: deque[LocationType] = field(default_factory=deque)
13
13
  current: LocationType | None = None
14
- future: deque = field(default_factory=deque)
14
+ future: deque[LocationType] = field(default_factory=deque)
15
15
 
16
16
  def goto(self, location: LocationType) -> LocationType:
17
17
  """Go to a location."""
@@ -1,3 +1,4 @@
1
+ # noqa: WPS201
1
2
  import functools
2
3
  import threading
3
4
  import uuid
@@ -21,6 +22,8 @@ from iolanta.models import NotLiteralNode
21
22
  from iolanta.namespaces import DATATYPES
22
23
  from iolanta.widgets.mixin import IolantaWidgetMixin
23
24
 
25
+ RENDER_IRI_WORKER_NAME = "render_iri"
26
+
24
27
 
25
28
  @dataclass
26
29
  class RenderResult:
@@ -37,7 +40,7 @@ class RenderResult:
37
40
  is_reload: bool
38
41
 
39
42
 
40
- class PageSwitcher(IolantaWidgetMixin, ContentSwitcher): # noqa: WPS214
43
+ class PageSwitcher(IolantaWidgetMixin, ContentSwitcher): # noqa: WPS214, WPS338
41
44
  """
42
45
  Container for open pages.
43
46
 
@@ -157,7 +160,7 @@ class PageSwitcher(IolantaWidgetMixin, ContentSwitcher): # noqa: WPS214
157
160
  renderable=renderable,
158
161
  flip_options=flip_options,
159
162
  facet_iri=facet_iri,
160
- is_reload=is_reload,
163
+ is_reload=is_reload,git
161
164
  )
162
165
 
163
166
  def on_worker_state_changed( # noqa: WPS210
@@ -208,7 +211,7 @@ class PageSwitcher(IolantaWidgetMixin, ContentSwitcher): # noqa: WPS214
208
211
  def is_loading(self) -> bool:
209
212
  """Determine if the app is presently loading something."""
210
213
  for worker in self.workers:
211
- if worker.name == "render_iri":
214
+ if worker.name == RENDER_IRI_WORKER_NAME:
212
215
  return True
213
216
 
214
217
  return False
@@ -229,7 +232,7 @@ class PageSwitcher(IolantaWidgetMixin, ContentSwitcher): # noqa: WPS214
229
232
  ),
230
233
  thread=True,
231
234
  exclusive=True,
232
- name="render_iri",
235
+ name=RENDER_IRI_WORKER_NAME,
233
236
  )
234
237
  self.refresh_bindings()
235
238
 
@@ -241,7 +244,7 @@ class PageSwitcher(IolantaWidgetMixin, ContentSwitcher): # noqa: WPS214
241
244
  )
242
245
 
243
246
  for worker in self.workers:
244
- if worker.name == "render_iri":
247
+ if worker.name == RENDER_IRI_WORKER_NAME:
245
248
  worker.cancel()
246
249
  break
247
250
 
@@ -268,9 +271,9 @@ class PageSwitcher(IolantaWidgetMixin, ContentSwitcher): # noqa: WPS214
268
271
 
269
272
  def action_goto(
270
273
  self,
271
- this: Node,
274
+ this: Node | str,
272
275
  facet_iri: str | None = None,
273
- ):
276
+ ) -> None:
274
277
  """Go to an IRI."""
275
278
  # Convert string to Node if needed.
276
279
  # This happens when called via Textual action strings (from keyboard bindings
@@ -293,21 +296,23 @@ class PageSwitcher(IolantaWidgetMixin, ContentSwitcher): # noqa: WPS214
293
296
  ),
294
297
  thread=True,
295
298
  exclusive=True,
296
- name="render_iri",
299
+ name=RENDER_IRI_WORKER_NAME,
297
300
  )
298
301
  self.refresh_bindings()
299
302
 
300
303
  def action_back(self):
301
304
  """Go backward."""
302
305
  self.current = self.history.back().page_id
303
- if page := self.visible_content:
306
+ page = self.visible_content
307
+ if page:
304
308
  page.focus()
305
309
 
306
310
  def action_forward(self):
307
311
  """Go forward."""
308
312
  self.current = self.history.forward().page_id
309
313
  self.focus()
310
- if page := self.visible_content:
314
+ page = self.visible_content
315
+ if page:
311
316
  page.focus()
312
317
 
313
318
 
@@ -330,7 +335,7 @@ class ConsoleSwitcher(ContentSwitcher):
330
335
  class DevConsole(RichLog):
331
336
  """Development console."""
332
337
 
333
- BINDINGS = [
338
+ BINDINGS = [ # noqa: WPS115
334
339
  ("f12,escape", "close", "Close Console"),
335
340
  ]
336
341
 
@@ -22,16 +22,16 @@ def _object_to_qname(node: URIRef, graph: Graph):
22
22
  @node_to_qname.instance(URIRef)
23
23
  def _uriref_to_qname(node: URIRef, graph: Graph):
24
24
  try:
25
- qname = ComputedQName(*graph.compute_qname(node)) # type: ignore
25
+ qname = ComputedQName(*graph.compute_qname(node))
26
26
 
27
27
  except ValueError:
28
28
  return node
29
29
 
30
30
  except NameError as err:
31
- logger.exception(f'NameError! On: {node} Error: {err}')
31
+ logger.exception(f"NameError! On: {node} Error: {err}")
32
32
  return node
33
33
 
34
- if qname.namespace_name.startswith('ns'):
34
+ if qname.namespace_name.startswith("ns"):
35
35
  return node
36
36
 
37
37
  return qname
@@ -1,43 +1,44 @@
1
+ from __future__ import annotations
2
+
1
3
  import inspect
2
4
  from abc import ABC
3
5
  from dataclasses import dataclass, field
4
6
  from logging import Logger
5
7
  from pathlib import Path
6
- from typing import List, Optional
7
-
8
- from rdflib.term import Node
9
- from typer import Typer
8
+ from typing import TYPE_CHECKING, Optional
10
9
 
11
10
  from iolanta.models import TripleTemplate
12
11
 
12
+ if TYPE_CHECKING:
13
+ from typer import Typer # noqa: F401
14
+
15
+ from iolanta.iolanta import Iolanta
16
+
13
17
 
14
18
  @dataclass
15
19
  class Plugin(ABC):
16
20
  """Base Iolanta plugin."""
17
21
 
18
- iolanta: 'iolanta.Iolanta' = field(repr=False)
22
+ iolanta: Iolanta = field(repr=False)
19
23
 
20
24
  @property
21
25
  def logger(self) -> Logger:
22
26
  return self.iolanta.logger
23
27
 
24
- @property
25
- def typer_app(self) -> Optional[Typer]:
26
- """Typer app for this plugin's CLI."""
27
- return None
28
-
29
28
  @property
30
29
  def files_directory(self) -> Path:
31
- return Path(inspect.getfile(self.__class__)).parent / 'data'
30
+ return Path(inspect.getfile(self.__class__)).parent / "data"
32
31
 
33
32
  @property
34
33
  def context_path(self) -> Optional[Path]:
35
- if (context_path := self.files_directory / 'context.yaml').is_file():
34
+ context_path = self.files_directory / "context.yaml"
35
+ if context_path.is_file():
36
36
  return context_path
37
37
 
38
38
  @property
39
- def data_files(self):
39
+ def data_files(self) -> Path:
40
+ """Directory containing plugin data files."""
40
41
  return self.files_directory
41
42
 
42
- def retrieve_triple(self, triple_template: TripleTemplate):
43
+ def retrieve_triple(self, triple_template: TripleTemplate) -> None:
43
44
  """Save datasets which might describe the given node into project."""
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "iolanta"
3
- version = "2.1.14"
3
+ version = "2.1.16"
4
4
  description = "Semantic Web browser"
5
5
  authors = ["Anatoly Scherbakov <altaisoft@gmail.com>"]
6
6
  license = "MIT"
@@ -8,6 +8,7 @@ readme = "README.md"
8
8
 
9
9
  [tool.poetry.dependencies]
10
10
  python = ">=3.12,<4.0"
11
+ jinja2 = ">=3.1.0"
11
12
  rdflib = "<8.0"
12
13
  python-frontmatter = ">=0.5.0"
13
14
  requests = ">=2.25.1"
@@ -1,18 +0,0 @@
1
- import sys
2
- from typing import List, Type, TypeVar
3
-
4
- PluginClass = TypeVar('PluginClass')
5
-
6
-
7
- if sys.version_info < (3, 10): # pragma: no cover
8
- from importlib_metadata import entry_points
9
- else: # pragma: no cover
10
- from importlib.metadata import entry_points
11
-
12
-
13
- def plugins(group_name: str) -> List[PluginClass]:
14
- """List of plugin classes by group name."""
15
- return [
16
- entry_point.load() # type: ignore
17
- for entry_point in entry_points(group=group_name) # type: ignore
18
- ]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes