iolanta 2.1.6__tar.gz → 2.1.7__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 (150) hide show
  1. {iolanta-2.1.6 → iolanta-2.1.7}/PKG-INFO +4 -3
  2. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/data/context.yaml +1 -1
  3. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/data/iolanta.yaml +1 -1
  4. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/data/textual-browser.yaml +1 -7
  5. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/declension/data/declension.yamlld +1 -1
  6. iolanta-2.1.7/iolanta/facets/mkdocs_material_insiders_markdown/__init__.py +4 -0
  7. iolanta-2.1.7/iolanta/facets/mkdocs_material_insiders_markdown/data/mkdocs_material_insiders_markdown.yamlld +20 -0
  8. iolanta-2.1.7/iolanta/facets/mkdocs_material_insiders_markdown/facet.py +86 -0
  9. iolanta-2.1.7/iolanta/facets/mkdocs_material_insiders_markdown/templates/datatype.jinja2.md +24 -0
  10. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/iolanta.py +4 -3
  11. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/labeled_triple_set/data/labeled_triple_set.yamlld +1 -1
  12. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/models.py +0 -3
  13. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/namespaces.py +2 -2
  14. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/parse_quads.py +2 -2
  15. iolanta-2.1.7/iolanta/sparqlspace/inference/wikidata-prop-label.sparql +10 -0
  16. iolanta-2.1.7/iolanta/sparqlspace/inference/wikidata-statement-label.sparql +27 -0
  17. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/sparqlspace/processor.py +78 -76
  18. {iolanta-2.1.6 → iolanta-2.1.7}/pyproject.toml +3 -4
  19. iolanta-2.1.6/iolanta/sparqlspace/inference/wikibase-claim.sparql +0 -9
  20. iolanta-2.1.6/iolanta/sparqlspace/inference/wikibase-statement-property.sparql +0 -9
  21. {iolanta-2.1.6 → iolanta-2.1.7}/README.md +0 -0
  22. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/__init__.py +0 -0
  23. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/base_plugin.py +0 -0
  24. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/cli/__init__.py +0 -0
  25. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/cli/formatters/__init__.py +0 -0
  26. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/cli/formatters/choose.py +0 -0
  27. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/cli/formatters/csv.py +0 -0
  28. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/cli/formatters/json.py +0 -0
  29. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/cli/formatters/pretty.py +0 -0
  30. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/cli/main.py +0 -0
  31. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/cli/models.py +0 -0
  32. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/cli/pretty_print.py +0 -0
  33. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/context.py +0 -0
  34. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/conversions.py +0 -0
  35. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/data/graph-triples.yamlld +0 -0
  36. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/declension/__init__.py +0 -0
  37. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/declension/facet.py +0 -0
  38. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/declension/sparql/declension.sparql +0 -0
  39. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/ensure_is_context.py +0 -0
  40. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/entry_points.py +0 -0
  41. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/errors.py +0 -0
  42. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/__init__.py +0 -0
  43. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/cli/__init__.py +0 -0
  44. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/cli/base.py +0 -0
  45. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/cli/default.py +0 -0
  46. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/cli/record.py +0 -0
  47. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/cli/sparql/link.sparql +0 -0
  48. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/cli/sparql/record.sparql +0 -0
  49. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/errors.py +0 -0
  50. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/facet.py +0 -0
  51. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/foaf_person_title/__init__.py +0 -0
  52. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/foaf_person_title/facet.py +0 -0
  53. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/foaf_person_title/sparql/names.sparql +0 -0
  54. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/generic/__init__.py +0 -0
  55. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/generic/bool_literal.py +0 -0
  56. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/generic/date_literal.py +0 -0
  57. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/generic/default.py +0 -0
  58. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/generic/sparql/default.sparql +0 -0
  59. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/html/__init__.py +0 -0
  60. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/html/base.py +0 -0
  61. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/html/code_literal.py +0 -0
  62. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/html/default.py +0 -0
  63. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/icon.py +0 -0
  64. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/locator/sparql/get-query-to-facet.sparql +0 -0
  65. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/locator.py +0 -0
  66. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/page_title.py +0 -0
  67. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/qname.py +0 -0
  68. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_browser/__init__.py +0 -0
  69. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_browser/app.py +0 -0
  70. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_browser/facet.py +0 -0
  71. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_browser/history.py +0 -0
  72. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_browser/home.py +0 -0
  73. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_browser/location.py +0 -0
  74. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_browser/models.py +0 -0
  75. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_browser/page.py +0 -0
  76. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_browser/page_switcher.py +0 -0
  77. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_class/__init__.py +0 -0
  78. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_class/facets.py +0 -0
  79. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_class/sparql/instances.sparql +0 -0
  80. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_default/__init__.py +0 -0
  81. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_default/facets.py +0 -0
  82. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_default/sparql/inverse-properties.sparql +0 -0
  83. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_default/sparql/label.sparql +0 -0
  84. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_default/sparql/nodes-for-property.sparql +0 -0
  85. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_default/sparql/properties.sparql +0 -0
  86. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_default/tcss/default.tcss +0 -0
  87. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_default/templates/default.md +0 -0
  88. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_default/triple_uri_ref.py +0 -0
  89. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_default/widgets.py +0 -0
  90. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_graph/__init__.py +0 -0
  91. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_graph/facets.py +0 -0
  92. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_graph/sparql/triples.sparql +0 -0
  93. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_graph_triples.py +0 -0
  94. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_graphs/__init__.py +0 -0
  95. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_graphs/data/textual_graphs.yamlld +0 -0
  96. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_graphs/facets.py +0 -0
  97. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_graphs/sparql/graphs.sparql +0 -0
  98. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_link/__init__.py +0 -0
  99. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_link/facet.py +0 -0
  100. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_nanopublication/__init__.py +0 -0
  101. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_nanopublication/facet.py +0 -0
  102. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_nanopublication/models.py +0 -0
  103. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_nanopublication/nanopublication_widget.py +0 -0
  104. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_nanopublication/term_list_widget.py +0 -0
  105. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_nanopublication/term_widget.py +0 -0
  106. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_no_facet_found.py +0 -0
  107. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_ontology/__init__.py +0 -0
  108. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_ontology/facets.py +0 -0
  109. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_ontology/sparql/terms.sparql +0 -0
  110. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_ontology/sparql/visualization-vocab.sparql +0 -0
  111. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_property_pairs_table.py +0 -0
  112. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_provenance/__init__.py +0 -0
  113. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_provenance/facets.py +0 -0
  114. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_provenance/sparql/graphs.sparql +0 -0
  115. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/textual_provenance/sparql/triples.sparql +0 -0
  116. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/title/__init__.py +0 -0
  117. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/title/facets.py +0 -0
  118. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/title/sparql/title.sparql +0 -0
  119. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/wikibase_statement_title/__init__.py +0 -0
  120. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/wikibase_statement_title/facets.py +0 -0
  121. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/facets/wikibase_statement_title/sparql/statement-title.sparql +0 -0
  122. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/labeled_triple_set/__init__.py +0 -0
  123. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/labeled_triple_set/labeled_triple_set.py +0 -0
  124. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/labeled_triple_set/sparql/triples.sparql +0 -0
  125. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/mcp/__init__.py +0 -0
  126. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/mcp/cli.py +0 -0
  127. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/mcp/prompts/nanopublication_assertion_authoring_rules.md +0 -0
  128. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/mcp/prompts/rules.md +0 -0
  129. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/mermaid/__init__.py +0 -0
  130. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/mermaid/facet.py +0 -0
  131. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/mermaid/mermaid.yamlld +0 -0
  132. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/mermaid/models.py +0 -0
  133. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/mermaid/sparql/ask-has-triples.sparql +0 -0
  134. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/mermaid/sparql/graph.sparql +0 -0
  135. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/mermaid/sparql/subgraphs.sparql +0 -0
  136. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/node_to_qname.py +0 -0
  137. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/plugin.py +0 -0
  138. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/query_result.py +0 -0
  139. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/reformat_blank_nodes.py +0 -0
  140. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/resolvers/__init__.py +0 -0
  141. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/resolvers/base.py +0 -0
  142. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/resolvers/dispatch.py +0 -0
  143. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/resolvers/pypi.py +0 -0
  144. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/resolvers/python_import.py +0 -0
  145. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/sparqlspace/__init__.py +0 -0
  146. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/sparqlspace/cli.py +0 -0
  147. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/sparqlspace/sparqlspace.py +0 -0
  148. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/widgets/__init__.py +0 -0
  149. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/widgets/description.py +0 -0
  150. {iolanta-2.1.6 → iolanta-2.1.7}/iolanta/widgets/mixin.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: iolanta
3
- Version: 2.1.6
3
+ Version: 2.1.7
4
4
  Summary: Semantic Web browser
5
5
  License: MIT
6
6
  Author: Anatoly Scherbakov
@@ -10,6 +10,7 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.12
12
12
  Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: 3.14
13
14
  Provides-Extra: all
14
15
  Requires-Dist: boltons (>=24.0.0)
15
16
  Requires-Dist: classes (>=0.4.0)
@@ -33,7 +34,7 @@ Requires-Dist: rich (>=13.3.1)
33
34
  Requires-Dist: textual (>=0.83.0)
34
35
  Requires-Dist: typer (>=0.9.0)
35
36
  Requires-Dist: watchfiles (>=1.0.4)
36
- Requires-Dist: yaml-ld (>=1.1.14,<2.0.0)
37
+ Requires-Dist: yaml-ld (>=1.1.15)
37
38
  Requires-Dist: yarl (>=1.9.4)
38
39
  Description-Content-Type: text/markdown
39
40
 
@@ -1,5 +1,5 @@
1
1
  "@context":
2
- rdfs: "https://www.w3.org/2000/01/rdf-schema#"
2
+ rdfs: "http://www.w3.org/2000/01/rdf-schema#"
3
3
  rdf: https://www.w3.org/1999/02/22-rdf-syntax-ns#
4
4
  iolanta: https://iolanta.tech/
5
5
  owl: https://www.w3.org/2002/07/owl#
@@ -4,7 +4,7 @@
4
4
  foaf: https://xmlns.com/foaf/0.1/
5
5
  owl: https://www.w3.org/2002/07/owl#
6
6
  iolanta: https://iolanta.tech/
7
- rdfs: "https://www.w3.org/2000/01/rdf-schema#"
7
+ rdfs: "http://www.w3.org/2000/01/rdf-schema#"
8
8
  rdf: https://www.w3.org/1999/02/22-rdf-syntax-ns#
9
9
 
10
10
  $included:
@@ -4,7 +4,7 @@
4
4
  foaf: https://xmlns.com/foaf/0.1/
5
5
  owl: https://www.w3.org/2002/07/owl#
6
6
  iolanta: https://iolanta.tech/
7
- rdfs: "https://www.w3.org/2000/01/rdf-schema#"
7
+ rdfs: "http://www.w3.org/2000/01/rdf-schema#"
8
8
  rdf: https://www.w3.org/1999/02/22-rdf-syntax-ns#
9
9
  np: https://www.nanopub.org/nschema#
10
10
  dcterms: https://purl.org/dc/terms/
@@ -88,12 +88,6 @@
88
88
  iolanta:hasDefaultFacet:
89
89
  $id: pkg:pypi/iolanta#textual-link
90
90
 
91
- - $id: https://wikiba.se/ontology#Statement
92
- iolanta:hasInstanceFacet:
93
- $id: pkg:pypi/iolanta#wikibase-statement-title
94
- $: Title
95
- →: https://iolanta.tech/datatypes/title
96
-
97
91
  - $id: rdfs:Class
98
92
  iolanta:hasInstanceFacet:
99
93
  $id: pkg:pypi/iolanta#textual-class
@@ -4,7 +4,7 @@
4
4
  foaf: https://xmlns.com/foaf/0.1/
5
5
  owl: https://www.w3.org/2002/07/owl#
6
6
  iolanta: https://iolanta.tech/
7
- rdfs: "https://www.w3.org/2000/01/rdf-schema#"
7
+ rdfs: "http://www.w3.org/2000/01/rdf-schema#"
8
8
  rdf: https://www.w3.org/1999/02/22-rdf-syntax-ns#
9
9
  dcterms: https://purl.org/dc/terms/
10
10
  dcam: https://purl.org/dc/dcam/
@@ -0,0 +1,4 @@
1
+ from iolanta.facets.mkdocs_material_insiders_markdown.facet import MkDocsMaterialInsidersMarkdownFacet
2
+
3
+ __all__ = ['MkDocsMaterialInsidersMarkdownFacet']
4
+
@@ -0,0 +1,20 @@
1
+ "@context":
2
+ "@import": https://json-ld.org/contexts/dollar-convenience.jsonld
3
+ rdfs: "http://www.w3.org/2000/01/rdf-schema#"
4
+ rdf: https://www.w3.org/1999/02/22-rdf-syntax-ns#
5
+ iolanta: https://iolanta.tech/
6
+
7
+ $: rdfs:label
8
+
9
+ →:
10
+ "@type": "@id"
11
+ "@id": iolanta:outputs
12
+
13
+ ↦: iolanta:matches
14
+
15
+ $id: pkg:pypi/iolanta#mkdocs-material-insiders-markdown-datatype
16
+ $: OutputDatatype (mkdocs-material-insiders-markdown)
17
+
18
+ →: https://iolanta.tech/datatypes/mkdocs-material-insiders-markdown
19
+
20
+ ↦: ASK WHERE { $this a iolanta:OutputDatatype }
@@ -0,0 +1,86 @@
1
+ from pathlib import Path
2
+
3
+ from jinja2 import Environment, FileSystemLoader
4
+ from rdflib import URIRef
5
+
6
+ from iolanta.facets.facet import Facet
7
+ from iolanta.namespaces import DATATYPES, IOLANTA, RDF, RDFS
8
+
9
+
10
+ class MkDocsMaterialInsidersMarkdownFacet(Facet[str]):
11
+ """Render rdfs:Datatype nodes as mkdocs-material-insiders-markdown."""
12
+
13
+ META = Path(__file__).parent / 'data' / 'mkdocs_material_insiders_markdown.yamlld'
14
+ """Render rdfs:Datatype nodes as mkdocs-material-insiders-markdown."""
15
+
16
+ @property
17
+ def _template_env(self) -> Environment:
18
+ """Jinja2 template environment."""
19
+ template_path = Path(__file__).parent / 'templates'
20
+ return Environment(
21
+ loader=FileSystemLoader(str(template_path)),
22
+ autoescape=False,
23
+ )
24
+
25
+ def show(self) -> str:
26
+ """Render the datatype as markdown."""
27
+ # Get the label using title facet
28
+ label = self.render(
29
+ self.this,
30
+ as_datatype=DATATYPES.title,
31
+ )
32
+
33
+ # Get the comment/description
34
+ comment_rows = self.query(
35
+ """
36
+ SELECT ?comment WHERE {
37
+ $this rdfs:comment ?comment .
38
+ }
39
+ LIMIT 1
40
+ """,
41
+ this=self.this,
42
+ )
43
+ comment = str(comment_rows[0]['comment']) if comment_rows else None
44
+
45
+ # Get all types (rdf:type)
46
+ type_rows = self.query(
47
+ """
48
+ SELECT ?type WHERE {
49
+ $this rdf:type ?type .
50
+ }
51
+ """,
52
+ this=self.this,
53
+ )
54
+ types = [
55
+ {
56
+ 'uri': row['type'],
57
+ 'title': self.render(row['type'], as_datatype=DATATYPES.title),
58
+ }
59
+ for row in type_rows
60
+ ]
61
+
62
+ # Get all superclasses (rdfs:subClassOf)
63
+ superclass_rows = self.query(
64
+ """
65
+ SELECT ?superclass WHERE {
66
+ $this rdfs:subClassOf ?superclass .
67
+ }
68
+ """,
69
+ this=self.this,
70
+ )
71
+ superclasses = [
72
+ {
73
+ 'uri': row['superclass'],
74
+ 'title': self.render(row['superclass'], as_datatype=DATATYPES.title),
75
+ }
76
+ for row in superclass_rows
77
+ ]
78
+
79
+ template = self._template_env.get_template('datatype.jinja2.md')
80
+ return template.render(
81
+ label=label,
82
+ comment=comment,
83
+ types=types,
84
+ superclasses=superclasses,
85
+ )
86
+
@@ -0,0 +1,24 @@
1
+ # {{ label }}
2
+
3
+ <table>
4
+ <thead>
5
+ </thead>
6
+ <tbody>
7
+ {% if types %}
8
+ <tr>
9
+ <td>∈ Instance Of</td>
10
+ <td>{% for type in types %}<code><a href="{{ type.uri }}">{{ type.title }}</a></code>{% if not loop.last %}, {% endif %}{% endfor %}</td>
11
+ </tr>
12
+ {% endif %}
13
+ {% if superclasses %}
14
+ <tr>
15
+ <td>⊊ Subclass Of</td>
16
+ <td>{% for superclass in superclasses %}<code><a href="{{ superclass.uri }}">{{ superclass.title }}</a></code>{% if not loop.last %}, {% endif %}{% endfor %}</td>
17
+ </tr>
18
+ {% endif %}
19
+ </tbody>
20
+ </table>
21
+
22
+ {% if comment %}
23
+ {{ comment | safe }}
24
+ {% endif %}
@@ -119,7 +119,7 @@ class Iolanta: # noqa: WPS214
119
119
  processor='sparqlspace',
120
120
  initBindings=kwargs,
121
121
  )
122
- except ParseException as err:
122
+ except SyntaxError as err:
123
123
  raise SPARQLParseException(
124
124
  error=err,
125
125
  query=query_text,
@@ -171,8 +171,9 @@ class Iolanta: # noqa: WPS214
171
171
  self.logger.error(f'{source} | {parser_not_found}')
172
172
  continue
173
173
  except YAMLLDError as yaml_ld_error:
174
- self.logger.error(f'{source} | {yaml_ld_error}')
175
- continue
174
+ # .add() only processes local files, so errors should be raised
175
+ self.logger.error(f'{source_file} | {yaml_ld_error}')
176
+ raise
176
177
  except ValueError as value_error:
177
178
  self.logger.error(f'{source} | {value_error}')
178
179
  continue
@@ -4,7 +4,7 @@
4
4
  foaf: https://xmlns.com/foaf/0.1/
5
5
  owl: https://www.w3.org/2002/07/owl#
6
6
  iolanta: https://iolanta.tech/
7
- rdfs: "https://www.w3.org/2000/01/rdf-schema#"
7
+ rdfs: "http://www.w3.org/2000/01/rdf-schema#"
8
8
  rdf: https://www.w3.org/1999/02/22-rdf-syntax-ns#
9
9
  dcterms: https://purl.org/dc/terms/
10
10
  dcam: https://purl.org/dc/dcam/
@@ -83,9 +83,6 @@ class TripleTemplate(NamedTuple):
83
83
 
84
84
 
85
85
  def _normalize_term(term: Node):
86
- if isinstance(term, URIRef) and term.startswith('http://'):
87
- return URIRef(re.sub('^http', 'https', term))
88
-
89
86
  return term
90
87
 
91
88
 
@@ -20,11 +20,11 @@ class OWL(rdflib.OWL):
20
20
 
21
21
 
22
22
  class RDFS(rdflib.RDFS):
23
- _NS = rdflib.Namespace('https://www.w3.org/2000/01/rdf-schema#')
23
+ _NS = rdflib.Namespace('http://www.w3.org/2000/01/rdf-schema#')
24
24
 
25
25
 
26
26
  class RDF(rdflib.RDF):
27
- _NS = rdflib.Namespace('https://www.w3.org/1999/02/22-rdf-syntax-ns#')
27
+ _NS = rdflib.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#')
28
28
 
29
29
 
30
30
  class DCTERMS(rdflib.DCTERMS):
@@ -13,8 +13,8 @@ from iolanta.models import Quad
13
13
  from iolanta.namespaces import IOLANTA, META
14
14
 
15
15
  NORMALIZE_TERMS_MAP = MappingProxyType({
16
- URIRef(_url := 'https://www.w3.org/2002/07/owl'): URIRef(f'{_url}#'),
17
- URIRef(_url := 'https://www.w3.org/2000/01/rdf-schema'): URIRef(f'{_url}#'),
16
+ URIRef(_url := 'http://www.w3.org/2002/07/owl'): URIRef(f'{_url}#'),
17
+ URIRef(_url := 'http://www.w3.org/2000/01/rdf-schema'): URIRef(f'{_url}#'),
18
18
  })
19
19
 
20
20
 
@@ -0,0 +1,10 @@
1
+ PREFIX wikibase: <http://wikiba.se/ontology#>
2
+
3
+ CONSTRUCT {
4
+ ?thing rdfs:label ?label .
5
+ }
6
+ WHERE {
7
+ ?entity
8
+ (wikibase:claim | wikibase:qualifier | wikibase:statementProperty | wikibase:statementValueNormalized) ?thing ;
9
+ rdfs:label ?label .
10
+ }
@@ -0,0 +1,27 @@
1
+ PREFIX wikibase: <http://wikiba.se/ontology#>
2
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3
+ PREFIX prov: <http://www.w3.org/ns/prov#>
4
+
5
+ CONSTRUCT {
6
+ ?statement rdfs:label ?label .
7
+ }
8
+ WHERE {
9
+ ?statement a wikibase:Statement .
10
+
11
+ # Find predicates from statement to values (excluding metadata predicates)
12
+ ?statement ?statementProp ?value .
13
+
14
+ FILTER(?statementProp != wikibase:rank)
15
+ FILTER(?statementProp != rdf:type)
16
+ FILTER(?statementProp != prov:wasDerivedFrom)
17
+ FILTER(?statementProp != iolanta:last-loaded-time)
18
+
19
+ # Handle entity values: get their label
20
+ {
21
+ ?value rdfs:label ?label .
22
+ } UNION {
23
+ # Handle literal values: use the literal directly
24
+ ?statement ?statementProp ?label .
25
+ FILTER(isLiteral(?label))
26
+ }
27
+ }
@@ -35,6 +35,7 @@ from iolanta.namespaces import ( # noqa: WPS235
35
35
  DCTERMS,
36
36
  FOAF,
37
37
  IOLANTA,
38
+ LOCAL,
38
39
  META,
39
40
  OWL,
40
41
  PROV,
@@ -46,6 +47,8 @@ from iolanta.parse_quads import NORMALIZE_TERMS_MAP, parse_quads
46
47
 
47
48
  REASONING_ENABLED = True
48
49
  OWL_REASONING_ENABLED = False
50
+
51
+ INFERENCE_DIR = Path(__file__).parent / 'inference'
49
52
  INDICES = [
50
53
  URIRef('https://iolanta.tech/visualizations/index.yaml'),
51
54
  ]
@@ -112,7 +115,7 @@ def _extract_from_mapping( # noqa: WPS213
112
115
  algebra: Mapping[str, Any],
113
116
  ) -> Iterable[URIRef | Variable]:
114
117
  match algebra.name:
115
- case 'SelectQuery' | 'AskQuery' | 'Project' | 'Distinct':
118
+ case 'SelectQuery' | 'AskQuery' | 'Project' | 'Distinct' | 'Slice':
116
119
  yield from extract_mentioned_urls(algebra['p'])
117
120
 
118
121
  case 'BGP':
@@ -203,9 +206,6 @@ def normalize_term(term: Node) -> Node:
203
206
  * A dirty hack;
204
207
  * Based on hard code.
205
208
  """
206
- if isinstance(term, URIRef) and term.startswith('http://'):
207
- term = URIRef(re.sub('^http', 'https', term))
208
-
209
209
  return NORMALIZE_TERMS_MAP.get(term, term)
210
210
 
211
211
 
@@ -263,6 +263,12 @@ def _extract_nanopublication_uris(
263
263
  match algebra.name:
264
264
  case 'SelectQuery' | 'AskQuery' | 'Project' | 'Distinct' | 'Graph':
265
265
  yield from _extract_nanopublication_uris(algebra['p'])
266
+ case 'ConstructQuery':
267
+ # CONSTRUCT queries don't have nanopublication URIs in bindings
268
+ return
269
+
270
+ case 'Slice':
271
+ yield from _extract_nanopublication_uris(algebra['p'])
266
272
 
267
273
  case 'BGP':
268
274
  for retractor, retracts, retractee in algebra['triples']:
@@ -404,64 +410,6 @@ class GlobalSPARQLProcessor(Processor): # noqa: WPS338, WPS214
404
410
  self.graph.last_not_inferred_source = None
405
411
  self.graph._indices_loaded = False
406
412
 
407
- def _infer_with_sparql(self):
408
- """
409
- Infer triples with SPARQL rules.
410
-
411
- FIXME:
412
- * Code these rules into SHACL or some other RDF based syntax;
413
- * Make them available at iolanta.tech/visualizations/ and indexed.
414
- """
415
- inference = Path(__file__).parent / 'inference'
416
-
417
- file_names = {
418
- 'wikibase-claim.sparql': URIRef('local:inference-wikibase-claim'),
419
- 'wikibase-statement-property.sparql': URIRef(
420
- 'local:inference-statement-property',
421
- ),
422
- }
423
-
424
- for file_name, graph_name in file_names.items():
425
- start_time = time.time()
426
- self.graph.update(
427
- update_object=(inference / file_name).read_text(),
428
- )
429
- triple_count = len(self.graph.get_context(graph_name))
430
- duration = datetime.timedelta(seconds=time.time() - start_time)
431
- self.logger.info(
432
- f'{file_name}: {triple_count} triple(s), '
433
- f'inferred at {duration}',
434
- )
435
-
436
- def maybe_apply_inference(self):
437
- """Apply global OWL RL inference if necessary."""
438
- if not REASONING_ENABLED:
439
- return
440
-
441
- if self.graph.last_not_inferred_source is None:
442
- return
443
-
444
- with self.inference_lock:
445
- self._infer_with_sparql()
446
- self._infer_with_owl_rl()
447
- self.logger.info('Inference @ cyberspace: complete.')
448
-
449
- self.graph.last_not_inferred_source = None
450
-
451
- def _infer_with_owl_rl(self):
452
- if not OWL_REASONING_ENABLED:
453
- return
454
-
455
- reasoner = reasonable.PyReasoner()
456
- reasoner.from_graph(self.graph)
457
- inferred_triples = reasoner.reason()
458
- inference_graph_name = BNode('_:inference')
459
- inferred_quads = [
460
- (*triple, inference_graph_name)
461
- for triple in inferred_triples
462
- ]
463
- self.graph.addN(inferred_quads)
464
-
465
413
  def _maybe_load_indices(self):
466
414
  if not self.graph._indices_loaded:
467
415
  for index in INDICES:
@@ -486,7 +434,7 @@ class GlobalSPARQLProcessor(Processor): # noqa: WPS338, WPS214
486
434
 
487
435
  initBindings = initBindings or {}
488
436
  initNs = initNs or {}
489
-
437
+
490
438
  if isinstance(strOrQuery, Query):
491
439
  query = strOrQuery
492
440
 
@@ -494,12 +442,14 @@ class GlobalSPARQLProcessor(Processor): # noqa: WPS338, WPS214
494
442
  parse_tree = parseQuery(strOrQuery)
495
443
  query = translateQuery(parse_tree, base, initNs)
496
444
 
497
- self.load_retracting_nanopublications_by_query(
498
- query=query,
499
- bindings=initBindings,
500
- base=base,
501
- namespaces=initNs,
502
- )
445
+ # Only extract nanopublications from SELECT/ASK queries, not CONSTRUCT
446
+ if query.algebra.name != 'ConstructQuery':
447
+ self.load_retracting_nanopublications_by_query(
448
+ query=query,
449
+ bindings=initBindings,
450
+ base=base,
451
+ namespaces=initNs,
452
+ )
503
453
 
504
454
  query, urls = extract_mentioned_urls_from_query(
505
455
  query=query,
@@ -508,15 +458,24 @@ class GlobalSPARQLProcessor(Processor): # noqa: WPS338, WPS214
508
458
  namespaces=initNs,
509
459
  )
510
460
 
461
+ # Filter out inference graph names (they're not URLs to load)
462
+ urls = {url for url in urls if not str(url).startswith('inference:')}
463
+
511
464
  for url in urls:
512
465
  try:
513
466
  self.load(url)
514
467
  except Exception as err:
515
468
  self.logger.exception(f'Failed to load {url}: {err}', url, err)
516
469
 
517
- NanopubQueryPlugin(graph=self.graph)(query, bindings=initBindings)
470
+ # Run inference if there's new data since last inference run
471
+ # (after URLs are loaded so inference can use the loaded data)
472
+ if self.graph.last_not_inferred_source is not None:
473
+ self.logger.debug(f'Running inference, last_not_inferred_source: {self.graph.last_not_inferred_source}')
474
+ self._run_inference()
475
+ else:
476
+ self.logger.debug('Skipping inference, last_not_inferred_source is None')
518
477
 
519
- self.maybe_apply_inference()
478
+ NanopubQueryPlugin(graph=self.graph)(query, bindings=initBindings)
520
479
 
521
480
  is_anything_loaded = True
522
481
  while is_anything_loaded:
@@ -531,6 +490,7 @@ class GlobalSPARQLProcessor(Processor): # noqa: WPS338, WPS214
531
490
  return query_result
532
491
 
533
492
  for row in bindings:
493
+ break
534
494
  for _, maybe_iri in row.items():
535
495
  if (
536
496
  isinstance(maybe_iri, URIRef)
@@ -566,12 +526,10 @@ class GlobalSPARQLProcessor(Processor): # noqa: WPS338, WPS214
566
526
 
567
527
  def _follow_is_visualized_with_links(self, uri: URIRef):
568
528
  """Follow `dcterms:isReferencedBy` links."""
569
- self.logger.info(f'Following links for {uri}…')
570
529
  triples = self.graph.triples((uri, DCTERMS.isReferencedBy, None))
571
530
  for _, _, visualization in triples:
572
531
  if isinstance(visualization, URIRef):
573
532
  self.load(visualization)
574
- self.logger.info('Links followed.')
575
533
 
576
534
  def load( # noqa: C901, WPS210, WPS212, WPS213, WPS231
577
535
  self,
@@ -611,8 +569,6 @@ class GlobalSPARQLProcessor(Processor): # noqa: WPS338, WPS214
611
569
  source_uri = normalize_term(source)
612
570
  if self._is_loaded(source_uri):
613
571
  return Skipped()
614
- else:
615
- self.logger.info(f'{source_uri} is not loaded yet')
616
572
 
617
573
  # FIXME This is definitely inefficient. However, python-yaml-ld caches
618
574
  # the document, so the performance overhead is not super high.
@@ -718,8 +674,9 @@ class GlobalSPARQLProcessor(Processor): # noqa: WPS338, WPS214
718
674
  for quad in quads
719
675
  })
720
676
  self.logger.info(
721
- f'{source} | loaded successfully into graphs: {into_graphs}',
677
+ f'{source} | loaded {len(quads)} triples into graphs: {into_graphs}',
722
678
  )
679
+
723
680
  return Loaded()
724
681
 
725
682
  def resolve_term(self, term: Node, bindings: dict[str, Node]):
@@ -732,6 +689,51 @@ class GlobalSPARQLProcessor(Processor): # noqa: WPS338, WPS214
732
689
 
733
690
  return term
734
691
 
692
+ def _run_inference(self): # noqa: WPS231
693
+ """
694
+ Run inference queries from the inference directory.
695
+
696
+ For each SPARQL file in the inference directory:
697
+ 1. Truncate the named graph `local:inference-{filename}`
698
+ 2. Execute the CONSTRUCT query
699
+ 3. Insert the resulting triples into that graph
700
+ """
701
+ with self.inference_lock:
702
+ for inference_file in INFERENCE_DIR.glob('*.sparql'):
703
+ filename = inference_file.stem # filename without .sparql extension
704
+ inference_graph = URIRef(f'inference:{filename}')
705
+
706
+ # Truncate the inference graph
707
+ context = self.graph.get_context(inference_graph)
708
+ context.remove((None, None, None))
709
+
710
+ # Read and execute the CONSTRUCT query
711
+ query_text = inference_file.read_text()
712
+ result = self.graph.query(query_text)
713
+
714
+ # CONSTRUCT queries return a SPARQLResult with a graph attribute
715
+ result_graph = result.get('graph') if isinstance(result, dict) else result.graph
716
+ self.logger.debug(f'Inference {filename}: result_graph is {result_graph}, type: {type(result_graph)}')
717
+ if result_graph is not None:
718
+ inferred_quads = [
719
+ (s, p, o, inference_graph)
720
+ for s, p, o in result_graph
721
+ ]
722
+ self.logger.debug(f'Inference {filename}: generated {len(inferred_quads)} quads')
723
+
724
+ if inferred_quads:
725
+ self.graph.addN(inferred_quads)
726
+ self.logger.info(
727
+ 'Inference {filename}: added {count} triples',
728
+ filename=filename,
729
+ count=len(inferred_quads),
730
+ )
731
+ else:
732
+ self.logger.debug(f'Inference {filename}: result_graph is None')
733
+
734
+ # Clear the flag after running inference
735
+ self.graph.last_not_inferred_source = None
736
+
735
737
  def load_retracting_nanopublications_by_query( # noqa: WPS231
736
738
  self,
737
739
  query: Query,
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "iolanta"
3
- version = "2.1.6"
3
+ version = "2.1.7"
4
4
  description = "Semantic Web browser"
5
5
  authors = ["Anatoly Scherbakov <altaisoft@gmail.com>"]
6
6
  license = "MIT"
@@ -23,7 +23,7 @@ rich = ">=13.3.1"
23
23
  textual = ">=0.83.0"
24
24
  yarl = ">=1.9.4"
25
25
  boltons = ">=24.0.0"
26
- yaml-ld = "^1.1.14"
26
+ yaml-ld = ">=1.1.15"
27
27
  reasonable = ">=0.2.6"
28
28
  oxrdflib = ">=0.4.0"
29
29
  loguru = ">=0.7.3"
@@ -57,7 +57,7 @@ textual-no-facet-found = "iolanta.facets.textual_no_facet_found:TextualNoFacetFo
57
57
  textual-nanopublication = "iolanta.facets.textual_nanopublication:NanopublicationFacet"
58
58
  textual-provenance = "iolanta.facets.textual_provenance:TextualProvenanceFacet"
59
59
  textual-link = "iolanta.facets.textual_link:TextualLinkFacet"
60
- wikibase-statement-title = "iolanta.facets.wikibase_statement_title:WikibaseStatementTitle"
60
+ mkdocs-material-insiders-markdown-datatype = "iolanta.facets.mkdocs_material_insiders_markdown:MkDocsMaterialInsidersMarkdownFacet"
61
61
  textual-ontology = "iolanta.facets.textual_ontology:OntologyFacet"
62
62
  title = "iolanta.facets.title:TitleFacet"
63
63
  boolean = "iolanta.facets.generic:BoolLiteral"
@@ -66,7 +66,6 @@ mermaid-graph = "iolanta.mermaid.facet:Mermaid"
66
66
  rich-declension-table = "iolanta.declension.facet:RichDeclensionTable"
67
67
  labeled-triple-set = "iolanta.labeled_triple_set.labeled_triple_set:LabeledTripleSet"
68
68
 
69
-
70
69
  [tool.poetry.plugins."rdf.plugins.queryprocessor"]
71
70
  sparqlspace = "iolanta.sparqlspace.processor:GlobalSPARQLProcessor"
72
71
 
@@ -1,9 +0,0 @@
1
- INSERT {
2
- GRAPH <local:inference-wikibase-claim> {
3
- ?prop <https://schema.org/name> ?name .
4
- }
5
- }
6
- WHERE {
7
- ?entity <https://wikiba.se/ontology#claim> ?prop .
8
- ?entity <https://schema.org/name> ?name .
9
- }
@@ -1,9 +0,0 @@
1
- INSERT {
2
- GRAPH <local:inference-wikibase-statement-property> {
3
- ?statement <https://schema.org/name> ?name .
4
- }
5
- }
6
- WHERE {
7
- ?prop <https://wikiba.se/ontology#statementProperty> ?statement .
8
- ?prop <https://schema.org/name> ?name .
9
- }
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes