qlever 0.5.20__py3-none-any.whl → 0.5.21__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.

Potentially problematic release.


This version of qlever might be problematic. Click here for more details.

@@ -103,8 +103,8 @@ class ExampleQueriesCommand(QleverCommand):
103
103
  subparser.add_argument(
104
104
  "--clear-cache",
105
105
  choices=["yes", "no"],
106
- default="yes",
107
- help="Clear the cache before each query",
106
+ default="no",
107
+ help="Clear the cache before each query (only works for QLever)",
108
108
  )
109
109
  subparser.add_argument(
110
110
  "--width-query-description",
@@ -213,9 +213,18 @@ class ExampleQueriesCommand(QleverCommand):
213
213
  not args.sparql_endpoint
214
214
  or args.sparql_endpoint.startswith("https://qlever")
215
215
  )
216
- if args.clear_cache == "yes" and not is_qlever:
217
- log.warning("Clearing the cache only works for QLever")
218
- args.clear_cache = "no"
216
+ if args.clear_cache == "yes":
217
+ if is_qlever:
218
+ log.warning(
219
+ "Clearing the cache before each query"
220
+ " (only works for QLever)"
221
+ )
222
+ else:
223
+ log.warning(
224
+ "Clearing the cache only works for QLever"
225
+ ", option `--clear-cache` is ignored"
226
+ )
227
+ args.clear_cache = "no"
219
228
 
220
229
  # Show what the command will do.
221
230
  get_queries_cmd = (
@@ -237,8 +246,6 @@ class ExampleQueriesCommand(QleverCommand):
237
246
  f"Obtain queries via: {get_queries_cmd}\n"
238
247
  f"SPARQL endpoint: {sparql_endpoint}\n"
239
248
  f"Accept header: {args.accept}\n"
240
- f"Clear cache before each query:"
241
- f" {args.clear_cache.upper()}\n"
242
249
  f"Download result for each query or just count:"
243
250
  f" {args.download_or_count.upper()}"
244
251
  + (f" with LIMIT {args.limit}" if args.limit else ""),
@@ -404,6 +411,7 @@ class ExampleQueriesCommand(QleverCommand):
404
411
  # Get result size (via the command line, in order to avoid loading
405
412
  # a potentially large JSON file into Python, which is slow).
406
413
  if error_msg is None:
414
+ single_int_result = None
407
415
  # CASE 0: The result is empty despite a 200 HTTP code (not a
408
416
  # problem for CONSTRUCT and DESCRIBE queries).
409
417
  if Path(result_file).stat().st_size == 0 and (
@@ -461,16 +469,29 @@ class ExampleQueriesCommand(QleverCommand):
461
469
  )
462
470
  else:
463
471
  try:
464
- result_size = run_command(
465
- f'jq -r ".results.bindings | length"'
466
- f" {result_file}",
467
- return_output=True,
472
+ result_size = int(
473
+ run_command(
474
+ f'jq -r ".results.bindings | length"'
475
+ f" {result_file}",
476
+ return_output=True,
477
+ ).rstrip()
468
478
  )
469
479
  except Exception as e:
470
480
  error_msg = {
471
481
  "short": "Malformed JSON",
472
482
  "long": re.sub(r"\s+", " ", str(e)),
473
483
  }
484
+ if result_size == 1:
485
+ try:
486
+ single_int_result = int(
487
+ run_command(
488
+ f'jq -e -r ".results.bindings[0][] | .value"'
489
+ f" {result_file}",
490
+ return_output=True,
491
+ ).rstrip()
492
+ )
493
+ except Exception:
494
+ pass
474
495
 
475
496
  # Remove the result file (unless in debug mode).
476
497
  if args.log_level != "DEBUG":
@@ -485,10 +506,16 @@ class ExampleQueriesCommand(QleverCommand):
485
506
  )
486
507
  if error_msg is None:
487
508
  result_size = int(result_size)
509
+ single_int_result = (
510
+ f" [single int result: {single_int_result:,}]"
511
+ if single_int_result is not None
512
+ else ""
513
+ )
488
514
  log.info(
489
515
  f"{description:<{width_query_description}} "
490
516
  f"{time_seconds:6.2f} s "
491
517
  f"{result_size:>{args.width_result_size},}"
518
+ f"{single_int_result}"
492
519
  )
493
520
  query_times.append(time_seconds)
494
521
  result_sizes.append(result_size)
qlever/commands/start.py CHANGED
@@ -30,6 +30,8 @@ def construct_command(args) -> str:
30
30
  start_cmd += f" -s {args.timeout}"
31
31
  if args.access_token:
32
32
  start_cmd += f" -a {args.access_token}"
33
+ if args.persist_updates:
34
+ start_cmd += " --persist-updates"
33
35
  if args.only_pso_and_pos_permutations:
34
36
  start_cmd += " --only-pso-and-pos-permutations"
35
37
  if not args.use_patterns:
@@ -148,6 +150,7 @@ class StartCommand(QleverCommand):
148
150
  "cache_max_num_entries",
149
151
  "num_threads",
150
152
  "timeout",
153
+ "persist_updates",
151
154
  "only_pso_and_pos_permutations",
152
155
  "use_patterns",
153
156
  "use_text_index",
qlever/qleverfile.py CHANGED
@@ -242,6 +242,13 @@ class Qleverfile:
242
242
  default=8,
243
243
  help="The number of threads used for query processing",
244
244
  )
245
+ server_args["persist_updates"] = arg(
246
+ "--persist-updates",
247
+ action="store_true",
248
+ default=False,
249
+ help="Persist updates to the index (write updates to disk and "
250
+ "read them back in when restarting the server)",
251
+ )
245
252
  server_args["only_pso_and_pos_permutations"] = arg(
246
253
  "--only-pso-and-pos-permutations",
247
254
  action="store_true",
@@ -1,11 +1,11 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: qlever
3
- Version: 0.5.20
4
- Summary: Script for using the QLever SPARQL engine.
3
+ Version: 0.5.21
4
+ Summary: Command-line tool for using the QLever graph database
5
5
  Author-email: Hannah Bast <bast@cs.uni-freiburg.de>
6
6
  License: Apache-2.0
7
7
  Project-URL: Github, https://github.com/ad-freiburg/qlever
8
- Keywords: SPARQL,RDF,Knowledge Graphs,Triple Store
8
+ Keywords: Graph database,Triplestore,Knowledge graphs,SPARQL,RDF
9
9
  Classifier: Topic :: Database :: Database Engines/Servers
10
10
  Classifier: Topic :: Database :: Front-Ends
11
11
  Requires-Python: >=3.8
@@ -14,6 +14,7 @@ License-File: LICENSE
14
14
  Requires-Dist: psutil
15
15
  Requires-Dist: termcolor
16
16
  Requires-Dist: argcomplete
17
+ Dynamic: license-file
17
18
 
18
19
  # QLever
19
20
 
@@ -4,8 +4,7 @@ qlever/config.py,sha256=qYPy-MQ7BwGrvKSazQWhs0lnlOFqm-d47mpZhc3fptc,10254
4
4
  qlever/containerize.py,sha256=bnHmjKIFEe-NcuAMRNnXAFjRVLcLnk9f5JspCCyhgt8,5210
5
5
  qlever/log.py,sha256=WLscWV4fFF_w_uXSOfvWzhyzRM7t_61inE2ks3zf6Gw,1317
6
6
  qlever/qlever_main.py,sha256=-E4W8YdZ_teszGwXu6bQgBcH3y47TFJU8JLPIDwc_-g,2449
7
- qlever/qlever_old.py,sha256=cY55BD3tCsxBmxKobKkI-VtjQBj6-4b3TLGs_9gXwQc,63388
8
- qlever/qleverfile.py,sha256=8J5s0zhVH97QaQtedYkfyvyps5B28nhaoNwRF1fROwY,15287
7
+ qlever/qleverfile.py,sha256=DRS-SdbNoGZKAuxUQDDYmB6yKU-uNERrZRdgdRCejdw,15573
9
8
  qlever/util.py,sha256=xAK9GT8SgU3z65F1dFXazxsd60letqLQqQAZ81mdJSY,8374
10
9
  qlever/Qleverfiles/Qleverfile.dblp,sha256=oVVPFMpKX0Lfe0HDYPuL3qYhlC-3Lz18AT2tHmJ32WE,1282
11
10
  qlever/Qleverfiles/Qleverfile.dblp-plus,sha256=TJHxp8I1P6JKJjbuAllEpB32-huuY1gH0FlenqPVJ5g,1334
@@ -31,7 +30,7 @@ qlever/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
30
  qlever/commands/add_text_index.py,sha256=xJ49Iq1-CszXjHDvOpllqLw1J1kCxQl7H848XD1vEz0,3820
32
31
  qlever/commands/cache_stats.py,sha256=zGPLSWDNn7dwAAt2o-2ExqHmw1FeN8i6nEQbaaqF830,4156
33
32
  qlever/commands/clear_cache.py,sha256=n52ohE1EE4M_B4kId_v8tbAlW-BGwG1K-ZYQ9QgxIJU,2974
34
- qlever/commands/example_queries.py,sha256=l2brrZk1YWh1rkOSeCTgUueOZ7Jvu5Qncag-9B88jOI,22881
33
+ qlever/commands/example_queries.py,sha256=4zhvrbH8IJIKy5HB-guafY8SmLFb1OwnjELnaMD8ChI,24031
35
34
  qlever/commands/extract_queries.py,sha256=TZBmZLz_NknU1LKbl9nPmxdb82lsPeDhTWjIo81llvA,3942
36
35
  qlever/commands/get_data.py,sha256=nHOHMjv0tSLWJDOR0ba_LK-Bk-mcGnphb8hbqcVYFhE,1411
37
36
  qlever/commands/index.py,sha256=H0FtJ4HBVH8ESPxmYzb--k3qR5M7PfE4A-QlovVTP_o,13400
@@ -40,15 +39,15 @@ qlever/commands/log.py,sha256=vLqkgtx1udnQqoUBMWB5G9rwr-l7UKrDpyFYSMuoXWw,1987
40
39
  qlever/commands/query.py,sha256=lqQR3wiDLAzxg3Da5Xim6gxkAeEexPJxldoTfB9U4H0,4588
41
40
  qlever/commands/settings.py,sha256=cpRhD6CnQmDuzGg28zO7QTASDBGR7_PT0GRGtEVgY_g,3776
42
41
  qlever/commands/setup_config.py,sha256=wEy1LAunpOnqrUCbazMpt1u9HJCKgXJEMxF3zjh0jb0,3344
43
- qlever/commands/start.py,sha256=gtYKB1sgc5SwY0DA3IMnowXMqXccHA2cOYZ71dgey5k,11589
42
+ qlever/commands/start.py,sha256=9Rjn8KTkAPkOkBwlFP1vE4LrrtaJW24OuPqAdQFBYTk,11695
44
43
  qlever/commands/status.py,sha256=TtnBqcdkF3zTDKft07zpVcIX7kFu7d_nOy9b6Ohh9vQ,1650
45
44
  qlever/commands/stop.py,sha256=z25gWfLA9qIJ7F3zWZa0p0oVnt61kHcsB1evjgXhKX4,4557
46
45
  qlever/commands/system_info.py,sha256=I84EKgMO5J8pvsTDhkVKHzsRLtPajNg9KTQN5kWjqLU,4660
47
46
  qlever/commands/ui.py,sha256=T2Sl6w9tXNpZf-Zv3A9SLmarujszTIjGOYyPfyT4sX4,3821
48
47
  qlever/commands/warmup.py,sha256=kJHzS7HJo8pD2CphJuaXDj_CYP02YDo2DVM-pun3A80,1029
49
- qlever-0.5.20.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
50
- qlever-0.5.20.dist-info/METADATA,sha256=gQUezaZKAsOcgB5U8oj4LaMoMSLDchOsbc1C5YD7xSQ,4583
51
- qlever-0.5.20.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
52
- qlever-0.5.20.dist-info/entry_points.txt,sha256=U_gbYYi0wwdsn884eb0XoOXfvhACOsxhlO330dZ9bi0,87
53
- qlever-0.5.20.dist-info/top_level.txt,sha256=kd3zsYqiFd0--Czh5XTVkfEq6XR-XgRFW35X0v0GT-c,7
54
- qlever-0.5.20.dist-info/RECORD,,
48
+ qlever-0.5.21.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
49
+ qlever-0.5.21.dist-info/METADATA,sha256=uZV8sIEroOozEZgBowu22IKPLeOztE_wjCNV0S4fJSE,4630
50
+ qlever-0.5.21.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
51
+ qlever-0.5.21.dist-info/entry_points.txt,sha256=U_1U6SFIEZ-AnNlvk2nzcL0e4jnjEpuSbxYZ_E0XpEg,51
52
+ qlever-0.5.21.dist-info/top_level.txt,sha256=kd3zsYqiFd0--Czh5XTVkfEq6XR-XgRFW35X0v0GT-c,7
53
+ qlever-0.5.21.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.1.0)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,3 +1,2 @@
1
1
  [console_scripts]
2
2
  qlever = qlever.qlever_main:main
3
- qlever-old = qlever.qlever_old:main