pyomnigraph API Documentation
basecmd
Created on 31.05.2025
@author: wf
BaseCmd
Base class for Omnigraph-related command line interfaces.
Source code in omnigraph/basecmd.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
__init__(description=None)
Initialize CLI base.
Source code in omnigraph/basecmd.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
about()
show about info
Source code in omnigraph/basecmd.py
105 106 107 108 109 110 111 | |
getDatasets(yaml_path)
Resolve and select datasets to download.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
yaml_path
|
str
|
Path to datasets configuration YAML file |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, RdfDataset]
|
Dict[str, RdfDataset]: selected datasets by name |
Source code in omnigraph/basecmd.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
get_arg_parser(description, version_msg)
Setup argument parser.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
description
|
str
|
CLI description |
required |
version_msg
|
str
|
Version string |
required |
Returns:
| Type | Description |
|---|---|
ArgumentParser
|
Configured argument parser |
Source code in omnigraph/basecmd.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
handle_args(args)
should be extended by specialized subclass.
Source code in omnigraph/basecmd.py
113 114 115 116 117 118 119 120 121 122 | |
main()
classmethod
Entry point for CLI.
Source code in omnigraph/basecmd.py
160 161 162 163 164 165 166 167 | |
run()
Parse arguments and dispatch to handler.
Source code in omnigraph/basecmd.py
130 131 132 133 134 135 | |
ominigraph_paths
Created on 2025-05-27
@author: wf
OmnigraphPaths
Omnigraph Default Paths
Source code in omnigraph/ominigraph_paths.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
__init__(home_dir=None)
Initialize default Omnigraph paths
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
home_dir
|
Optional[Path]
|
Optional custom home directory path (default: Path.home()) |
None
|
Source code in omnigraph/ominigraph_paths.py
16 17 18 19 20 21 22 23 24 25 26 27 28 | |
omnigraph_cmd
Created on 2025-05-28
@author: wf
OmnigraphCmd
Bases: BaseCmd
Command line interface for omnigraph.
Source code in omnigraph/omnigraph_cmd.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | |
__init__()
Initialize command line interface.
Source code in omnigraph/omnigraph_cmd.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
configure_dumps_dir(server, dataset=None)
Configure dumps directory for a server based on dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server
|
SparqlServer
|
Server instance to configure |
required |
dataset
|
RdfDataset
|
RdfDataset instance |
None
|
Source code in omnigraph/omnigraph_cmd.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
getServers()
Get the active servers from configuration.
Source code in omnigraph/omnigraph_cmd.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
get_arg_parser(description, version_msg)
Extend base parser with Omnigraph-specific arguments.
Source code in omnigraph/omnigraph_cmd.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
handle_args(args)
Handle parsed CLI arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
Namespace
|
parsed argument namespace |
required |
Source code in omnigraph/omnigraph_cmd.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | |
load_iterator(server)
Iterator for load command that configures dumps_dir for each dataset.
Source code in omnigraph/omnigraph_cmd.py
153 154 155 156 157 158 159 160 161 162 163 164 165 | |
run_cmds(server, cmds)
Run commands on a specific server.
Source code in omnigraph/omnigraph_cmd.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
run_single_cmd(server, cmd)
Run a single command on a server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server
|
SparqlServer
|
Server instance |
required |
cmd
|
str
|
Command name to run |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if command was successfully run |
Source code in omnigraph/omnigraph_cmd.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
omniserver
Created on 2025-05-28
@author: wf
OmniServer
Factory class for creating and managing SPARQL server instances.
Source code in omnigraph/omniserver.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
__init__(env, patch_config=None)
constructor
Source code in omnigraph/omniserver.py
32 33 34 35 36 37 | |
generate_endpoints_yaml(servers, prefix_configs, output_path=None)
Generate endpoints.yaml from server configurations.
Source code in omnigraph/omniserver.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
get_server_commands()
Get available server commands as factory functions.
Returns:
| Type | Description |
|---|---|
Dict[str, Callable[[SparqlServer], ServerCmd]]
|
Dictionary mapping command names to ServerCmd factories |
Source code in omnigraph/omniserver.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
list_servers(servers, table_format, host='localhost')
Generate formatted table of servers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
servers
|
Dict[str, SparqlServer]
|
Dictionary of server instances |
required |
table_format
|
str
|
Table format for tabulate |
required |
host
|
str
|
Host for server links (default: localhost) |
'localhost'
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Formatted table markup |
Source code in omnigraph/omniserver.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
server4Config(config)
Create a SparqlServer instance based on server type in config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
ServerConfig
|
ServerConfig with server type and settings |
required |
Returns:
| Type | Description |
|---|---|
SparqlServer
|
SparqlServer instance of appropriate type |
Source code in omnigraph/omniserver.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
servers(yaml_path, filter_active=True)
Load active servers from YAML configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
yaml_path
|
Path
|
Path to YAML configuration file |
required |
filter_active
|
bool
|
if true filter active servers |
True
|
Returns:
| Type | Description |
|---|---|
Dict[str, SparqlServer]
|
Dictionary mapping server names to SparqlServer instances |
Source code in omnigraph/omniserver.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
rdf_dataset
Created on 2025-05-30
@author: wf
RdfDataset
dataclass
Configuration for an RDF dataset to be downloaded.
Source code in omnigraph/rdf_dataset.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
__post_init__()
Apply npq params and generate the queries from select_pattern.
Source code in omnigraph/rdf_dataset.py
91 92 93 94 95 96 | |
apply_params(params_dict=None)
Apply npq parameters to select_pattern and construct_template.
{{ name }} templates are replaced with the values of the merged params: the dataset's own params overridden by the given ones. Substitution always starts from the raw templates, so CLI overrides can be re-applied after YAML defaults. The blanket Params audit is off - it rejects quoted VALUES lists (see issue #36); values stem from local configuration and CLI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params_dict
|
Optional[Dict[str, str]]
|
additional parameter values overriding self.params |
None
|
Source code in omnigraph/rdf_dataset.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
build_queries()
(Re)build count_query and select_query from the current select_pattern. Only initializes SPARQL-related fields if endpoint_url is provided.
Source code in omnigraph/rdf_dataset.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
getTryItUrl(database='blazegraph')
return the "try it!" url for the given database
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
database(str)
|
the database to be used |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
the "try it!" url for the given query |
Source code in omnigraph/rdf_dataset.py
116 117 118 119 120 121 122 123 124 125 126 127 | |
get_construct_query(offset, limit)
Generate CONSTRUCT query with offset and limit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
offset
|
int
|
Query offset |
required |
limit
|
int
|
Query limit |
required |
Returns:
| Type | Description |
|---|---|
str
|
SPARQL CONSTRUCT query string |
Source code in omnigraph/rdf_dataset.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
get_solution_count()
Get the number of solutions/results from the SPARQL endpoint.
Returns:
| Type | Description |
|---|---|
int
|
Number of solutions available from the count query |
Source code in omnigraph/rdf_dataset.py
104 105 106 107 108 109 110 111 112 113 114 | |
RdfDatasets
Collection of server configurations loaded from YAML.
Source code in omnigraph/rdf_dataset.py
149 150 151 152 153 154 155 156 157 158 159 160 161 | |
ofYaml(yaml_path)
classmethod
Load server configurations from YAML file.
Source code in omnigraph/rdf_dataset.py
155 156 157 158 159 160 161 | |
rdfdump
Created on 2025-05-26
@author: wf
Download RDF dump via paginated CONSTRUCT queries.
RdfDumpDownloader
Downloads an RDF dump from a SPARQL endpoint via paginated CONSTRUCT queries.
Source code in omnigraph/rdfdump.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
__init__(dataset, output_path, args=None)
Initialize the RDF dump downloader.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
RdfDataset
|
RdfDataset configuration |
required |
output_path
|
str
|
the directory for the dump file |
required |
args
|
Optional[Namespace]
|
parsed CLI arguments (optional) |
None
|
Source code in omnigraph/rdfdump.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
download()
Download the RDF dump in chunks.
Returns:
| Type | Description |
|---|---|
int
|
Number of chunks downloaded |
Source code in omnigraph/rdfdump.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
fetch_chunk(offset, rdf_format='turtle')
Fetch a chunk of RDF data in the given format using direct HTTP POST.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
offset
|
int
|
Query offset |
required |
rdf_format
|
str
|
RDF format label |
'turtle'
|
Returns:
| Type | Description |
|---|---|
str
|
RDF content as string |
Source code in omnigraph/rdfdump.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
rdfdump_cmd
Created on 2025-05-30
@author: wf
Command line interface for RDF dump downloading.
RdfDumpCmd
Bases: BaseCmd
Command line interface for RDF dump downloading.
Source code in omnigraph/rdfdump_cmd.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
__init__()
Initialize command line interface.
Source code in omnigraph/rdfdump_cmd.py
25 26 27 28 29 | |
download_dataset(dataset_name, dataset, output_path)
Download the specified dataset to a subdirectory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_name
|
str
|
name of dataset |
required |
dataset
|
RdfDataset
|
RDF dataset definition |
required |
output_path
|
str
|
base output directory |
required |
Source code in omnigraph/rdfdump_cmd.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
get_arg_parser(description, version_msg)
Extend base parser with RDF-specific arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
description
|
str
|
CLI description string |
required |
version_msg
|
str
|
version display string |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ArgumentParser |
ArgumentParser
|
extended argument parser |
Source code in omnigraph/rdfdump_cmd.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
handle_args(args)
Handle parsed CLI arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
Namespace
|
parsed namespace |
required |
Source code in omnigraph/rdfdump_cmd.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
server_config
Created on 2025-05-28
@author: wf
ServerCmd
dataclass
Command wrapper for server operations.
Source code in omnigraph/server_config.py
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | |
__init__(title, func)
Initialize server command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Description of the command |
required |
func
|
Callable
|
Function to execute |
required |
Source code in omnigraph/server_config.py
343 344 345 346 347 348 349 350 351 352 | |
run(verbose=True)
Execute the server command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbose
|
bool
|
Whether to print result |
True
|
Returns:
| Type | Description |
|---|---|
any
|
Result from function execution |
Source code in omnigraph/server_config.py
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | |
ServerConfig
dataclass
a server configuration for a Knowledge Graph endpoint potentially provided by a docker container and often implemented as a SPARQL endpoint
Source code in omnigraph/server_config.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |
support_status
property
Determine support status based on configuration and environment.
Returns:
| Type | Description |
|---|---|
SupportStatus
|
SupportStatus enum indicating if/how server can run |
generator_header(version=None)
generate a standard header with timestamp and optional version information
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
version
|
optional version info, defaults to Version.version |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
a header string suitable for generated files |
Source code in omnigraph/server_config.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
to_apache_config(domain, version)
Generate Apache configuration based for this server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
domain(str)
|
the base domain to use |
required | |
version
|
None
|
the omnigraph Version info to use |
required |
Returns: str: The Apache configuration as a string.
Source code in omnigraph/server_config.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |
ServerConfigs
Collection of server configurations loaded from YAML.
Source code in omnigraph/server_config.py
324 325 326 327 328 329 330 331 332 333 334 | |
ofYaml(yaml_path)
classmethod
Load server configurations from YAML file.
Source code in omnigraph/server_config.py
330 331 332 333 334 | |
ServerEnv
Server environment configuration.
Source code in omnigraph/server_config.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
__init__(log=None, shell=None, force=False, debug=False, verbose=False)
Initialize server environment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log
|
Log
|
Log instance for logging |
None
|
shell
|
Shell
|
Shell instance for command execution |
None
|
force
|
bool
|
if True enable actions that are otherwise protected e.g. deletion of data |
False
|
debug
|
bool
|
Enable debug mode |
False
|
verbose
|
bool
|
Enable verbose output |
False
|
Source code in omnigraph/server_config.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
ServerLifecycleState
Bases: Enum
a state in the servers lifecycle
Source code in omnigraph/server_config.py
61 62 63 64 65 66 67 68 69 70 71 | |
ServerStatus
dataclass
Server status
Source code in omnigraph/server_config.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
get_summary(debug)
get a summary of the Server Status
Source code in omnigraph/server_config.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
SupportStatus
Bases: Enum
Determines if and how a server can run based on environment/licenses.
Source code in omnigraph/server_config.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
can_start()
Check if server can be started with this status.
Source code in omnigraph/server_config.py
33 34 35 | |
is_blocking()
Check if this status blocks server operations.
Source code in omnigraph/server_config.py
37 38 39 | |
log_status(log, container_name, config)
Log appropriate message for this status.
Source code in omnigraph/server_config.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
servers
blazegraph
Created on 2025-05-27
@author: wf
Blazegraph
Bases: SparqlServer
Dockerized Blazegraph SPARQL server
Source code in omnigraph/servers/blazegraph.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | |
__init__(config, env)
Initialize the Blazegraph manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
ServerConfig
|
Server configuration |
required |
env
|
ServerEnv
|
Server environment (includes log, shell, debug, verbose) |
required |
Source code in omnigraph/servers/blazegraph.py
59 60 61 62 63 64 65 66 67 | |
get_dataloader_xml(container_path)
Build the DataLoader servlet properties XML for the given container-side file or directory path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
container_path
|
str
|
path as seen inside the container (mounted /data) |
required |
Returns:
| Type | Description |
|---|---|
str
|
the properties XML document |
Source code in omnigraph/servers/blazegraph.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
pre_create()
Prepare Blazegraph data directory and RWStore.properties.
Source code in omnigraph/servers/blazegraph.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
status()
Get server status information.
Returns:
| Type | Description |
|---|---|
ServerStatus
|
ServerStatus object with status information |
Source code in omnigraph/servers/blazegraph.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
test_geosparql()
Test if GeoSPARQL functions work.
Returns:
| Type | Description |
|---|---|
bool
|
True if GeoSPARQL is available |
Source code in omnigraph/servers/blazegraph.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | |
upload_dump_files(file_pattern=None)
Bulk-load dump files via Blazegraph's REST DataLoader servlet, which reads the files from the server's own filesystem (the mounted /data directory) instead of pushing them through HTTP request bodies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_pattern
|
str
|
Glob pattern for dump files |
None
|
Returns:
| Type | Description |
|---|---|
int
|
Number of files loaded successfully |
Source code in omnigraph/servers/blazegraph.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
BlazegraphConfig
dataclass
Bases: ServerConfig
Blazegraph configuration
Source code in omnigraph/servers/blazegraph.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
get_docker_run_command(data_dir)
Generate docker run command with bind mount for Blazegraph journal directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Host directory path to bind mount to container |
required |
Returns:
| Type | Description |
|---|---|
str
|
Complete docker run command string |
Source code in omnigraph/servers/blazegraph.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
graphdb
Created on 2025-05-30
Ontotext GraphDB SPARQL support
@author: wf
GraphDB
Bases: SparqlServer
Dockerized Ontotext GraphDB SPARQL server
Source code in omnigraph/servers/graphdb.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
__init__(config, env)
Initialize the GraphDB manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
ServerConfig
|
Server configuration |
required |
env
|
ServerEnv
|
Server environment (includes log, shell, debug, verbose) |
required |
Source code in omnigraph/servers/graphdb.py
75 76 77 78 79 80 81 82 83 84 | |
post_start(first_start)
Create repository after container starts.
References
- https://graphdb.ontotext.com/documentation/11.2/manage-repos-with-restapi.html
Source code in omnigraph/servers/graphdb.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
status()
Check GraphDB server status from container logs.
Returns: ServerStatus object with status information
Source code in omnigraph/servers/graphdb.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
GraphDBConfig
dataclass
Bases: ServerConfig
GraphDB configuration
Source code in omnigraph/servers/graphdb.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
__post_init__()
configure the configuration
Source code in omnigraph/servers/graphdb.py
20 21 22 23 24 25 26 27 28 29 30 31 32 | |
get_docker_run_command(data_dir)
Generate docker run command with bind mount for data directory. Handles image swapping (effective_image) and conditional license injection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Host directory path to bind mount to container |
required |
Returns:
| Type | Description |
|---|---|
str
|
Complete docker run command string |
Source code in omnigraph/servers/graphdb.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
jena
Created on 2025-05-28
Apache Jena SPARQL support
@author: wf
Jena
Bases: SparqlServer
Dockerized Jena Fuseki SPARQL server
Source code in omnigraph/servers/jena.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
__init__(config, env)
Initialize the Jena Fuseki manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
ServerConfig
|
Server configuration |
required |
env
|
ServerEnv
|
Server environment (includes log, shell, debug, verbose) |
required |
Source code in omnigraph/servers/jena.py
65 66 67 68 69 70 71 72 73 | |
execute_update_query(update_query)
Execute SPARQL UPDATE query using Jena's update endpoint.
Jena Fuseki requires application/sparql-update content type for UPDATE operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
update_query
|
str
|
SPARQL UPDATE query string |
required |
Returns:
| Type | Description |
|---|---|
tuple[any, Exception]
|
Tuple of (response, exception) |
Source code in omnigraph/servers/jena.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
get_tdbloader_command(files)
Build the tdb2.tdbloader docker command for the given dump files.
The loader classes ship inside fuseki-server.jar, so the server's own image is reused with an overridden entrypoint. The TDB2 dataset is single-writer - the server must be stopped while the loader runs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
List[Path]
|
dump files to load (from the dumps directory) |
required |
Returns:
| Type | Description |
|---|---|
str
|
the docker run command string |
Source code in omnigraph/servers/jena.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
status()
Get server status information.
Returns: ServerStatus object with status information
Source code in omnigraph/servers/jena.py
75 76 77 78 79 80 81 82 83 84 85 86 87 | |
upload_dump_files(file_pattern=None)
Bulk-load dump files with tdb2.tdbloader directly into the TDB2 database files - the native path for the file-backed store, avoiding the HTTP single-POST transaction that faults the mmap'd node table (issue #25).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_pattern
|
str
|
Glob pattern for dump files |
None
|
Returns:
| Type | Description |
|---|---|
int
|
Number of files loaded successfully |
Source code in omnigraph/servers/jena.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
JenaConfig
dataclass
Bases: ServerConfig
Jena Fuseki configuration
Source code in omnigraph/servers/jena.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
__post_init__()
configure the configuration
Source code in omnigraph/servers/jena.py
23 24 25 26 27 28 29 30 31 32 33 34 35 | |
get_docker_run_command(data_dir)
Generate docker run command with bind mount for data directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Host directory path to bind mount to container |
required |
Returns:
| Type | Description |
|---|---|
str
|
Complete docker run command string |
Source code in omnigraph/servers/jena.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
millenniumdb
Created on 2025-11-25
MillenniumDB SPARQL support generated by Claude Sonnet 4.5 using
https://gitingest.com/ and the content of https://github.com/WolfgangFahl/pyomnigraph/issues/14
with the prompt
implement #14
@author: wf
MillenniumDB
Bases: SparqlServer
Dockerized MillenniumDB SPARQL server
MillenniumDB uses a two-step process: 1. Import data with mdb-import to create database 2. Run server with mdb-server pointing to created database
Source code in omnigraph/servers/millenniumdb.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | |
__init__(config, env)
Initialize the MillenniumDB manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
ServerConfig
|
Server configuration |
required |
env
|
ServerEnv
|
Server environment (includes log, shell, debug, verbose) |
required |
Source code in omnigraph/servers/millenniumdb.py
83 84 85 86 87 88 89 90 91 | |
get_web_url()
Return the MillenniumDB Web UI URL.
Source code in omnigraph/servers/millenniumdb.py
250 251 252 253 254 | |
load_dump_files(file_pattern=None)
Override load_dump_files to explain MillenniumDB's import process.
For MillenniumDB, data must be imported during database creation, not after the server is running. This method will restart the server with a fresh import if called.
Source code in omnigraph/servers/millenniumdb.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | |
pre_create()
Import data using mdb-import before starting the server. This is MillenniumDB's unique two-step setup process.
Source code in omnigraph/servers/millenniumdb.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
status()
Get server status information.
Returns:
| Type | Description |
|---|---|
ServerStatus
|
ServerStatus object with status information |
Source code in omnigraph/servers/millenniumdb.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | |
upload_request(file_content)
MillenniumDB doesn't support HTTP upload. Data must be imported using mdb-import before server starts.
This method will raise an error if called.
Source code in omnigraph/servers/millenniumdb.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
MillenniumDBConfig
dataclass
Bases: ServerConfig
MillenniumDB configuration
Source code in omnigraph/servers/millenniumdb.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
__post_init__()
Configure the MillenniumDB-specific URLs and settings
Source code in omnigraph/servers/millenniumdb.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
get_docker_run_command(data_dir)
Generate docker run command for MillenniumDB server.
Note: This starts the server. Data must be imported first using mdb-import.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
str
|
Host directory path containing the imported database |
required |
Returns:
| Type | Description |
|---|---|
str
|
Complete docker run command string |
Source code in omnigraph/servers/millenniumdb.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
oxigraph
Created on 2025-06-03
Oxigraph SPARQL support https://github.com/oxigraph/oxigraph https://pyoxigraph.readthedocs.io/en/stable/
@author: wf
Oxigraph
Bases: SparqlServer
Dockerized Oxigraph SPARQL server
Source code in omnigraph/servers/oxigraph.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
__init__(config, env)
Initialize the Oxigraph manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
ServerConfig
|
Server configuration |
required |
env
|
ServerEnv
|
Server environment (includes log, shell, debug, verbose) |
required |
Source code in omnigraph/servers/oxigraph.py
62 63 64 65 66 67 68 69 70 | |
execute_update_query(update_query)
Execute SPARQL UPDATE query using Oxigraphs's update endpoint.
Oxigraph requires application/sparql-update content type for UPDATE operations. see also how Jena does this
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
update_query
|
str
|
SPARQL UPDATE query string |
required |
Returns:
| Type | Description |
|---|---|
tuple[any, Exception]
|
Tuple of (response, exception) |
Source code in omnigraph/servers/oxigraph.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
status()
Get server status information.
Returns:
| Type | Description |
|---|---|
ServerStatus
|
ServerStatus object with status information |
Source code in omnigraph/servers/oxigraph.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
OxigraphConfig
dataclass
Bases: ServerConfig
Oxigraph configuration
Source code in omnigraph/servers/oxigraph.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
__post_init__()
configure the configuration
Source code in omnigraph/servers/oxigraph.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
get_docker_run_command(data_dir)
Generate docker run command with bind mount for data directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Host directory path to bind mount to container |
required |
Returns:
| Type | Description |
|---|---|
str
|
Complete docker run command string |
Source code in omnigraph/servers/oxigraph.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
qlever
Created on 2025-05-28
@author: wf
QLever
Bases: SparqlServer
Dockerized QLever SPARQL server
Source code in omnigraph/servers/qlever.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | |
__init__(config, env)
Initialize the QLever server manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
ServerConfig
|
Server configuration |
required |
env
|
ServerEnv
|
Server environment (includes log, shell, debug, verbose) |
required |
Source code in omnigraph/servers/qlever.py
107 108 109 110 111 112 113 114 115 | |
get_index_commands(files)
Build the qlever CLI commands to (re)index the given dump files.
QLever loads bulk data by building its index from files - there is no native HTTP bulk-write path; the SPARQL INSERT route is only suitable for small increments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
List[Path]
|
dump files staged in the data directory |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
list of shell commands to run in the data directory |
Source code in omnigraph/servers/qlever.py
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | |
handle_config(step)
handle config setting for following step and patch QLeverfile to port
Source code in omnigraph/servers/qlever.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | |
start(show_progress=True)
Start QLever using proper workflow.
Source code in omnigraph/servers/qlever.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
status()
Check QLever server status from container logs.
Returns: ServerStatus object with status information
Source code in omnigraph/servers/qlever.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
upload_dump_files(file_pattern=None)
Bulk-load dump files by rebuilding the QLever index from them - the native path; the turtle-to-INSERT conversion of upload_request is unsuitable for bulk data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_pattern
|
str
|
Glob pattern for dump files |
None
|
Returns:
| Type | Description |
|---|---|
int
|
Number of files loaded successfully |
Source code in omnigraph/servers/qlever.py
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | |
upload_request(file_content)
Upload request for QLever using SPARQL INSERT statements.
Source code in omnigraph/servers/qlever.py
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | |
QLeverConfig
dataclass
Bases: ServerConfig
specialized QLever configuration
Source code in omnigraph/servers/qlever.py
86 87 88 89 90 91 92 93 94 95 96 97 98 | |
QLeverfile
handle qlever control https://github.com/ad-freiburg/qlever-control QLeverfile in INI format
Source code in omnigraph/servers/qlever.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
as_dict()
Return full config as nested dictionary
Source code in omnigraph/servers/qlever.py
69 70 71 72 73 74 75 76 | |
get(section, key)
Get a value from the config, if exists
Source code in omnigraph/servers/qlever.py
47 48 49 50 51 52 53 | |
ofFile(path)
classmethod
Create QLeverfile instance from given INI file
Source code in omnigraph/servers/qlever.py
36 37 38 39 40 41 42 43 44 45 | |
save()
Save the config back to file
Source code in omnigraph/servers/qlever.py
78 79 80 81 82 83 | |
sections()
Return list of config sections
Source code in omnigraph/servers/qlever.py
63 64 65 66 67 | |
set(section, key, value)
Set a value in the config
Source code in omnigraph/servers/qlever.py
55 56 57 58 59 60 61 | |
stardog
Created on 2025-06-03
Stardog SPARQL support
@author: wf
Stardog
Bases: SparqlServer
Dockerized Stardog SPARQL server
Source code in omnigraph/servers/stardog.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
__init__(config, env)
Initialize the Stardog manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
ServerConfig
|
Server configuration |
required |
env
|
ServerEnv
|
Server environment (includes log, shell, debug, verbose) |
required |
Source code in omnigraph/servers/stardog.py
77 78 79 80 81 82 83 84 85 | |
pre_create()
Build Stardog image if needed.
Source code in omnigraph/servers/stardog.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
status()
Get server status information.
Returns:
| Type | Description |
|---|---|
ServerStatus
|
ServerStatus object with status information |
Source code in omnigraph/servers/stardog.py
112 113 114 115 116 117 118 119 120 121 122 123 124 | |
StardogConfig
dataclass
Bases: ServerConfig
Stardog configuration
Source code in omnigraph/servers/stardog.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
__post_init__()
configure the configuration
Source code in omnigraph/servers/stardog.py
21 22 23 24 25 26 27 28 29 30 31 32 33 | |
get_docker_run_command(data_dir)
Generate docker run command with bind mount for data directory. Handles the special case of swapping to the free image (Github/Zazuko) where the license key must NOT be injected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Host directory path to bind mount to container |
required |
Returns:
| Type | Description |
|---|---|
str
|
Complete docker run command string |
Source code in omnigraph/servers/stardog.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
virtuoso
Created on 2025-06-03
OpenLink Virtuoso SPARQL support
@author: wf
Virtuoso
Bases: SparqlServer
Dockerized OpenLink Virtuoso SPARQL server
Source code in omnigraph/servers/virtuoso.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
__init__(config, env)
Initialize the Virtuoso manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
ServerConfig
|
Server configuration |
required |
env
|
ServerEnv
|
Server environment (includes log, shell, debug, verbose) |
required |
Source code in omnigraph/servers/virtuoso.py
64 65 66 67 68 69 70 71 72 | |
ensure_permissions()
Ensure permissions are set (can be called even if server is already running).
Source code in omnigraph/servers/virtuoso.py
131 132 133 134 135 136 137 | |
get_clear_query()
the clear query to be used overrides the default query
Source code in omnigraph/servers/virtuoso.py
139 140 141 142 143 144 145 146 147 148 149 150 | |
post_create()
Setup permissions after container creation.
Source code in omnigraph/servers/virtuoso.py
74 75 76 77 78 79 | |
run_isql_cmd(cmd)
Run SQL command via isql.
Source code in omnigraph/servers/virtuoso.py
81 82 83 84 85 86 87 88 89 90 91 | |
setup_permissions()
Grant necessary permissions to SPARQL user.
Source code in omnigraph/servers/virtuoso.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
status()
Get server status information.
Returns:
| Type | Description |
|---|---|
ServerStatus
|
ServerStatus object with status information |
Source code in omnigraph/servers/virtuoso.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
VirtuosoConfig
dataclass
Bases: ServerConfig
Virtuoso configuration
Source code in omnigraph/servers/virtuoso.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
__post_init__()
configure the configuration
Source code in omnigraph/servers/virtuoso.py
21 22 23 24 25 26 27 28 29 30 31 32 | |
get_docker_run_command(data_dir)
Generate docker run command with bind mount for data directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Host directory path to bind mount to container |
required |
Returns:
| Type | Description |
|---|---|
str
|
Complete docker run command string |
Source code in omnigraph/servers/virtuoso.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
software
Software
dataclass
Single software requirement definition
Source code in omnigraph/software.py
10 11 12 13 14 15 16 17 | |
SoftwareList
Collection of software requirements loadable from YAML
Source code in omnigraph/software.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
check_installed(log, shell, verbose=True)
Check if necessary software commands are available and suggest installation packages
Source code in omnigraph/software.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
sparql_server
Created on 2025-05-27
@author: wf
Response
wrapper for responses including errors
Source code in omnigraph/sparql_server.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
SparqlServer
Base class for dockerized SPARQL servers
Source code in omnigraph/sparql_server.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 | |
__init__(config, env)
Initialize the SPARQL server manager.
Source code in omnigraph/sparql_server.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
add_triple_count2_server_status(server_status=ServerStatus)
add triple count to server status
Source code in omnigraph/sparql_server.py
290 291 292 293 294 295 296 297 298 | |
as_endpoint_conf(prefix_configs, prefix_sets)
Convert server configuration to Endpoint configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prefix_configs
|
PrefixConfigs
|
PrefixConfigs instance with prefix definitions |
required |
prefix_sets
|
List[str]
|
List of prefix set names to include |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Endpoint |
Endpoint
|
Endpoint configuration object |
Source code in omnigraph/sparql_server.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | |
bash()
bash into the server container.
Source code in omnigraph/sparql_server.py
337 338 339 | |
check_needed_software()
Check if needed software for this server configuration is installed
Source code in omnigraph/sparql_server.py
754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 | |
clear()
Delete all triples.
Source code in omnigraph/sparql_server.py
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 | |
count_triples()
Count total triples in the SPARQL server.
Returns:
| Type | Description |
|---|---|
int
|
Number of triples |
Source code in omnigraph/sparql_server.py
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | |
docker_cmd(cmd, options='', args='')
create the given docker command with the given options
Source code in omnigraph/sparql_server.py
307 308 309 | |
docker_create()
Create and start a new Docker container for the configured server.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the container was created and is running, False otherwise. |
Source code in omnigraph/sparql_server.py
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | |
docker_info()
Check if Docker is responsive on the host system.
Source code in omnigraph/sparql_server.py
325 326 327 | |
execute_update_query(update_query)
Execute a SPARQL UPDATE query (INSERT/DELETE).
This method can be overridden by subclasses to handle server-specific requirements (e.g., different content types, endpoints).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
update_query
|
str
|
SPARQL UPDATE query string |
required |
Returns:
| Type | Description |
|---|---|
tuple[any, Exception]
|
Tuple of (response, exception) |
Source code in omnigraph/sparql_server.py
595 596 597 598 599 600 601 602 603 604 605 606 607 608 | |
execute_update_query_with_post(update_query)
Execute SPARQL UPDATE query using application/sparql-update content type for UPDATE operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
update_query
|
str
|
SPARQL UPDATE query string |
required |
Returns:
| Type | Description |
|---|---|
tuple[Optional[Any], Optional[Exception]]
|
Tuple of (response, exception) |
Source code in omnigraph/sparql_server.py
562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | |
get_clear_query()
the clear query to be used may be overriden by specific SPARQL server implementations
Source code in omnigraph/sparql_server.py
553 554 555 556 557 558 559 560 | |
get_dump_files(file_pattern=None)
Get the dump files matching the given pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_pattern
|
str
|
Glob pattern for dump files |
None
|
Returns:
| Type | Description |
|---|---|
List[Path]
|
sorted list of matching dump file paths |
Source code in omnigraph/sparql_server.py
690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 | |
get_web_url()
Return the service-specific Web UI URL. Subclasses may override.
Source code in omnigraph/sparql_server.py
226 227 228 229 230 231 | |
handle_exception(context, ex)
handle the given exception
Source code in omnigraph/sparql_server.py
182 183 184 185 186 187 188 189 190 191 192 193 | |
load_dump_files(file_pattern=None)
Load all dump files matching pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_pattern
|
str
|
Glob pattern for dump files |
None
|
use_bulk
|
Use bulk loader if True, individual files if False |
required |
Returns:
| Type | Description |
|---|---|
int
|
Number of files loaded successfully |
Source code in omnigraph/sparql_server.py
724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 | |
load_file(filepath, upload_request=None)
Load a single RDF file into the RDF server.
Source code in omnigraph/sparql_server.py
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 | |
logs()
show the logs of the container
Source code in omnigraph/sparql_server.py
315 316 317 318 319 320 321 322 323 | |
make_request(method, url, **kwargs)
Helper function for making HTTP requests with consistent error handling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
str
|
HTTP method (GET, POST, etc.) |
required |
url
|
str
|
Request URL |
required |
**kwargs
|
Additional arguments for requests |
{}
|
Returns:
| Type | Description |
|---|---|
Response
|
Response |
Source code in omnigraph/sparql_server.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
post_create()
abstract post docker create step implement a special version if need be
Source code in omnigraph/sparql_server.py
347 348 349 350 351 | |
post_start(first_start)
Abstract post start step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
first_start
|
bool
|
True if this is the first time starting (new container) |
required |
Source code in omnigraph/sparql_server.py
413 414 415 416 417 418 419 420 | |
pre_create()
abstract pre docker create step implement a special version if need be
Source code in omnigraph/sparql_server.py
341 342 343 344 345 | |
refresh_logs(server_status=ServerStatus)
refresh the logs for the given server status
Source code in omnigraph/sparql_server.py
282 283 284 285 286 287 288 | |
rm()
remove the server container.
Source code in omnigraph/sparql_server.py
333 334 335 | |
run_docker_cmd(cmd, options='', args='')
run the given docker commmand with the given options
Source code in omnigraph/sparql_server.py
311 312 313 | |
run_shell_command(command, success_msg=None, error_msg=None)
Helper function for running shell commands with consistent error handling.
Source code in omnigraph/sparql_server.py
301 302 303 304 305 | |
start(show_progress=True)
Start SPARQL server in Docker container.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
show_progress
|
bool
|
Show progress bar while waiting |
True
|
Returns:
| Type | Description |
|---|---|
bool
|
True if started successfully |
Source code in omnigraph/sparql_server.py
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 | |
status()
Check server status using a single docker inspect call.
Returns:
| Name | Type | Description |
|---|---|---|
ServerStatus |
ServerStatus
|
object with detailed container state |
Source code in omnigraph/sparql_server.py
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |
status_info()
Return one-line summary of server status e.g. for CLI use.
Source code in omnigraph/sparql_server.py
240 241 242 243 244 245 246 247 | |
stop()
stop the server container
Source code in omnigraph/sparql_server.py
329 330 331 | |
upload_dump_files(file_pattern=None)
Bulk-upload all dump files matching pattern using the server's native bulk load mechanism.
Subclasses override this with their native loader (e.g. Jena tdb2.tdbloader, Blazegraph REST DataLoader, QLever index build); the default falls back to the HTTP load path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_pattern
|
str
|
Glob pattern for dump files |
None
|
Returns:
| Type | Description |
|---|---|
int
|
Number of files loaded successfully |
Source code in omnigraph/sparql_server.py
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 | |
upload_request(file_content)
Default upload request for Blazegraph-style servers.
Source code in omnigraph/sparql_server.py
642 643 644 645 646 647 648 649 650 651 | |
wait_until_ready(show_progress=False)
Wait for server to be ready.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
Maximum seconds to wait |
required | |
show_progress
|
bool
|
Show progress bar while waiting |
False
|
Returns:
| Type | Description |
|---|---|
bool
|
True if ready within timeout |
Source code in omnigraph/sparql_server.py
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 | |
webui()
open my webui
Source code in omnigraph/sparql_server.py
233 234 235 236 237 238 | |
Step
dataclass
a setup step
Source code in omnigraph/sparql_server.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
perform(server)
perform the setup_cmd if self.path is not created yet
Source code in omnigraph/sparql_server.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
version
Created on 2025-05-28
@author: wf
Version
Version handling for nicegui widgets
Source code in omnigraph/version.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |