iolanta 2.0.7__py3-none-any.whl → 2.0.8__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.
@@ -291,7 +291,7 @@ class LiteralPropertyValue(Widget, can_focus=True, inherit_bindings=False):
291
291
  self.property_iri = property_iri
292
292
  super().__init__()
293
293
  self.renderable = Text( # noqa: WPS601
294
- str(property_value.value),
294
+ str(property_value),
295
295
  style='#696969',
296
296
  )
297
297
 
@@ -9,6 +9,7 @@ PRIORITIES = [ # noqa: WPS407
9
9
  'schema_name',
10
10
  'rdfs_label',
11
11
  'foaf_name',
12
+ 'literal_form',
12
13
  ]
13
14
 
14
15
 
@@ -23,4 +23,9 @@ SELECT * WHERE {
23
23
  $iri <https://xmlns.com/foaf/0.1/name> ?foaf_name .
24
24
  FILTER (!lang(?foaf_name) || lang(?foaf_name) = $language)
25
25
  }
26
- }
26
+
27
+ OPTIONAL {
28
+ $iri <https://www.w3.org/2008/05/skos-xl#literalForm> ?literal_form .
29
+ FILTER (!lang(?literal_form) || lang(?literal_form) = $language)
30
+ }
31
+ }
iolanta/parse_quads.py CHANGED
@@ -2,6 +2,7 @@ import dataclasses
2
2
  import hashlib
3
3
  from types import MappingProxyType
4
4
  from typing import Iterable, Optional
5
+ from urllib.parse import unquote
5
6
 
6
7
  from documented import DocumentedError
7
8
  from rdflib import BNode, Literal, URIRef
@@ -29,7 +30,7 @@ def parse_term( # noqa: C901
29
30
  term_value = term['value']
30
31
 
31
32
  if term_type == 'IRI':
32
- return URIRef(term_value)
33
+ return URIRef(unquote(term_value))
33
34
 
34
35
  if term_type == 'literal':
35
36
  language = term.get('language')
@@ -72,6 +72,10 @@ REDIRECTS = MappingProxyType({
72
72
  'https://nanopub.net/nschema#',
73
73
  ),
74
74
  URIRef(PROV): URIRef('https://www.w3.org/ns/prov-o'),
75
+
76
+ # Convert lexvo.org/id URLs to lexvo.org/data URLs
77
+ r'https://lexvo\.org/id/(.+)': r'http://lexvo.org/data/\1',
78
+ r'https://www\.lexinfo\.net/(.+)': r'http://www.lexinfo.net/\1',
75
79
  })
76
80
 
77
81
 
@@ -281,11 +285,30 @@ def _extract_nanopublication_uris(
281
285
  )
282
286
 
283
287
 
284
- def apply_redirect(source: URIRef) -> URIRef:
285
- """Rewrite the URL."""
288
+ def apply_redirect(source: URIRef) -> URIRef: # noqa: WPS210
289
+ """
290
+ Rewrite the URL using regex patterns and group substitutions.
291
+
292
+ For each pattern in REDIRECTS:
293
+ - If the pattern matches the source URI
294
+ - Replace the source with the destination, substituting any regex groups
295
+ """
296
+ source_str = str(source)
297
+
286
298
  for pattern, destination in REDIRECTS.items():
287
- if source.startswith(pattern):
288
- return destination
299
+ pattern_str = str(pattern)
300
+ destination_str = str(destination)
301
+
302
+ match = re.match(pattern_str, source_str)
303
+ if match:
304
+ # Replace any group references in the destination
305
+ # (like \1, \2, etc.)
306
+ redirected_uri = re.sub(
307
+ pattern_str,
308
+ destination_str,
309
+ source_str,
310
+ )
311
+ return URIRef(redirected_uri)
289
312
 
290
313
  return source
291
314
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iolanta
3
- Version: 2.0.7
3
+ Version: 2.0.8
4
4
  Summary: Semantic Web browser
5
5
  License: MIT
6
6
  Author: Anatoly Scherbakov
@@ -32,7 +32,7 @@ Requires-Dist: rich (>=13.3.1)
32
32
  Requires-Dist: textual (>=0.83.0)
33
33
  Requires-Dist: typer (>=0.9.0)
34
34
  Requires-Dist: watchfiles (>=1.0.4,<2.0.0)
35
- Requires-Dist: yaml-ld (>=1.1.9)
35
+ Requires-Dist: yaml-ld (>=1.1.10)
36
36
  Requires-Dist: yarl (>=1.9.4)
37
37
  Description-Content-Type: text/markdown
38
38
 
@@ -66,7 +66,7 @@ iolanta/facets/textual_default/sparql/properties.sparql,sha256=stDbvFP4g6YKYphpN
66
66
  iolanta/facets/textual_default/tcss/default.tcss,sha256=v6k6LvZMndRW4t9Iq-7QF59U_LJTdohRsyavwTY5ruI,69
67
67
  iolanta/facets/textual_default/templates/default.md,sha256=CuD5lISsE2eAVnm2z6kfNff-vEgrNG95Wi5LTgkieWY,21
68
68
  iolanta/facets/textual_default/triple_uri_ref.py,sha256=XfuNPaAe-YxH8IyrdrHQ641aWh5zVMVs0L0WC3D6A4M,1279
69
- iolanta/facets/textual_default/widgets.py,sha256=0f8gJmo447O5e_KwVxyb3hdVNzDJQTUf9GmRnp6hfrA,9183
69
+ iolanta/facets/textual_default/widgets.py,sha256=9qZbJfLvf9yilyQjW6IlCk1AiD8gTmfvaFuLLGQMnGU,9177
70
70
  iolanta/facets/textual_graph/__init__.py,sha256=DWd2gljzL8SiyYKQdBH78HouF1EMqgCH-w0K5OEmL2I,59
71
71
  iolanta/facets/textual_graph/facets.py,sha256=NGg0i1XYmdR8gjMd-D4Ckvu_n7m7s1FA68VSUm7cpj0,873
72
72
  iolanta/facets/textual_graph/sparql/triples.sparql,sha256=5rFVGcvZzEHZj2opQQp0YlxJLpEdl-r1RjkPwo8j7t0,145
@@ -90,8 +90,8 @@ iolanta/facets/textual_provenance/facets.py,sha256=vv3UQsI2duB36DW5Zkw3sqgAXBPmK
90
90
  iolanta/facets/textual_provenance/sparql/graphs.sparql,sha256=B45uKFd-1vrBuMDSbTURjUUEjHt51vAbqdL4tUcgMvk,103
91
91
  iolanta/facets/textual_provenance/sparql/triples.sparql,sha256=V-EdVuWbGHY3MspbJIMpwxPQautLDqJJV-AmihDjSHc,53
92
92
  iolanta/facets/title/__init__.py,sha256=fxpkG-YvHDp6eiVL3o7BbwhPMZZe-1R2Qi6S36QCTf8,77
93
- iolanta/facets/title/facets.py,sha256=v7YifoXqrpTlJscgVM_USfherpoXB_QP_LO5u3AwIwg,792
94
- iolanta/facets/title/sparql/title.sparql,sha256=4rz47tjwX2OJavWMzftaYKil1-ZHB76ZwLGVCwMbn5s,746
93
+ iolanta/facets/title/facets.py,sha256=kxZv-lRpqVz1-tRoqU1iqvzVcOjM0ebEs-wpR3Lc2eQ,812
94
+ iolanta/facets/title/sparql/title.sparql,sha256=_bm6KQrUB97EOc0CtAD3456qUzpKrY9eqhzrV4iRUqk,920
95
95
  iolanta/facets/wikibase_statement_title/__init__.py,sha256=_yk1akxgSJOiUBJIc8QGrD2vovvmx_iw_vJDuv1rD7M,91
96
96
  iolanta/facets/wikibase_statement_title/facets.py,sha256=mUH7twlAgoeX7DgLQuRBQv4ORT6GWbN-0eJ1aliSfiQ,724
97
97
  iolanta/facets/wikibase_statement_title/sparql/statement-title.sparql,sha256=n07DQWxKqB5c3CA4kacq2HSN0R0dLgnMnLP1AxMo5YA,320
@@ -99,7 +99,7 @@ iolanta/iolanta.py,sha256=y95nu0BbllQqWIBv19FUAbS-l4-qNFA4LWcbZdseTyU,11330
99
99
  iolanta/models.py,sha256=M-1dTxPwjTyUgQ4VCOiH6Q7ltNJiDPG0l1XQH430Omo,3250
100
100
  iolanta/namespaces.py,sha256=VJ3BLTji3UmqD3N1Om2voAoyYPtF4o-8FXN2Uq_4sPc,1194
101
101
  iolanta/node_to_qname.py,sha256=a82_qpgT87cbekY_76tTkl4Z-6Rz6am4UGIQChUf9Y0,794
102
- iolanta/parse_quads.py,sha256=w1GlfABG6EYKQ9iFFQHKFp8juPGdsjYmadQE6hH0gC8,4499
102
+ iolanta/parse_quads.py,sha256=nKUGS_OVpCA6PFA5rOd6Qa5ik_eQhCL-Mlv1zDXk_Co,4541
103
103
  iolanta/plugin.py,sha256=MSxpuOIx93AgBahfS8bYh31MEgcwtUSQhj4Js7fgdSI,1096
104
104
  iolanta/query_result.py,sha256=VLLBkewUEymtzfB0jeIeRE3Np6pAgo959RPgNsEmiq8,1545
105
105
  iolanta/reformat_blank_nodes.py,sha256=MAVcXusUioKzAoTEHAMume5Gt9vBEpxJGrngqFzmkJI,712
@@ -110,12 +110,12 @@ iolanta/sparqlspace/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
110
110
  iolanta/sparqlspace/cli.py,sha256=pb6q03lzrU8OaZ4A3QAQEmaFYcQ_-sHUrPhRs6GE88w,1590
111
111
  iolanta/sparqlspace/inference/wikibase-claim.sparql,sha256=JSawj3VTc9ZPoU9mvh1w1AMYb3cWyZ3x1rEYWUsKZ6A,209
112
112
  iolanta/sparqlspace/inference/wikibase-statement-property.sparql,sha256=SkSHZZlxWVDwBM3aLo0Q7hLuOj9BsIQnXtcuAuwaxqU,240
113
- iolanta/sparqlspace/processor.py,sha256=tYIGIqh-1kbzIfYgirU77QoyFwsF8t6jv5BdHAEXjM0,23191
113
+ iolanta/sparqlspace/processor.py,sha256=0Rk7ZeLWifdnmnKL5EZc39JRuMfsxT2RBUv6vgg3di0,23995
114
114
  iolanta/sparqlspace/sparqlspace.py,sha256=Y8_ZPXwuGEXbEes6XQjaQWA2Zv9y8SWxMPDFdqVBGFo,796
115
115
  iolanta/widgets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
116
116
  iolanta/widgets/description.py,sha256=98Qd3FwT9r8sYqKjl9ZEptaVX9jJ2ULWf0uy3j52p5o,800
117
117
  iolanta/widgets/mixin.py,sha256=nDRCOc-gizCf1a5DAcYs4hW8eZEd6pHBPFsfm0ncv7E,251
118
- iolanta-2.0.7.dist-info/METADATA,sha256=CjOyQqdHPRnClEWEC0nllINZGGdUznLk_C04P0_B5aI,2230
119
- iolanta-2.0.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
120
- iolanta-2.0.7.dist-info/entry_points.txt,sha256=z9RPLmGuz3tYGPV7Qf4nNjuSJYdTUS9enC4595poe-M,221
121
- iolanta-2.0.7.dist-info/RECORD,,
118
+ iolanta-2.0.8.dist-info/METADATA,sha256=K8cM_R2W4mlmyhFEMVh1J1LYjQg09-uJcSdRJXqTQg4,2231
119
+ iolanta-2.0.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
120
+ iolanta-2.0.8.dist-info/entry_points.txt,sha256=z9RPLmGuz3tYGPV7Qf4nNjuSJYdTUS9enC4595poe-M,221
121
+ iolanta-2.0.8.dist-info/RECORD,,