iolanta 2.1.17__py3-none-any.whl → 2.1.19__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.
iolanta/cli/main.py CHANGED
@@ -183,10 +183,12 @@ def render_and_return(
183
183
  # URIRef - determine project_root if it's a file:// URI
184
184
  if str(node).startswith("file://"):
185
185
  path = Path(str(node).replace("file://", ""))
186
+ # Load current directory (like CLI AI agents): use parent if path is a file
187
+ project_root = path.parent if path.is_file() else path
186
188
  iolanta: Iolanta = Iolanta(
187
189
  language=Literal(language),
188
190
  logger=logger,
189
- project_root=path,
191
+ project_root=project_root,
190
192
  )
191
193
  else:
192
194
  iolanta: Iolanta = Iolanta(
iolanta/iolanta.py CHANGED
@@ -62,6 +62,21 @@ def _create_default_graph():
62
62
  return ConjunctiveGraph(identifier=namespaces.LOCAL.term("_inference"))
63
63
 
64
64
 
65
+ def _loadable_files(path: Path) -> Iterable[Path]:
66
+ """Paths of loadable files under path, skipping hidden files and dirs."""
67
+ if path.is_file():
68
+ if not path.name.startswith("."):
69
+ yield path
70
+ return
71
+ for entry in path.iterdir():
72
+ if entry.name.startswith("."):
73
+ continue
74
+ if entry.is_file():
75
+ yield entry
76
+ else:
77
+ yield from _loadable_files(entry)
78
+
79
+
65
80
  @dataclass
66
81
  class Iolanta: # noqa: WPS214, WPS338
67
82
  """Iolanta is a Semantic web browser."""
@@ -241,10 +256,7 @@ class Iolanta: # noqa: WPS214, WPS338
241
256
  if not isinstance(source, Path):
242
257
  source = Path(source)
243
258
 
244
- for source_file in list(source.rglob("*")) or [source]:
245
- if source_file.is_dir():
246
- continue
247
-
259
+ for source_file in _loadable_files(source):
248
260
  try: # noqa: WPS225
249
261
  ld_rdf = yaml_ld.to_rdf(source_file)
250
262
  except ConnectionError as name_resolution_error:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iolanta
3
- Version: 2.1.17
3
+ Version: 2.1.19
4
4
  Summary: Semantic Web browser
5
5
  License: MIT
6
6
  Author: Anatoly Scherbakov
@@ -6,7 +6,7 @@ iolanta/cli/formatters/choose.py,sha256=LWzsO_9IBSSgYNIyLlItkp8TNvpW3v6YCQ8-6kbI
6
6
  iolanta/cli/formatters/csv.py,sha256=ceJ_DTz0beqeK-d6FPBQqqjXrziEfF0FRSLoGZCt_fs,760
7
7
  iolanta/cli/formatters/json.py,sha256=Og5B9UrSM_0NWqW5Afpsy6WH8ZfYgPMVXYvT3i-43Jc,748
8
8
  iolanta/cli/formatters/pretty.py,sha256=IypZRAr2vNqcXFY6NOIc75mpyfpFWh56aCBlOPDDieQ,2901
9
- iolanta/cli/main.py,sha256=T1l1ilWp818pF3oR6VJIlPQ_ElicN7ECGlcJm5XiUqo,8170
9
+ iolanta/cli/main.py,sha256=RNNrj8Rnh6F9ISbxCPc_LHQrgwPcwvQ2vL6NU2rxNus,8333
10
10
  iolanta/cli/models.py,sha256=cjbpowdzI4wAP0DUk3qoVHyimk6AZwlXi9CGmusZTuM,159
11
11
  iolanta/cli/pretty_print.py,sha256=M6E3TmhzA6JY5GeUVmDZLmOh5u70-393PVit4voFKDI,977
12
12
  iolanta/context.py,sha256=bZR-tbZIrDQ-Vby01PMDZ6ifxM-0YMK68RJvAsyqCTs,507
@@ -129,7 +129,7 @@ iolanta/facets/title/title.yamlld,sha256=FjfqNPl3EAzZNLYAZNQ6mHfNmFkfxMm1A43gygf
129
129
  iolanta/facets/wikibase_statement_title/__init__.py,sha256=_yk1akxgSJOiUBJIc8QGrD2vovvmx_iw_vJDuv1rD7M,91
130
130
  iolanta/facets/wikibase_statement_title/facets.py,sha256=gNRqiwOTMxyyHYvb_vIrfd-4ipb8wfyJ4GgPcQdyy9E,726
131
131
  iolanta/facets/wikibase_statement_title/sparql/statement-title.sparql,sha256=n07DQWxKqB5c3CA4kacq2HSN0R0dLgnMnLP1AxMo5YA,320
132
- iolanta/iolanta.py,sha256=qHc4S1u86m8GLM4omdgzGMoB9QXNnsFH8K5U2rq0r7Y,14086
132
+ iolanta/iolanta.py,sha256=f_BlYPxXs8b2E3BYB_3wsxDcycIt8daqQ-WPecfTEbY,14450
133
133
  iolanta/labeled_triple_set/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
134
134
  iolanta/labeled_triple_set/data/labeled_triple_set.yamlld,sha256=P3oAPSPsirpbcRXej-VekuYFTpWqrkysYsxghZc3bTk,1008
135
135
  iolanta/labeled_triple_set/labeled_triple_set.py,sha256=o4IgvTvPd0mzBtpgHYd4n1xpujYdAvWBr6gIYwp5vnA,4061
@@ -165,7 +165,7 @@ iolanta/sparqlspace/sparqlspace.py,sha256=Y8_ZPXwuGEXbEes6XQjaQWA2Zv9y8SWxMPDFdq
165
165
  iolanta/widgets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
166
166
  iolanta/widgets/description.py,sha256=98Qd3FwT9r8sYqKjl9ZEptaVX9jJ2ULWf0uy3j52p5o,800
167
167
  iolanta/widgets/mixin.py,sha256=nDRCOc-gizCf1a5DAcYs4hW8eZEd6pHBPFsfm0ncv7E,251
168
- iolanta-2.1.17.dist-info/METADATA,sha256=eAAozTotEhoQYC4R05l1Oi1Y_GyfRQwdWc-Ue8HoE_c,2349
169
- iolanta-2.1.17.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
170
- iolanta-2.1.17.dist-info/entry_points.txt,sha256=Z1f3OaNruE2a6eprkiLgcPw-lZCah_cRT-PTlDD-Y1s,2569
171
- iolanta-2.1.17.dist-info/RECORD,,
168
+ iolanta-2.1.19.dist-info/METADATA,sha256=TQncwX9PC67AS7oD4fdRIfy3K7Ayw1FcBGHAPOf4q6k,2349
169
+ iolanta-2.1.19.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
170
+ iolanta-2.1.19.dist-info/entry_points.txt,sha256=Z1f3OaNruE2a6eprkiLgcPw-lZCah_cRT-PTlDD-Y1s,2569
171
+ iolanta-2.1.19.dist-info/RECORD,,