qlever 0.4.4__py3-none-any.whl → 0.5.0__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.
- qlever/Qleverfiles/Qleverfile.ohm-planet +37 -0
- qlever/commands/get_data.py +2 -4
- qlever/config.py +2 -2
- qlever/qlever_old.py +10 -9
- {qlever-0.4.4.dist-info → qlever-0.5.0.dist-info}/METADATA +1 -1
- {qlever-0.4.4.dist-info → qlever-0.5.0.dist-info}/RECORD +10 -9
- {qlever-0.4.4.dist-info → qlever-0.5.0.dist-info}/LICENSE +0 -0
- {qlever-0.4.4.dist-info → qlever-0.5.0.dist-info}/WHEEL +0 -0
- {qlever-0.4.4.dist-info → qlever-0.5.0.dist-info}/entry_points.txt +0 -0
- {qlever-0.4.4.dist-info → qlever-0.5.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Qleverfile for OHM Planet, use with https://github.com/ad-freiburg/qlever-control
|
|
2
|
+
#
|
|
3
|
+
# qlever get-data # ~20 mins (download PBF, convert to TTL, add GeoSPARQL triples)
|
|
4
|
+
# qlever index # ~10 mins and ~5 GB RAM (on an AMD Ryzen 9 5900X)
|
|
5
|
+
# qlever start # start the server (instantaneous)
|
|
6
|
+
#
|
|
7
|
+
# For `qlever get-data` to work, `osm2rdf` and `spatialjoin` must be installed
|
|
8
|
+
# and included in the `PATH`.
|
|
9
|
+
|
|
10
|
+
[data]
|
|
11
|
+
NAME = ohm-planet
|
|
12
|
+
GET_DATA_URL = $$(curl -s https://planet.openhistoricalmap.org/planet/state.txt)
|
|
13
|
+
GET_DATA_CMD_1 = curl -LRfC - -o ${NAME}.pbf ${GET_DATA_URL}
|
|
14
|
+
GET_DATA_CMD_2 = osm2rdf ${NAME}.pbf -o ${NAME}.ttl --source-dataset OHM --simplify-wkt 0 --write-ogc-geo-triples none 2>&1 | tee ${NAME}.osm2rdf-log.txt
|
|
15
|
+
GET_DATA_CMD_3 = bzcat ${NAME}.ttl.bz2 | \grep "^osm2rdf" | sed -En 's/^osm2rdf(geom)?:(ohm_)?(node|rel|way)[a-z]*_([0-9]+) geo:asWKT "([^\"]+)".*/ohm\3:\4\t\5/p' | tee ${NAME}.spatialjoin-input.tsv | spatialjoin --contains ' ogc:sfContains ' --intersects ' ogc:sfIntersects ' --suffix $$' .\n' -o ${NAME}.spatialjoin-triples.ttl.bz2 2>&1 | tee ${NAME}.spatialjoin-log.txt && rm -f areas events lines points simplelines
|
|
16
|
+
GET_DATA_CMD = ${GET_DATA_CMD_1} && echo && ${GET_DATA_CMD_2} && echo && ${GET_DATA_CMD_3} && bzcat ${NAME}.ttl.bz2 | head -100 | \grep "^@prefix" > ${NAME}.prefix-definitions
|
|
17
|
+
VERSION = $$(date -r ${NAME}.pbf +%d.%m.%Y || echo "NO_DATE")
|
|
18
|
+
DESCRIPTION = OHM Planet, data from ${GET_DATA_URL} version ${VERSION} (with GeoSPARQL predicates ogc:sfContains and ogc:sfIntersects)
|
|
19
|
+
|
|
20
|
+
[index]
|
|
21
|
+
INPUT_FILES = ${data:NAME}.prefix-definitions ${data:NAME}.spatialjoin-triples.ttl.bz2 ${data:NAME}.ttl.bz2
|
|
22
|
+
CAT_INPUT_FILES = bzcat -f ${INPUT_FILES}
|
|
23
|
+
SETTINGS_JSON = { "prefixes-external": [""], "ascii-prefixes-only": false, "parallel-parsing": true, "num-triples-per-batch": 5000000 }
|
|
24
|
+
|
|
25
|
+
[server]
|
|
26
|
+
PORT = 7037
|
|
27
|
+
ACCESS_TOKEN = ${data:NAME}_32673264324
|
|
28
|
+
MEMORY_FOR_QUERIES = 10G
|
|
29
|
+
CACHE_MAX_SIZE = 5G
|
|
30
|
+
WARMUP_CMD = curl -s http://localhost:${PORT} -H "Accept: application/qlever-results+json" --data-urlencode "query=PREFIX geo: <http://www.opengis.net/ont/geosparql#> SELECT ?subject ?geometry WHERE { ?subject geo:hasGeometry ?m . ?m geo:asWKT ?geometry } INTERNAL SORT BY ?subject" --data-urlencode "access-token=${server:ACCESS_TOKEN}" --data-urlencode "pinresult=true" --data-urlencode "send=0" | jq .resultsize | xargs printf "Result size: %'d\n"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
[runtime]
|
|
34
|
+
SYSTEM = native
|
|
35
|
+
|
|
36
|
+
[ui]
|
|
37
|
+
CONFIG = ohm-planet
|
qlever/commands/get_data.py
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import shlex
|
|
4
|
-
import subprocess
|
|
5
4
|
|
|
6
5
|
from qlever.command import QleverCommand
|
|
7
6
|
from qlever.log import log
|
|
8
|
-
from qlever.util import get_total_file_size
|
|
7
|
+
from qlever.util import get_total_file_size, run_command
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
class GetDataCommand(QleverCommand):
|
|
@@ -36,8 +35,7 @@ class GetDataCommand(QleverCommand):
|
|
|
36
35
|
|
|
37
36
|
# Execute the command line.
|
|
38
37
|
try:
|
|
39
|
-
|
|
40
|
-
stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL)
|
|
38
|
+
run_command(args.get_data_cmd, show_output=True)
|
|
41
39
|
except Exception as e:
|
|
42
40
|
log.error(f"Problem executing \"{args.get_data_cmd}\": {e}")
|
|
43
41
|
return False
|
qlever/config.py
CHANGED
|
@@ -5,9 +5,9 @@ import os
|
|
|
5
5
|
import traceback
|
|
6
6
|
from importlib.metadata import version
|
|
7
7
|
from pathlib import Path
|
|
8
|
-
from termcolor import colored
|
|
9
8
|
|
|
10
9
|
import argcomplete
|
|
10
|
+
from termcolor import colored
|
|
11
11
|
|
|
12
12
|
from qlever import command_objects, script_name
|
|
13
13
|
from qlever.log import log, log_levels
|
|
@@ -199,7 +199,7 @@ class QleverConfig:
|
|
|
199
199
|
# If called without arguments, show the help message.
|
|
200
200
|
if len(os.sys.argv) == 1:
|
|
201
201
|
parser.print_help()
|
|
202
|
-
exit(
|
|
202
|
+
exit(0)
|
|
203
203
|
|
|
204
204
|
# Parse the command line arguments.
|
|
205
205
|
args = parser.parse_args()
|
qlever/qlever_old.py
CHANGED
|
@@ -5,14 +5,11 @@
|
|
|
5
5
|
# convenient command-line tool for all things QLever. See the `README.md` file
|
|
6
6
|
# for how to use it.
|
|
7
7
|
|
|
8
|
-
from configparser import ConfigParser, ExtendedInterpolation
|
|
9
|
-
from datetime import datetime, date
|
|
10
|
-
import os
|
|
11
8
|
import glob
|
|
12
9
|
import inspect
|
|
13
10
|
import json
|
|
14
11
|
import logging
|
|
15
|
-
import
|
|
12
|
+
import os
|
|
16
13
|
import re
|
|
17
14
|
import shlex
|
|
18
15
|
import shutil
|
|
@@ -20,16 +17,20 @@ import socket
|
|
|
20
17
|
import subprocess
|
|
21
18
|
import sys
|
|
22
19
|
import time
|
|
23
|
-
import pkg_resources
|
|
24
|
-
from termcolor import colored
|
|
25
20
|
import traceback
|
|
21
|
+
from configparser import ConfigParser, ExtendedInterpolation
|
|
22
|
+
from datetime import date, datetime
|
|
23
|
+
|
|
24
|
+
import pkg_resources
|
|
25
|
+
import psutil
|
|
26
|
+
|
|
27
|
+
from qlever.log import log
|
|
26
28
|
|
|
27
29
|
BLUE = "\033[34m"
|
|
28
30
|
RED = "\033[31m"
|
|
29
31
|
BOLD = "\033[1m"
|
|
30
32
|
NORMAL = "\033[0m"
|
|
31
33
|
|
|
32
|
-
from qlever.log import log
|
|
33
34
|
# # Custom formatter for log messages.
|
|
34
35
|
# class CustomFormatter(logging.Formatter):
|
|
35
36
|
# def format(self, record):
|
|
@@ -42,8 +43,8 @@ from qlever.log import log
|
|
|
42
43
|
# return colored(message, "red")
|
|
43
44
|
# else:
|
|
44
45
|
# return message
|
|
45
|
-
#
|
|
46
|
-
#
|
|
46
|
+
#
|
|
47
|
+
#
|
|
47
48
|
# # Custom logger.
|
|
48
49
|
# log = logging.getLogger("qlever")
|
|
49
50
|
# log.setLevel(logging.INFO)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
qlever/__init__.py,sha256=7VKA8tp5iHZQyTXhDOcxUbloZ7WyxDnkruq0iJOzQcE,1403
|
|
2
2
|
qlever/__main__.py,sha256=MqM37bEzQeJEGUXZvuLcilIvnObZiG2eTGIkfKGpdnw,62016
|
|
3
3
|
qlever/command.py,sha256=yOr0Uc8D8-AM7EjwDsVzbc3KNYjPH-FVOZhIHkqO588,2749
|
|
4
|
-
qlever/config.py,sha256=
|
|
4
|
+
qlever/config.py,sha256=qYPy-MQ7BwGrvKSazQWhs0lnlOFqm-d47mpZhc3fptc,10254
|
|
5
5
|
qlever/containerize.py,sha256=p8g3O3G8a_0XLzSTzl_e5t9dqjbCQ-ippoA8vI2Z9pI,4193
|
|
6
6
|
qlever/log.py,sha256=and5prQcLW_5nM8AAZNeNbVqJxLtJmX3EjHFhtHCR28,1279
|
|
7
7
|
qlever/qlever_main.py,sha256=tA_xqOs_FjvqlDIvKTprwuysfTwzsUjE7at26gRhCVA,2336
|
|
8
|
-
qlever/qlever_old.py,sha256=
|
|
8
|
+
qlever/qlever_old.py,sha256=6sHosOfJzkURpdK4wXLdGl4SUtPnlsNEUwAqUeJiRYA,62026
|
|
9
9
|
qlever/qleverfile.py,sha256=6Ll81xkzel_s2Ju9ZfBXUGlRfikaAzZM6Do-dTrdo3k,12934
|
|
10
10
|
qlever/util.py,sha256=eepj0SY9JJOUQq5kvtoPnWfoLLV9fbw_sTEWKHet66E,7147
|
|
11
11
|
qlever/Qleverfiles/Qleverfile.dblp,sha256=SFjBD20aOSWod4mEQnxHSDWdInoE_EFp2nyMw7ev7ZA,1167
|
|
@@ -15,6 +15,7 @@ qlever/Qleverfiles/Qleverfile.dnb,sha256=yw4MmLsDPP3P5JWPgJwgPJh66TqwkyUXbQR5lSf
|
|
|
15
15
|
qlever/Qleverfiles/Qleverfile.fbeasy,sha256=jeztW4gFpWL_w1nCH5qGHeZyZv2lz_kG6f1G3r3DkJ4,974
|
|
16
16
|
qlever/Qleverfiles/Qleverfile.freebase,sha256=k6PqYrtHTBr0EydObm1Hg9QWyAAM9fXkdcjhReDg0fM,1035
|
|
17
17
|
qlever/Qleverfiles/Qleverfile.imdb,sha256=uL5XlPwX01AmH-j6_Bc-PRm2fuPxGSIu8NaDflY525U,1623
|
|
18
|
+
qlever/Qleverfiles/Qleverfile.ohm-planet,sha256=PVf9xf11KoPfKBAwYVrOAjibUZ2EG5giCSmllFqcmmQ,2493
|
|
18
19
|
qlever/Qleverfiles/Qleverfile.olympics,sha256=5w9BOFwEBhdSzPz-0LRxwhv-7Gj6xbF539HOXr3cqD0,1088
|
|
19
20
|
qlever/Qleverfiles/Qleverfile.osm-country,sha256=UnlkckSXJDrknZORlU-Hdj_J82U4kStl1aRctCc5n6M,1953
|
|
20
21
|
qlever/Qleverfiles/Qleverfile.osm-planet,sha256=2RilNix0fplN3GsNNyOu3GzmUss1Pq7586WKOFAQnSs,1400
|
|
@@ -30,7 +31,7 @@ qlever/commands/add_text_index.py,sha256=dkqYtwgOhgnXiei_eyhBWYCtdAiQUEmjWoa3JMl
|
|
|
30
31
|
qlever/commands/cache_stats.py,sha256=6JjueQstAqc8dNfgY8TP2EitFMxdUvCwrcyd7KUEb2o,4157
|
|
31
32
|
qlever/commands/clear_cache.py,sha256=AnE1MOoj1ZexxrRT8FGeBLlv8rtQIVV4DP8VBn5-X-s,2843
|
|
32
33
|
qlever/commands/example_queries.py,sha256=2rYTd35t0r7et0i-IBBcCpmVlYZya9kvwSI-gdTpNdE,12326
|
|
33
|
-
qlever/commands/get_data.py,sha256=
|
|
34
|
+
qlever/commands/get_data.py,sha256=f9kjZI3TKad6JHSuXWNkeoajmW8h0Sx8ShvjauDCtNo,1412
|
|
34
35
|
qlever/commands/index.py,sha256=lJhDnweknFZQm1czqPzNyz33EvbjIvOrS4j0wDaJ98o,5663
|
|
35
36
|
qlever/commands/index_stats.py,sha256=_BiUNBhmbYd9RPxrlm4HF0oENO6JmqnRiAkwkyOdN4U,11722
|
|
36
37
|
qlever/commands/log.py,sha256=8Krt3MsTUDapYqVw1zUu5X15SF8mV97Uj0qKOWK8jXk,1861
|
|
@@ -40,9 +41,9 @@ qlever/commands/status.py,sha256=5S6EdapZEwFKV9cQZtNYcZhMbAXAY-FP6ggjIhfX8ek,163
|
|
|
40
41
|
qlever/commands/stop.py,sha256=TZs4bxKHvujlZAU8BZmFjA5eXSZNAa6EeNzvPpEZsuI,4139
|
|
41
42
|
qlever/commands/ui.py,sha256=rV8u017WLbfz0zVT_c9GC4d9v1WWwrTM3kfGONbeCvQ,2499
|
|
42
43
|
qlever/commands/warmup.py,sha256=WOZSxeV8U_F6pEEnAb6YybXLQMxZFTRJXs4BPHUhsmc,1030
|
|
43
|
-
qlever-0.
|
|
44
|
-
qlever-0.
|
|
45
|
-
qlever-0.
|
|
46
|
-
qlever-0.
|
|
47
|
-
qlever-0.
|
|
48
|
-
qlever-0.
|
|
44
|
+
qlever-0.5.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
45
|
+
qlever-0.5.0.dist-info/METADATA,sha256=GtQdaBBOd5WYb2_UrqpTawHjJsKkEbEI6qyyaVi4rwY,4146
|
|
46
|
+
qlever-0.5.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
47
|
+
qlever-0.5.0.dist-info/entry_points.txt,sha256=U_gbYYi0wwdsn884eb0XoOXfvhACOsxhlO330dZ9bi0,87
|
|
48
|
+
qlever-0.5.0.dist-info/top_level.txt,sha256=kd3zsYqiFd0--Czh5XTVkfEq6XR-XgRFW35X0v0GT-c,7
|
|
49
|
+
qlever-0.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|