iolanta 2.1.21__py3-none-any.whl → 2.1.23__py3-none-any.whl

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.
@@ -33,10 +33,10 @@ class Description(Static):
33
33
  """
34
34
 
35
35
 
36
- class TextualDefaultFacet(Facet[Widget]): # noqa: WPS214
36
+ class TextualDefaultFacet(Facet[Widget]): # noqa: WPS214
37
37
  """Default rendering engine."""
38
38
 
39
- query_file_name = 'properties.sparql'
39
+ query_file_name = "properties.sparql"
40
40
  properties_on_the_right = False
41
41
 
42
42
  @functools.cached_property
@@ -47,10 +47,7 @@ class TextualDefaultFacet(Facet[Widget]): # noqa: WPS214
47
47
  this=self.this,
48
48
  )
49
49
 
50
- property_pairs = [
51
- (row['property'], row['object'])
52
- for row in property_rows
53
- ]
50
+ property_pairs = [(row["property"], row["object"]) for row in property_rows]
54
51
 
55
52
  iolanta_lang = str(self.iolanta.language)
56
53
  property_pairs = [
@@ -79,7 +76,9 @@ class TextualDefaultFacet(Facet[Widget]): # noqa: WPS214
79
76
  property_value=property_value,
80
77
  subject=self.this,
81
78
  property_iri=property_iri,
82
- ) if isinstance(property_value, Literal) else PropertyValue(
79
+ )
80
+ if isinstance(property_value, Literal)
81
+ else PropertyValue(
83
82
  property_value=property_value,
84
83
  subject=self.this,
85
84
  property_iri=property_iri,
@@ -130,26 +129,28 @@ class TextualDefaultFacet(Facet[Widget]): # noqa: WPS214
130
129
 
131
130
  match literal_value:
132
131
  case str() as string:
133
- return string
132
+ # Escape ALL square brackets - Rich's escape_markup only escapes
133
+ # lowercase tags, but [[ItemList]] etc. still cause MarkupError
134
+ return string.replace("[", r"\[")
134
135
 
135
136
  case minidom.Document() as xml_document:
136
137
  return Syntax(
137
138
  xml_document.toxml(),
138
- 'xml',
139
+ "xml",
139
140
  )
140
141
 
141
142
  case something_else:
142
143
  type_of_something_else = type(something_else)
143
144
  raise ValueError(
144
- f'What is this? {something_else} ' # noqa: WPS326
145
- f'is a {type_of_something_else}!', # noqa: WPS326
145
+ f"What is this? {something_else} " # noqa: WPS326
146
+ f"is a {type_of_something_else}!", # noqa: WPS326
146
147
  )
147
148
 
148
149
  @functools.cached_property
149
150
  def properties(self) -> Widget | None:
150
151
  """Render properties table."""
151
152
  if not self.grouped_properties:
152
- return Static('No properties found ☹')
153
+ return Static("No properties found ☹")
153
154
 
154
155
  return PropertiesContainer(*self.rows)
155
156
 
@@ -160,7 +161,7 @@ class TextualDefaultFacet(Facet[Widget]): # noqa: WPS214
160
161
 
161
162
  if self.description:
162
163
  widgets.append(Description(self.description))
163
-
164
+
164
165
  widgets.append(self.properties)
165
166
 
166
167
  return VerticalScroll(*widgets)
@@ -176,11 +177,12 @@ class PageFooter(PageTitle):
176
177
  }
177
178
  """
178
179
 
180
+
179
181
  class InverseProperties(TextualDefaultFacet):
180
182
  """Inverse properties view."""
181
183
 
182
- META = Path(__file__).parent / 'textual-inverse-properties.yamlld'
183
- query_file_name = 'inverse-properties.sparql'
184
+ META = Path(__file__).parent / "textual-inverse-properties.yamlld"
185
+ query_file_name = "inverse-properties.sparql"
184
186
  properties_on_the_right = True
185
187
 
186
188
  def show(self) -> Widget:
@@ -189,5 +191,5 @@ class InverseProperties(TextualDefaultFacet):
189
191
  VerticalScroll(
190
192
  self.properties,
191
193
  ),
192
- PageFooter(self.this, extra='[i]& its inverse RDF properties[/i]'),
194
+ PageFooter(self.this, extra="[i]& its inverse RDF properties[/i]"),
193
195
  )
@@ -607,6 +607,9 @@ class GlobalSPARQLProcessor(Processor): # noqa: WPS338, WPS214
607
607
  except HTTPError as http_error:
608
608
  self.logger.warning(f"{source} | HTTP error: {http_error}")
609
609
  return Loaded()
610
+ except TypeError as type_error:
611
+ self.logger.error(f"{source} | JSON-LD type error: {type_error}")
612
+ return Loaded()
610
613
 
611
614
  try:
612
615
  quads = list(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iolanta
3
- Version: 2.1.21
3
+ Version: 2.1.23
4
4
  Summary: Semantic Web browser
5
5
  License: MIT
6
6
  Author: Anatoly Scherbakov
@@ -35,7 +35,7 @@ Requires-Dist: rich (>=13.3.1)
35
35
  Requires-Dist: textual (>=0.83.0)
36
36
  Requires-Dist: typer (>=0.9.0)
37
37
  Requires-Dist: watchfiles (>=1.0.4)
38
- Requires-Dist: yaml-ld (>=1.1.16)
38
+ Requires-Dist: yaml-ld (>=1.1.17)
39
39
  Requires-Dist: yarl (>=1.9.4)
40
40
  Description-Content-Type: text/markdown
41
41
 
@@ -86,7 +86,7 @@ iolanta/facets/textual_class/facets.py,sha256=MiGTapgt30ME2fapwdrD_yQj4mhkdmyMAj
86
86
  iolanta/facets/textual_class/sparql/instances.sparql,sha256=Wx3xThlEgwz8gqH5Fnv789p1CiBRJGLOhRpChtFq1Us,139
87
87
  iolanta/facets/textual_class/textual-class.yamlld,sha256=HBQCC3Kg41rFfPne9Gx1CXsQ3nQPXmwUXh9hr3AQU5A,586
88
88
  iolanta/facets/textual_default/__init__.py,sha256=snxA0FEY9qfAxNv3MlZLrJsXugD4dvs5hLStZWV7soM,158
89
- iolanta/facets/textual_default/facets.py,sha256=_9tjsEojtG6kSuIbz-2_qc-HUbufs5PheDOEj53_H1A,5745
89
+ iolanta/facets/textual_default/facets.py,sha256=V_2il3VUvcX3OhW_ex-Ndq8SH1bq9dg4vRXCeRVRkG8,5914
90
90
  iolanta/facets/textual_default/sparql/inverse-properties.sparql,sha256=2m2q3C6jMQ_8o-0cPgIYrT77l6UnY3oqI37-Ed7p4-c,65
91
91
  iolanta/facets/textual_default/sparql/label.sparql,sha256=IWAkkgMKtIZ7Zpg8LUJ5fDZ9tiI8fiRYZo-zT61Fong,121
92
92
  iolanta/facets/textual_default/sparql/nodes-for-property.sparql,sha256=J9vg0Pz2HXDlPCeZ6IS2C0wODrpYDuNeD6DYT6UdNsU,68
@@ -164,13 +164,13 @@ iolanta/sparqlspace/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
164
164
  iolanta/sparqlspace/cli.py,sha256=pb6q03lzrU8OaZ4A3QAQEmaFYcQ_-sHUrPhRs6GE88w,1590
165
165
  iolanta/sparqlspace/inference/wikidata-prop-label.sparql,sha256=JYLAs28Z3a77cMcv44aZplwwrdqB-yshZn1dDZmRFAU,250
166
166
  iolanta/sparqlspace/inference/wikidata-statement-label.sparql,sha256=_Dp9jKCpCp2pLk0uacNUhUvvQ2Hov-WiMFprtuYTRyY,759
167
- iolanta/sparqlspace/processor.py,sha256=FGFydsboratdAloMxSqUVxM3epySg3Zf1hnJOkvyb-I,25529
167
+ iolanta/sparqlspace/processor.py,sha256=oAVewN98B9GwgAzkrzYfStAR4nyU2esAWPA_F3jGlfk,25675
168
168
  iolanta/sparqlspace/redirects.py,sha256=8k_8ow0vhQKdYZq-iN0XGsYVGYvQWWov0BpQc0BXPQk,2772
169
169
  iolanta/sparqlspace/sparqlspace.py,sha256=Y8_ZPXwuGEXbEes6XQjaQWA2Zv9y8SWxMPDFdqVBGFo,796
170
170
  iolanta/widgets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
171
171
  iolanta/widgets/description.py,sha256=98Qd3FwT9r8sYqKjl9ZEptaVX9jJ2ULWf0uy3j52p5o,800
172
172
  iolanta/widgets/mixin.py,sha256=nDRCOc-gizCf1a5DAcYs4hW8eZEd6pHBPFsfm0ncv7E,251
173
- iolanta-2.1.21.dist-info/METADATA,sha256=mbHvn8r2Iol03WVyF1jClkt7DFaL5FGU04yP-K61pN4,2349
174
- iolanta-2.1.21.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
175
- iolanta-2.1.21.dist-info/entry_points.txt,sha256=ArQ-tRMRs-X_w78E1-4f4oaE7beHskz9knYOPgkE-ms,2604
176
- iolanta-2.1.21.dist-info/RECORD,,
173
+ iolanta-2.1.23.dist-info/METADATA,sha256=vcs5EdqU_SrLbvsEfknbm1cSpECTSia-0tMHBT_VuCQ,2349
174
+ iolanta-2.1.23.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
175
+ iolanta-2.1.23.dist-info/entry_points.txt,sha256=ArQ-tRMRs-X_w78E1-4f4oaE7beHskz9knYOPgkE-ms,2604
176
+ iolanta-2.1.23.dist-info/RECORD,,