qlever 0.5.25__tar.gz

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.

Files changed (59) hide show
  1. qlever-0.5.25/LICENSE +201 -0
  2. qlever-0.5.25/PKG-INFO +112 -0
  3. qlever-0.5.25/README.md +91 -0
  4. qlever-0.5.25/pyproject.toml +41 -0
  5. qlever-0.5.25/setup.cfg +4 -0
  6. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.dblp +35 -0
  7. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.dblp-plus +33 -0
  8. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.dbpedia +30 -0
  9. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.default +51 -0
  10. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.dnb +40 -0
  11. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.fbeasy +29 -0
  12. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.freebase +28 -0
  13. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.imdb +35 -0
  14. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.ohm-planet +41 -0
  15. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.olympics +31 -0
  16. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.orkg +30 -0
  17. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.osm-country +49 -0
  18. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.osm-planet +39 -0
  19. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.pubchem +131 -0
  20. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.scientists +29 -0
  21. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.uniprot +74 -0
  22. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.vvz +31 -0
  23. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.wikidata +42 -0
  24. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.wikipathways +40 -0
  25. qlever-0.5.25/src/qlever/Qleverfiles/Qleverfile.yago-4 +33 -0
  26. qlever-0.5.25/src/qlever/__init__.py +47 -0
  27. qlever-0.5.25/src/qlever/command.py +87 -0
  28. qlever-0.5.25/src/qlever/commands/__init__.py +0 -0
  29. qlever-0.5.25/src/qlever/commands/add_text_index.py +115 -0
  30. qlever-0.5.25/src/qlever/commands/benchmark_queries.py +1022 -0
  31. qlever-0.5.25/src/qlever/commands/cache_stats.py +125 -0
  32. qlever-0.5.25/src/qlever/commands/clear_cache.py +92 -0
  33. qlever-0.5.25/src/qlever/commands/extract_queries.py +113 -0
  34. qlever-0.5.25/src/qlever/commands/get_data.py +48 -0
  35. qlever-0.5.25/src/qlever/commands/index.py +333 -0
  36. qlever-0.5.25/src/qlever/commands/index_stats.py +306 -0
  37. qlever-0.5.25/src/qlever/commands/log.py +66 -0
  38. qlever-0.5.25/src/qlever/commands/query.py +142 -0
  39. qlever-0.5.25/src/qlever/commands/settings.py +119 -0
  40. qlever-0.5.25/src/qlever/commands/setup_config.py +97 -0
  41. qlever-0.5.25/src/qlever/commands/start.py +316 -0
  42. qlever-0.5.25/src/qlever/commands/status.py +50 -0
  43. qlever-0.5.25/src/qlever/commands/stop.py +90 -0
  44. qlever-0.5.25/src/qlever/commands/system_info.py +130 -0
  45. qlever-0.5.25/src/qlever/commands/ui.py +271 -0
  46. qlever-0.5.25/src/qlever/commands/update_wikidata.py +554 -0
  47. qlever-0.5.25/src/qlever/commands/warmup.py +41 -0
  48. qlever-0.5.25/src/qlever/config.py +223 -0
  49. qlever-0.5.25/src/qlever/containerize.py +159 -0
  50. qlever-0.5.25/src/qlever/log.py +55 -0
  51. qlever-0.5.25/src/qlever/qlever_main.py +79 -0
  52. qlever-0.5.25/src/qlever/qleverfile.py +487 -0
  53. qlever-0.5.25/src/qlever/util.py +329 -0
  54. qlever-0.5.25/src/qlever.egg-info/PKG-INFO +112 -0
  55. qlever-0.5.25/src/qlever.egg-info/SOURCES.txt +57 -0
  56. qlever-0.5.25/src/qlever.egg-info/dependency_links.txt +1 -0
  57. qlever-0.5.25/src/qlever.egg-info/entry_points.txt +2 -0
  58. qlever-0.5.25/src/qlever.egg-info/requires.txt +6 -0
  59. qlever-0.5.25/src/qlever.egg-info/top_level.txt +1 -0
qlever-0.5.25/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
qlever-0.5.25/PKG-INFO ADDED
@@ -0,0 +1,112 @@
1
+ Metadata-Version: 2.4
2
+ Name: qlever
3
+ Version: 0.5.25
4
+ Summary: Command-line tool for using the QLever graph database
5
+ Author-email: Hannah Bast <bast@cs.uni-freiburg.de>
6
+ License: Apache-2.0
7
+ Project-URL: Github, https://github.com/ad-freiburg/qlever
8
+ Keywords: Graph database,Triplestore,Knowledge graphs,SPARQL,RDF
9
+ Classifier: Topic :: Database :: Database Engines/Servers
10
+ Classifier: Topic :: Database :: Front-Ends
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: psutil
15
+ Requires-Dist: termcolor
16
+ Requires-Dist: argcomplete
17
+ Requires-Dist: pyyaml
18
+ Requires-Dist: rdflib
19
+ Requires-Dist: requests-sse
20
+ Dynamic: license-file
21
+
22
+ # QLever
23
+
24
+ QLever is a very fast SPARQL engine, much faster than most existing engines. It
25
+ can handle graphs with more than hundred billion triples on a single machine
26
+ with moderate resources. See https://qlever.cs.uni-freiburg.de for more
27
+ information and many public SPARQL endpoints that use QLever
28
+
29
+ This project provides a Python script that can control everything that QLever
30
+ does, in particular, creating SPARQL endpoints for arbitrary RDF datasets. It
31
+ is supposed to be very easy to use and self-explanatory as you use it. In
32
+ particular, the tool provides context-sensitive autocompletion of all its
33
+ commands and options. If you use a container system (like Docker or Podman),
34
+ you don't even have to download any QLever code, but the script will download
35
+ the required image for you.
36
+
37
+ NOTE: There has been a major update on 24.03.2024, which changed some of the
38
+ Qleverfile variables and command-line options (all for the better, of course).
39
+ If you encounter any problems, please contact us by opening an issue on
40
+ https://github.com/ad-freiburg/qlever-control/issues.
41
+
42
+ # Installation
43
+
44
+ Simply do `pip install qlever` and make sure that the directory where pip
45
+ installs the package is in your `PATH`. Typically, `pip` will warn you when
46
+ that is not the case and tell you what to do.
47
+
48
+ # Usage
49
+
50
+ Create an empty directory, with a name corresponding to the dataset you want to
51
+ work with. For the following example, take `olympics`. Go to that directory
52
+ and do the following. After the first call, `qlever` will tell you how to
53
+ activate autocompletion for all its commands and options (it's very easy, but
54
+ `pip` cannot do that automatically).
55
+
56
+ ```
57
+ qlever setup-config olympics # Get Qleverfile (config file) for this dataset
58
+ qlever get-data # Download the dataset
59
+ qlever index # Build index data structures for this dataset
60
+ qlever start # Start a QLever server using that index
61
+ qlever query # Launch an example query
62
+ qlever ui # Launch the QLever UI
63
+ ```
64
+
65
+ This will create a SPARQL endpoint for the [120 Years of
66
+ Olympics](https://github.com/wallscope/olympics-rdf) dataset. It is a great
67
+ dataset for getting started because it is small, but not trivial (around 2
68
+ million triples), and the downloading and indexing should only take a few
69
+ seconds.
70
+
71
+ Each command will also show you the command line it uses. That way you can
72
+ learn, on the side, how QLever works internally. If you just want to know the
73
+ command line for a particular command, without executing it, you can append
74
+ `--show` like this:
75
+
76
+ ```
77
+ qlever index --show
78
+ ```
79
+
80
+ There are many more commands and options, see `qlever --help` for general help,
81
+ `qlever <command> --help` for help on a specific command, or just the
82
+ autocompletion.
83
+
84
+ # Use with your own dataset
85
+
86
+ To use QLever with your own dataset, you should also write a `Qleverfile`, like
87
+ in the example above. The easiest way to write a `Qleverfile` is to get one of
88
+ the existing ones (using `qlever setup-config ...` as explained above) and then
89
+ change it according to your needs (the variable names should be self-explanatory).
90
+ Pick one for a dataset that is similar to yours and when in doubt, pick `olympics`.
91
+
92
+ # For developers
93
+
94
+ The (Python) code for the script is in the `*.py` files in `src/qlever`. The
95
+ preconfigured Qleverfiles are in `src/qlever/Qleverfiles`.
96
+
97
+ If you want to make changes to the script, or add new commands, do as follows:
98
+
99
+ ```
100
+ git clone https://github.com/ad-freiburg/qlever-control
101
+ cd qlever-control
102
+ pip install -e .
103
+ ```
104
+
105
+ Then you can use `qlever` just as if you had installed it via `pip install
106
+ qlever`. Note that you don't have to rerun `pip install -e .` when you modify
107
+ any of the `*.py` files and not even when you add new commands in
108
+ `src/qlever/commands`. The exceutable created by `pip` simply links and refers
109
+ to the files in your working copy.
110
+
111
+ If you have bug fixes or new useful features or commands, please open a pull
112
+ request. If you have questions or suggestions, please open an issue.
@@ -0,0 +1,91 @@
1
+ # QLever
2
+
3
+ QLever is a very fast SPARQL engine, much faster than most existing engines. It
4
+ can handle graphs with more than hundred billion triples on a single machine
5
+ with moderate resources. See https://qlever.cs.uni-freiburg.de for more
6
+ information and many public SPARQL endpoints that use QLever
7
+
8
+ This project provides a Python script that can control everything that QLever
9
+ does, in particular, creating SPARQL endpoints for arbitrary RDF datasets. It
10
+ is supposed to be very easy to use and self-explanatory as you use it. In
11
+ particular, the tool provides context-sensitive autocompletion of all its
12
+ commands and options. If you use a container system (like Docker or Podman),
13
+ you don't even have to download any QLever code, but the script will download
14
+ the required image for you.
15
+
16
+ NOTE: There has been a major update on 24.03.2024, which changed some of the
17
+ Qleverfile variables and command-line options (all for the better, of course).
18
+ If you encounter any problems, please contact us by opening an issue on
19
+ https://github.com/ad-freiburg/qlever-control/issues.
20
+
21
+ # Installation
22
+
23
+ Simply do `pip install qlever` and make sure that the directory where pip
24
+ installs the package is in your `PATH`. Typically, `pip` will warn you when
25
+ that is not the case and tell you what to do.
26
+
27
+ # Usage
28
+
29
+ Create an empty directory, with a name corresponding to the dataset you want to
30
+ work with. For the following example, take `olympics`. Go to that directory
31
+ and do the following. After the first call, `qlever` will tell you how to
32
+ activate autocompletion for all its commands and options (it's very easy, but
33
+ `pip` cannot do that automatically).
34
+
35
+ ```
36
+ qlever setup-config olympics # Get Qleverfile (config file) for this dataset
37
+ qlever get-data # Download the dataset
38
+ qlever index # Build index data structures for this dataset
39
+ qlever start # Start a QLever server using that index
40
+ qlever query # Launch an example query
41
+ qlever ui # Launch the QLever UI
42
+ ```
43
+
44
+ This will create a SPARQL endpoint for the [120 Years of
45
+ Olympics](https://github.com/wallscope/olympics-rdf) dataset. It is a great
46
+ dataset for getting started because it is small, but not trivial (around 2
47
+ million triples), and the downloading and indexing should only take a few
48
+ seconds.
49
+
50
+ Each command will also show you the command line it uses. That way you can
51
+ learn, on the side, how QLever works internally. If you just want to know the
52
+ command line for a particular command, without executing it, you can append
53
+ `--show` like this:
54
+
55
+ ```
56
+ qlever index --show
57
+ ```
58
+
59
+ There are many more commands and options, see `qlever --help` for general help,
60
+ `qlever <command> --help` for help on a specific command, or just the
61
+ autocompletion.
62
+
63
+ # Use with your own dataset
64
+
65
+ To use QLever with your own dataset, you should also write a `Qleverfile`, like
66
+ in the example above. The easiest way to write a `Qleverfile` is to get one of
67
+ the existing ones (using `qlever setup-config ...` as explained above) and then
68
+ change it according to your needs (the variable names should be self-explanatory).
69
+ Pick one for a dataset that is similar to yours and when in doubt, pick `olympics`.
70
+
71
+ # For developers
72
+
73
+ The (Python) code for the script is in the `*.py` files in `src/qlever`. The
74
+ preconfigured Qleverfiles are in `src/qlever/Qleverfiles`.
75
+
76
+ If you want to make changes to the script, or add new commands, do as follows:
77
+
78
+ ```
79
+ git clone https://github.com/ad-freiburg/qlever-control
80
+ cd qlever-control
81
+ pip install -e .
82
+ ```
83
+
84
+ Then you can use `qlever` just as if you had installed it via `pip install
85
+ qlever`. Note that you don't have to rerun `pip install -e .` when you modify
86
+ any of the `*.py` files and not even when you add new commands in
87
+ `src/qlever/commands`. The exceutable created by `pip` simply links and refers
88
+ to the files in your working copy.
89
+
90
+ If you have bug fixes or new useful features or commands, please open a pull
91
+ request. If you have questions or suggestions, please open an issue.
@@ -0,0 +1,41 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "qlever"
7
+ description = "Command-line tool for using the QLever graph database"
8
+ version = "0.5.25"
9
+ authors = [
10
+ { name = "Hannah Bast", email = "bast@cs.uni-freiburg.de" }
11
+ ]
12
+ readme = "README.md"
13
+ license = { text = "Apache-2.0" }
14
+ requires-python = ">=3.8"
15
+
16
+ keywords = ["Graph database", "Triplestore", "Knowledge graphs", "SPARQL", "RDF"]
17
+
18
+ classifiers = [
19
+ "Topic :: Database :: Database Engines/Servers",
20
+ "Topic :: Database :: Front-Ends"
21
+ ]
22
+
23
+ dependencies = [ "psutil", "termcolor", "argcomplete", "pyyaml", "rdflib", "requests-sse"]
24
+
25
+ [project.urls]
26
+ Github = "https://github.com/ad-freiburg/qlever"
27
+
28
+ [project.scripts]
29
+ "qlever" = "qlever.qlever_main:main"
30
+
31
+ [tool.setuptools]
32
+ license-files = ["LICENSE"]
33
+ package-data = { "qlever" = ["Qleverfiles/*"] }
34
+
35
+ [tool.pytest.ini_options]
36
+ pythonpath = ["src"]
37
+
38
+ [tool.ruff]
39
+ line-length = 79
40
+ [tool.ruff.lint]
41
+ extend-select = ["I"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,35 @@
1
+ # Qleverfile for DBLP, use with QLever CLI (`pip install qlever`)
2
+ #
3
+ # qlever get-data # ~1 min, ~5 GB compressed, 1.3 B triples
4
+ # qlever index # ~30 min, ~20 GB RAM, ~25 GB index size on disk
5
+ # qlever start # ~3 s, adjust MEMORY_FOR_QUERIES as needed
6
+ #
7
+ # Measured on an AMD Ryzen 9 5950X with 128 GB RAM, and NVMe SSD (25.10.2024)
8
+
9
+ [data]
10
+ NAME = dblp
11
+ DATA_TARFILE = dblp_KG_with_associated_data.tar
12
+ GET_DATA_URL = https://sparql.dblp.org/download/${DATA_TARFILE}
13
+ GET_DATA_CMD = (curl -LROC - ${GET_DATA_URL} && tar -xf ${DATA_TARFILE}) 2>&1 | tee ${NAME}.download-log.txt && rm -f ${DATA_TARFILE}
14
+ VERSION = $$(date -r dblp.ttl.gz +"%d.%m.%Y %H:%M" || echo "NO_DATE")
15
+ DESCRIPTION = DBLP computer science bibliography + citations from OpenCitations, data from ${GET_DATA_URL} (version ${VERSION})
16
+ FORMAT = ttl
17
+
18
+ [index]
19
+ INPUT_FILES = *.gz
20
+ MULTI_INPUT_JSON = { "cmd": "zcat {}", "for-each": "*.gz" }
21
+ SETTINGS_JSON = { "ascii-prefixes-only": false, "num-triples-per-batch": 5000000, "prefixes-external": [""] }
22
+
23
+ [server]
24
+ PORT = 7015
25
+ ACCESS_TOKEN = ${data:NAME}
26
+ MEMORY_FOR_QUERIES = 10G
27
+ CACHE_MAX_SIZE = 5G
28
+ TIMEOUT = 300s
29
+
30
+ [runtime]
31
+ SYSTEM = docker
32
+ IMAGE = docker.io/adfreiburg/qlever:latest
33
+
34
+ [ui]
35
+ UI_CONFIG = dblp
@@ -0,0 +1,33 @@
1
+ # Qleverfile for DBLP Plus, use with https://github.com/ad-freiburg/qlever-control
2
+ #
3
+ # qlever get-data downloads .gz file of size ~3 GB (as of 31.07.2022)
4
+ # qlever index takes ~30 minutes and ~20 GB RAM (on an AMD Ryzen 9 5900X)
5
+ # qlever start starts the server
6
+ #
7
+ # Also builds a text index for fast kewyword search in literals.
8
+
9
+ [data]
10
+ NAME = dblp-plus
11
+ GET_DATA_CMD = wget -nc -O dblp.ttl.gz https://dblp.org/rdf/dblp.ttl.gz
12
+ DESCRIPTION = Publication data from https://dblp.org, with affiliations from https://www.wikidata.org and citations from https://opencitations.net
13
+ TEXT_DESCRIPTION = All literals, search with FILTER KEYWORDS(?text, "...")
14
+
15
+ [index]
16
+ INPUT_FILES = dblp.ttl.gz affiliations.nt affiliations.additions.nt citations.nt
17
+ CAT_INPUT_FILES = zcat -f ${INPUT_FILES}
18
+ SETTINGS_JSON = { "ascii-prefixes-only": false, "num-triples-per-batch": 1000000, "prefixes-external": [ "<https://w3id.org", "<https://doi.org", "<http://dx.doi.org" ] }
19
+ TEXT_INDEX = from_literals
20
+
21
+ [server]
22
+ PORT = 7027
23
+ ACCESS_TOKEN = ${data:NAME}_169238202
24
+ MEMORY_FOR_QUERIES = 20G
25
+ CACHE_MAX_SIZE = 10G
26
+ CACHE_MAX_SIZE_SINGLE_ENTRY = 2G
27
+
28
+ [runtime]
29
+ SYSTEM = docker
30
+ IMAGE = docker.io/adfreiburg/qlever:latest
31
+
32
+ [ui]
33
+ UI_CONFIG = dblp-plus
@@ -0,0 +1,30 @@
1
+ # Qleverfile for DBpedia, use with https://github.com/ad-freiburg/qlever-control
2
+ #
3
+ # qlever get-data # ~14 GB, ~850 M triples (as of 30.07.2024)
4
+ # qlever index # ~20 min (on an AMD Ryzen 9 5900X)
5
+ # qlever start # ~3 sec
6
+
7
+ [data]
8
+ NAME = dbpedia
9
+ DATABUS_URL = https://databus.dbpedia.org/dbpedia/collections/latest-core
10
+ GET_DATA_CMD = curl -X POST -H "Accept: text/csv" --data-urlencode "query=$$(curl -s -H "Accept:text/sparql" https://databus.dbpedia.org/dbpedia/collections/latest-core)" https://databus.dbpedia.org/sparql | tail -n+2 | sed 's/\r$$//' | sed 's/"//g' | while read -r file; do wget -P rdf-input $$file; done
11
+ DESCRIPTION = RDF data from ${DATABUS_URL}
12
+
13
+ [index]
14
+ INPUT_FILES = rdf-input/*
15
+ CAT_INPUT_FILES = (cat rdf-input/*.nt; lbzcat -n2 rdf-input/*.bzip2 rdf-input/*.bz2)
16
+ SETTINGS_JSON = { "ascii-prefixes-only": true, "num-triples-per-batch": 1000000, "prefixes-external": [""] }
17
+ WITH_TEXT_INDEX = false
18
+
19
+ [server]
20
+ PORT = 7012
21
+ ACCESS_TOKEN = ${data:NAME}
22
+ MEMORY_FOR_QUERIES = 10G
23
+ CACHE_MAX_SIZE = 5G
24
+
25
+ [runtime]
26
+ SYSTEM = docker
27
+ IMAGE = docker.io/adfreiburg/qlever:latest
28
+
29
+ [ui]
30
+ UI_CONFIG = dbpedia
@@ -0,0 +1,51 @@
1
+ # Default Qleverfile, use with https://github.com/ad-freiburg/qlever-control
2
+ #
3
+ # If you have never seen a Qleverfile before, we recommend that you first look
4
+ # at the example Qleverfiles on http://qlever.cs.uni-freiburg.de/qlever-control/
5
+ # src/qlever/Qleverfiles . Or execute `qlever setup-config <dataset>` on the
6
+ # command line to obtain the example Qleverfiles for <dataset>.
7
+
8
+ # As a minimum, each dataset needs a name. If you want `qlever get-data` to do
9
+ # something meaningful, you need to define GET_DATA_CMD. Otherwise, you need to
10
+ # generate (or download or copy from somewhere) the input files yourself. Each
11
+ # dataset should have a short DESCRIPTION, ideally with a date.
12
+ [data]
13
+ NAME =
14
+ GET_DATA_CMD =
15
+ DESCRIPTION =
16
+
17
+ # The format for INPUT_FILES should be such that `ls ${INPUT_FILES}` lists all
18
+ # input files. CAT_INPUT_FILES should write a concatenation of all input files
19
+ # to stdout. For example, if your input files are gzipped, you can write `zcat
20
+ # ${INPUT_FILES}`. Regarding SETTINGS_JSON, look at the other Qleverfiles for
21
+ # examples. Several batches of size `num-triples-per-batch` are kept in RAM at
22
+ # the same time; increasing this, increases the memory usage but speeds up the
23
+ # loading process.
24
+ [index]
25
+ INPUT_FILES = *.ttl
26
+ CAT_INPUT_FILES = cat ${INPUT_FILES}
27
+ SETTINGS_JSON = { "num-triples-per-batch": 1000000 }
28
+
29
+ # The server listens on PORT. If you want to send privileged commands to the
30
+ # server, you need to specify an ACCESS_TOKEN, which you then have to set via a
31
+ # URL parameter `access_token`. It should not be easily guessable, unless you
32
+ # don't mind others to get privileged access to your server.
33
+ [server]
34
+ PORT = 8888
35
+ ACCESS_TOKEN =
36
+
37
+ # Use SYSTEM = docker to run QLever inside a docker container; the Docker image
38
+ # will be downloaded automatically. Use SYSTEM = native to use self-compiled
39
+ # binaries `IndexBuilderMain` and `ServerMain` (which should be in you PATH).
40
+ [runtime]
41
+ SYSTEM = docker
42
+ IMAGE = docker.io/adfreiburg/qlever:latest
43
+
44
+ # UI_PORT specifies the port of the QLever UI web app, when you run `qlever ui`.
45
+ # The UI_CONFIG must be one of the slugs from http://qlever.cs.uni-freiburg.de
46
+ # (see the dropdown menu on the top right, the slug is the last part of the URL).
47
+ # It determines the example queries and which SPARQL queries are launched to
48
+ # obtain suggestions as you type a query.
49
+ [ui]
50
+ UI_PORT = 8176
51
+ UI_CONFIG = default
@@ -0,0 +1,40 @@
1
+ # Qleverfile for Olympics, use with https://github.com/ad-freiburg/qlever-control
2
+ #
3
+ # qlever get-data # takes ~ 10 mins to download .nt.gz file of size ~ 8 GB
4
+ # qlever index # takes ~ 5 min and ~ 5 GB RAM (on an AMD Ryzen 9 5900X)
5
+ # qlever start # starts the server (instantaneous)
6
+ #
7
+ # IMPORTANT: The current files contain invalid floating point literals. To make
8
+ # QLever ignore them, compile QLever with `invalidLiteralsAreSkipped_ = true`
9
+ # in `src/parser/TurtleParserBase.h:55`.
10
+ #
11
+ # NOTE: https://data.dnb.de/opendata/ is rather confusing becase of the many
12
+ # files. This Qleverfile downloads all the datasets named "Gesamtabzug", except
13
+ # bib_lds.nt.gz, which contains incorrectly formatted IRIs. The file
14
+ # dnb-all_ldsprov.nt.gz contains invalid floating point literals; to ignore
15
+ # them, compile QLever with TurtleParserBase::invalidLiteralsAreSkipped_ = true
16
+
17
+ [data]
18
+ NAME = dnb
19
+ BASE_URL = https://data.dnb.de/opendata
20
+ GET_DATA_CMD = curl -L -C - --remote-name-all --remote-time ${BASE_URL}/authorities-gnd_lds.nt.gz ${BASE_URL}/dnb-all_lds.nt.gz ${BASE_URL}/dnb-all_ldsprov.nt.gz ${BASE_URL}/zdb_lds.nt.gz 2>&1 | tee ${data:NAME}.getdata-log.txt
21
+ VERSION = $$(date -r dnb-all_lds.nt.gz +%d.%m.%Y || echo "NO_DATE")
22
+ DESCRIPTION = DNB data from ${BASE_URL} (authoritities-gnd_lds, dnb_all_lds, dnb-all_ldsprov, zdb_lds), version ${VERSION}
23
+
24
+ [index]
25
+ INPUT_FILES = *.nt.gz
26
+ CAT_INPUT_FILES = zcat ${INPUT_FILES} | sed '/"\$$R0"/d;/"0\.03013\$$D"/d'
27
+ SETTINGS_JSON = { "ascii-prefixes-only": false, "num-triples-per-batch": 1000000 }
28
+
29
+ [server]
30
+ PORT = 7035
31
+ ACCESS_TOKEN = ${data:NAME}
32
+ MEMORY_FOR_QUERIES = 5G
33
+ CACHE_MAX_SIZE = 2G
34
+
35
+ [runtime]
36
+ SYSTEM = docker
37
+ IMAGE = docker.io/adfreiburg/qlever:latest
38
+
39
+ [ui]
40
+ UI_CONFIG = dnb