pyomnigraph 0.2.0__tar.gz → 0.2.1__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.
Files changed (56) hide show
  1. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/PKG-INFO +11 -10
  2. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/README.md +10 -9
  3. pyomnigraph-0.2.1/omnigraph/__init__.py +1 -0
  4. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/omnigraph_cmd.py +4 -0
  5. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/rdf_dataset.py +18 -15
  6. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/resources/examples/servers.yaml +1 -0
  7. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/server_config.py +1 -0
  8. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/servers/blazegraph.py +1 -1
  9. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/servers/graphdb.py +1 -1
  10. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/servers/jena.py +1 -1
  11. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/servers/millenniumdb.py +2 -2
  12. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/servers/oxigraph.py +1 -1
  13. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/servers/stardog.py +1 -1
  14. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/servers/virtuoso.py +1 -1
  15. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/version.py +1 -1
  16. pyomnigraph-0.2.1/scripts/gov-quickstart +11 -0
  17. pyomnigraph-0.2.1/scripts/quickstart +210 -0
  18. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/tests/test_omniserver.py +54 -0
  19. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/tests/test_rdfdump.py +51 -1
  20. pyomnigraph-0.2.0/omnigraph/__init__.py +0 -1
  21. pyomnigraph-0.2.0/scripts/build-stardog-free +0 -35
  22. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/.github/workflows/build.yml +0 -0
  23. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/.github/workflows/upload-to-pypi.yml +0 -0
  24. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/.gitignore +0 -0
  25. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/.project +0 -0
  26. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/.pydevproject +0 -0
  27. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/AGENTS.md +0 -0
  28. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/LICENSE +0 -0
  29. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/docs/index.md +0 -0
  30. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/mkdocs.yml +0 -0
  31. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/basecmd.py +0 -0
  32. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/ominigraph_paths.py +0 -0
  33. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/omniserver.py +0 -0
  34. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/rdfdump.py +0 -0
  35. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/rdfdump_cmd.py +0 -0
  36. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/resources/__init__.py +0 -0
  37. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/resources/examples/datasets.yaml +0 -0
  38. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/resources/examples/endpoints.yaml +0 -0
  39. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/resources/examples/prefixes.yaml +0 -0
  40. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/resources/examples/queries.yaml +0 -0
  41. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/resources/examples/royals.ttl +0 -0
  42. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/servers/__init__.py +0 -0
  43. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/servers/qlever.py +0 -0
  44. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/software.py +0 -0
  45. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/omnigraph/sparql_server.py +0 -0
  46. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/pyproject.toml +0 -0
  47. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/scripts/blackisort +0 -0
  48. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/scripts/doc +0 -0
  49. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/scripts/install +0 -0
  50. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/scripts/release +0 -0
  51. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/scripts/test +0 -0
  52. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/tests/__init__.py +0 -0
  53. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/tests/basetest.py +0 -0
  54. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/tests/test_qlever.py +0 -0
  55. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/tests/test_software_list.py +0 -0
  56. {pyomnigraph-0.2.0 → pyomnigraph-0.2.1}/tests/test_sparql_server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyomnigraph
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: pyomnigraph: Unified Python interface for multiple graph databases (SPARQL, Neo4j, Weaviate)
5
5
  Project-URL: Home, https://github.com/WolfgangFahl/omnigraph
6
6
  Project-URL: Documentation, https://wiki.bitplan.com/index.php/omnigraph
@@ -83,16 +83,16 @@ This leads to:
83
83
 
84
84
  ### Supported Triple Stores
85
85
 
86
- | Database | Status | Strengths |
87
- |----------|--------|-----------|
86
+ | Database | Status | Notes |
87
+ |----------|--------|-------|
88
88
  | **Apache Jena** | 🟢 Working | Robust, standards compliant |
89
89
  | **Blazegraph** | 🟢 Working | High performance, easy setup |
90
- | **GraphDB** | 🟢 Working | Enterprise features, reasoning - Free Version tested|
90
+ | **Oxigraph** | 🟢 Working | Rust-based, embedded, fast |
91
91
  | **QLever** | 🟢 Working | Extremely fast queries |
92
- | **Virtuoso** | 🛑 In Progress | Mature, SQL integration |
93
- | **MillenniumDB** | 🛑 In Progress | Property Graph + RDF; SPARQL 1.1 (RDF) and MQL (PG); import-first workflow |
94
- | **Oxigraph** | 🛑 In Progress | Rust-based, embedded |
95
- | **Stardog** | 🛑 Planned | Knowledge graphs, reasoning |
92
+ | **GraphDB** | 🛑 Disabled | License required (free version available) |
93
+ | **MillenniumDB** | 🛑 Disabled | Import-first workflow, Property Graph + RDF |
94
+ | **Virtuoso** | 🛑 Disabled | Permissions issue (#30) |
95
+ | **Stardog** | 🛑 Planned | License required |
96
96
 
97
97
  Whether you're building a semantic web application, conducting research, or evaluating different triple stores, pyomnigraph eliminates the complexity of working with multiple graph database systems.
98
98
 
@@ -103,10 +103,11 @@ omnigraph omnigraph --list --include-inactive --doc-format github
103
103
  | Active | Name | Container Name | Wikidata | Image | Port | Test Port | Dataset | User |
104
104
  |----------|-------------------------------------|----------------------|--------------------------------------------------------|--------------------------------------------------------------------------------------------------|--------|-------------|-----------|--------|
105
105
  | 🟢️ | [blazegraph](http://localhost:9898) | blazegraph-omnigraph | [Q20127748](https://www.wikidata.org/wiki/Q20127748) | [lyrasis/blazegraph:2.1.5](https://hub.docker.com/r/lyrasis/blazegraph) | 9898 | 7898 | kb | |
106
- | 🟢 | [graphdb](http://localhost:7200) | graphdb-omnigraph | [Q58425577](https://www.wikidata.org/wiki/Q58425577) | [ontotext/graphdb:9.11.2-se](https://hub.docker.com/r/ontotext/graphdb) | 7200 | 7700 | repo1 | |
107
106
  | 🟢️ | [jena](http://localhost:3030) | jena-omnigraph | [Q109376461](https://www.wikidata.org/wiki/Q109376461) | [stain/jena-fuseki:latest](https://hub.docker.com/r/stain/jena-fuseki) | 3030 | 7030 | ds | admin |
108
- | 🛑 | [oxigraph](http://localhost:7878) | oxigraph-omnigraph | [Q118980507](https://www.wikidata.org/wiki/Q118980507) | [oxigraph/oxigraph:latest](https://hub.docker.com/r/oxigraph/oxigraph) | 7878 | 7378 | default | |
107
+ | 🟢️ | [oxigraph](http://localhost:7878) | oxigraph-omnigraph | [Q118980507](https://www.wikidata.org/wiki/Q118980507) | [oxigraph/oxigraph:latest](https://hub.docker.com/r/oxigraph/oxigraph) | 7878 | 7378 | default | |
109
108
  | 🟢️ | [qlever](http://localhost:7019) | qlever-omnigraph | [Q111016295](https://www.wikidata.org/wiki/Q111016295) | [adfreiburg/qlever:latest](https://hub.docker.com/r/adfreiburg/qlever) | 7019 | 7819 | olympics | |
109
+ | 🛑 | [graphdb](http://localhost:7200) | graphdb-omnigraph | [Q58425577](https://www.wikidata.org/wiki/Q58425577) | [ontotext/graphdb:11.2.0](https://hub.docker.com/r/ontotext/graphdb) | 7200 | 7700 | repo1 | |
110
+ | 🛑 | [millenniumdb](http://localhost:1234)| millenniumdb-omnigraph| [Q118954995](https://www.wikidata.org/wiki/Q118954995) | [imfd/millenniumdb](https://hub.docker.com/r/imfd/millenniumdb) | 1234 | 1734 | default | |
110
111
  | 🛑 | [stardog](http://localhost:5820) | stardog-omnigraph | [Q91147741](https://www.wikidata.org/wiki/Q91147741) | [stardog/stardog:latest](https://hub.docker.com/r/stardog/stardog) | 5820 | 5320 | mydb | admin |
111
112
  | 🛑 | [virtuoso](http://localhost:8890) | virtuoso-omnigraph | [Q7935239](https://www.wikidata.org/wiki/Q7935239) | [openlink/virtuoso-opensource-7:latest](https://hub.docker.com/r/openlink/virtuoso-opensource-7) | 8890 | 8390 | KB | dba |
112
113
 
@@ -37,16 +37,16 @@ This leads to:
37
37
 
38
38
  ### Supported Triple Stores
39
39
 
40
- | Database | Status | Strengths |
41
- |----------|--------|-----------|
40
+ | Database | Status | Notes |
41
+ |----------|--------|-------|
42
42
  | **Apache Jena** | 🟢 Working | Robust, standards compliant |
43
43
  | **Blazegraph** | 🟢 Working | High performance, easy setup |
44
- | **GraphDB** | 🟢 Working | Enterprise features, reasoning - Free Version tested|
44
+ | **Oxigraph** | 🟢 Working | Rust-based, embedded, fast |
45
45
  | **QLever** | 🟢 Working | Extremely fast queries |
46
- | **Virtuoso** | 🛑 In Progress | Mature, SQL integration |
47
- | **MillenniumDB** | 🛑 In Progress | Property Graph + RDF; SPARQL 1.1 (RDF) and MQL (PG); import-first workflow |
48
- | **Oxigraph** | 🛑 In Progress | Rust-based, embedded |
49
- | **Stardog** | 🛑 Planned | Knowledge graphs, reasoning |
46
+ | **GraphDB** | 🛑 Disabled | License required (free version available) |
47
+ | **MillenniumDB** | 🛑 Disabled | Import-first workflow, Property Graph + RDF |
48
+ | **Virtuoso** | 🛑 Disabled | Permissions issue (#30) |
49
+ | **Stardog** | 🛑 Planned | License required |
50
50
 
51
51
  Whether you're building a semantic web application, conducting research, or evaluating different triple stores, pyomnigraph eliminates the complexity of working with multiple graph database systems.
52
52
 
@@ -57,10 +57,11 @@ omnigraph omnigraph --list --include-inactive --doc-format github
57
57
  | Active | Name | Container Name | Wikidata | Image | Port | Test Port | Dataset | User |
58
58
  |----------|-------------------------------------|----------------------|--------------------------------------------------------|--------------------------------------------------------------------------------------------------|--------|-------------|-----------|--------|
59
59
  | 🟢️ | [blazegraph](http://localhost:9898) | blazegraph-omnigraph | [Q20127748](https://www.wikidata.org/wiki/Q20127748) | [lyrasis/blazegraph:2.1.5](https://hub.docker.com/r/lyrasis/blazegraph) | 9898 | 7898 | kb | |
60
- | 🟢 | [graphdb](http://localhost:7200) | graphdb-omnigraph | [Q58425577](https://www.wikidata.org/wiki/Q58425577) | [ontotext/graphdb:9.11.2-se](https://hub.docker.com/r/ontotext/graphdb) | 7200 | 7700 | repo1 | |
61
60
  | 🟢️ | [jena](http://localhost:3030) | jena-omnigraph | [Q109376461](https://www.wikidata.org/wiki/Q109376461) | [stain/jena-fuseki:latest](https://hub.docker.com/r/stain/jena-fuseki) | 3030 | 7030 | ds | admin |
62
- | 🛑 | [oxigraph](http://localhost:7878) | oxigraph-omnigraph | [Q118980507](https://www.wikidata.org/wiki/Q118980507) | [oxigraph/oxigraph:latest](https://hub.docker.com/r/oxigraph/oxigraph) | 7878 | 7378 | default | |
61
+ | 🟢️ | [oxigraph](http://localhost:7878) | oxigraph-omnigraph | [Q118980507](https://www.wikidata.org/wiki/Q118980507) | [oxigraph/oxigraph:latest](https://hub.docker.com/r/oxigraph/oxigraph) | 7878 | 7378 | default | |
63
62
  | 🟢️ | [qlever](http://localhost:7019) | qlever-omnigraph | [Q111016295](https://www.wikidata.org/wiki/Q111016295) | [adfreiburg/qlever:latest](https://hub.docker.com/r/adfreiburg/qlever) | 7019 | 7819 | olympics | |
63
+ | 🛑 | [graphdb](http://localhost:7200) | graphdb-omnigraph | [Q58425577](https://www.wikidata.org/wiki/Q58425577) | [ontotext/graphdb:11.2.0](https://hub.docker.com/r/ontotext/graphdb) | 7200 | 7700 | repo1 | |
64
+ | 🛑 | [millenniumdb](http://localhost:1234)| millenniumdb-omnigraph| [Q118954995](https://www.wikidata.org/wiki/Q118954995) | [imfd/millenniumdb](https://hub.docker.com/r/imfd/millenniumdb) | 1234 | 1734 | default | |
64
65
  | 🛑 | [stardog](http://localhost:5820) | stardog-omnigraph | [Q91147741](https://www.wikidata.org/wiki/Q91147741) | [stardog/stardog:latest](https://hub.docker.com/r/stardog/stardog) | 5820 | 5320 | mydb | admin |
65
66
  | 🛑 | [virtuoso](http://localhost:8890) | virtuoso-omnigraph | [Q7935239](https://www.wikidata.org/wiki/Q7935239) | [openlink/virtuoso-opensource-7:latest](https://hub.docker.com/r/openlink/virtuoso-opensource-7) | 8890 | 8390 | KB | dba |
66
67
 
@@ -0,0 +1 @@
1
+ __version__ = "0.2.1"
@@ -123,6 +123,10 @@ class OmnigraphCmd(BaseCmd):
123
123
  """
124
124
  if dataset is None:
125
125
  server.config.dumps_dir = self.ogp.examples_dir
126
+ elif dataset.rdf_file:
127
+ # If rdf_file is specified, set dumps_dir to the parent directory of the file
128
+ rdf_file_path = Path(dataset.rdf_file).expanduser().resolve()
129
+ server.config.dumps_dir = rdf_file_path.parent
126
130
  else:
127
131
  server.config.dumps_dir = self.ogp.dumps_dir / dataset.id
128
132
 
@@ -19,8 +19,8 @@ class RdfDataset:
19
19
  """
20
20
 
21
21
  name: str # Human-readable dataset name
22
- base_url: str # Base URL e.g. for tryit
23
- endpoint_url: str # SPARQL endpoint URL
22
+ base_url: Optional[str] = None # Base URL e.g. for tryit
23
+ endpoint_url: Optional[str] = None # SPARQL endpoint URL
24
24
  description: Optional[str] = None # Optional dataset description
25
25
  database: Optional[str] = "jena" # the database type of the endpoint
26
26
  expected_solutions: Optional[int] = None # Expected number of solutions
@@ -28,6 +28,7 @@ class RdfDataset:
28
28
  construct_template: Optional[str] = field(default="?s ?p ?o")
29
29
  prefix_sets: Optional[list] = field(default_factory=list)
30
30
  active: Optional[bool] = False
31
+ rdf_file: Optional[str] = None # Path to local RDF file (alternative to endpoint_url)
31
32
  # fields to be configured by post_init
32
33
  id: Optional[str] = field(default=None)
33
34
  count_query: Optional[Query] = field(default=None)
@@ -37,20 +38,22 @@ class RdfDataset:
37
38
  def __post_init__(self):
38
39
  """
39
40
  Generate count_query and construct_pattern from select_pattern.
41
+ Only initialize SPARQL-related fields if endpoint_url is provided.
40
42
  """
41
- self.count_query = Query(
42
- name=f"{self.name}_count",
43
- query=f"SELECT (COUNT(*) AS ?count) WHERE {{ {self.select_pattern} }}",
44
- endpoint=self.endpoint_url,
45
- description=f"Count query for {self.name}",
46
- )
47
- self.select_query = Query(
48
- name=f"{self.name}_select",
49
- query=f"SELECT * WHERE {{ {self.select_pattern} }}",
50
- endpoint=self.endpoint_url,
51
- description=f"Select query for {self.name}",
52
- )
53
- self.sparql = SPARQL(self.endpoint_url)
43
+ if self.endpoint_url:
44
+ self.count_query = Query(
45
+ name=f"{self.name}_count",
46
+ query=f"SELECT (COUNT(*) AS ?count) WHERE {{ {self.select_pattern} }}",
47
+ endpoint=self.endpoint_url,
48
+ description=f"Count query for {self.name}",
49
+ )
50
+ self.select_query = Query(
51
+ name=f"{self.name}_select",
52
+ query=f"SELECT * WHERE {{ {self.select_pattern} }}",
53
+ endpoint=self.endpoint_url,
54
+ description=f"Select query for {self.name}",
55
+ )
56
+ self.sparql = SPARQL(self.endpoint_url)
54
57
 
55
58
  @property
56
59
  def full_name(self):
@@ -14,6 +14,7 @@ servers:
14
14
  port: 9898
15
15
  test_port: 7898
16
16
  host: "localhost"
17
+ # docker_bind: "0.0.0.0" # Optional: Uncomment to allow external access (default: "127.0.0.1" for localhost-only, recommended for security)
17
18
  prefix_sets: ["rdf", "blazegraph","gov","wikidata"]
18
19
  active: true
19
20
  graphdb:
@@ -161,6 +161,7 @@ class ServerConfig:
161
161
  has_license: bool = False
162
162
  protocol: str = "http"
163
163
  host: str = "localhost"
164
+ docker_bind: str = "127.0.0.1" # Docker port bind address (default: localhost-only for security)
164
165
  rdf_format: str = "turtle"
165
166
  auth_user: Optional[str] = None
166
167
  auth_password: Optional[str] = None
@@ -42,7 +42,7 @@ class BlazegraphConfig(ServerConfig):
42
42
  f"docker run -d --name {self.container_name} "
43
43
  f"-e BLAZEGRAPH_UID={os.getuid()} "
44
44
  f"-e BLAZEGRAPH_GID={os.getgid()} "
45
- f"-p {self.port}:8080 "
45
+ f"-p {self.docker_bind}:{self.port}:8080 "
46
46
  f"-v {data_dir}/RWStore.properties:/RWStore.properties "
47
47
  f"-v {data_dir}:/data "
48
48
  f"{self.image}"
@@ -60,7 +60,7 @@ class GraphDBConfig(ServerConfig):
60
60
  # 4. Construct Command
61
61
  docker_run_command = (
62
62
  f"docker run {env_str} -d --name {self.container_name} "
63
- f"-p 127.0.0.1:{self.port}:7200 "
63
+ f"-p {self.docker_bind}:{self.port}:7200 "
64
64
  f"-v {data_dir}:/opt/graphdb/home "
65
65
  f"{target_image}"
66
66
  )
@@ -48,7 +48,7 @@ class JenaConfig(ServerConfig):
48
48
  env = f"{env} -e ADMIN_PASSWORD={self.auth_password}"
49
49
  docker_run_command = (
50
50
  f"docker run {self.docker_user_flag} {env} -d --name {self.container_name} "
51
- f"-p {self.port}:3030 "
51
+ f"-p {self.docker_bind}:{self.port}:3030 "
52
52
  f"-v {data_dir}:/fuseki "
53
53
  f"{self.image}"
54
54
  )
@@ -62,8 +62,8 @@ class MillenniumDBConfig(ServerConfig):
62
62
 
63
63
  docker_run_command = (
64
64
  f"docker run -d --name {self.container_name} "
65
- f"-p {self.sparql_port}:1234 "
66
- f"-p {self.web_port}:4321 "
65
+ f"-p {self.docker_bind}:{self.sparql_port}:1234 "
66
+ f"-p {self.docker_bind}:{self.web_port}:4321 "
67
67
  f"-v {data_dir}:/data "
68
68
  f"{self.image} "
69
69
  f"mdb-server {db_path}"
@@ -47,7 +47,7 @@ class OxigraphConfig(ServerConfig):
47
47
  """
48
48
  docker_run_command = (
49
49
  f"docker run {self.docker_user_flag} -d --name {self.container_name} "
50
- f"-p {self.port}:7878 "
50
+ f"-p {self.docker_bind}:{self.port}:7878 "
51
51
  f"-v {data_dir}:/data "
52
52
  f"{self.image} serve --bind 0.0.0.0:7878 --location /data"
53
53
  )
@@ -62,7 +62,7 @@ class StardogConfig(ServerConfig):
62
62
  # 4. Construct Command using target_image
63
63
  docker_run_command = (
64
64
  f"docker run {self.docker_user_flag}{env_str} -d --name {self.container_name} "
65
- f"-p {self.port}:5820 "
65
+ f"-p {self.docker_bind}:{self.port}:5820 "
66
66
  f"-v {data_dir}:/var/opt/stardog "
67
67
  f"{target_image}"
68
68
  )
@@ -49,7 +49,7 @@ class VirtuosoConfig(ServerConfig):
49
49
  # run as root - no user flag
50
50
  docker_run_command = (
51
51
  f"docker run {env} -d --name {self.container_name} "
52
- f"-p {self.port}:8890 "
52
+ f"-p {self.docker_bind}:{self.port}:8890 "
53
53
  f"-v {data_dir}:/database "
54
54
  f"{self.image}"
55
55
  )
@@ -18,7 +18,7 @@ class Version:
18
18
  name = "omnigraph"
19
19
  version = omnigraph.__version__
20
20
  date = "2025-11-01"
21
- updated = "2026-02-28"
21
+ updated = "2026-03-15"
22
22
  description = "Unified Python interface for multiple graph databases"
23
23
 
24
24
  authors = "Wolfgang Fahl"
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+ # WF 2026-02-28
3
+ # Quick start script for GOV dataset
4
+ # see https://github.com/WolfgangFahl/pyomnigraph/issues/32
5
+
6
+ # Get the directory where this script is located
7
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+
9
+ # Call the general quickstart script with GOV-specific parameters
10
+ # GOV is a big external dataset, so use --download flag
11
+ exec "$SCRIPT_DIR/quickstart" --dataset gov_full --triplestore blazegraph --download "$@"
@@ -0,0 +1,210 @@
1
+ #!/bin/bash
2
+ # WF 2026-03-01
3
+ # Parameterized quick start script for RDF datasets
4
+ # see https://github.com/WolfgangFahl/pyomnigraph/issues/32
5
+
6
+ # Default values
7
+ DATASET="wikidata_triplestores"
8
+ TRIPLESTORE="blazegraph"
9
+ DOWNLOAD_URL="https://genwiki-farm.genealogy.net/downloads"
10
+ DO_DOWNLOAD="false"
11
+ OPEN_WEBUI="true"
12
+
13
+ # Source bash_messages with fallback
14
+ if ! type success &>/dev/null; then
15
+ BASH_MP="$HOME/source/bash/mp"
16
+ if [[ -f "$BASH_MP/bash_messages" ]]; then
17
+ source "$BASH_MP/bash_messages"
18
+ else
19
+ # Fallback implementations
20
+ error() { echo "✗ Error: $1" >&2; exit "${2:-1}"; }
21
+ success() { echo "✓ $1"; }
22
+ action() { echo "➜ $1"; }
23
+ warn() { echo "⚠ $1"; }
24
+ fi
25
+ fi
26
+
27
+
28
+ #
29
+ # usage - show help
30
+ #
31
+ usage() {
32
+ cat << EOF
33
+ usage: $0 [options]
34
+ --dataset <name> Dataset name (default: wikidata_triplestores)
35
+ --triplestore <name> Triple store to use (default: blazegraph)
36
+ --download Download dataset (for big external datasets)
37
+ --url <url> Download URL (default: auto-generated from dataset name)
38
+ --no-webui Don't open web UI after loading
39
+ -h|--help Show this help message
40
+
41
+ This script uses RDF dumps from ~/.omnigraph/rdf_dumps/<dataset>/
42
+ For creating dumps, use rdfdump, for example:
43
+ rdfdump -ds gov_full -4o --dump --limit 100000
44
+
45
+ The -4o flag uses the omnigraph default location.
46
+
47
+ See https://wiki.bitplan.com/index.php/Pyomnigraph#Quickstart for more info.
48
+
49
+ Examples:
50
+ $0
51
+ $0 --dataset gov_full --triplestore jena
52
+ $0 --dataset gov_full --download --url https://example.com/gov_full.tar.gz
53
+ EOF
54
+ exit 1
55
+ }
56
+
57
+ #
58
+ # download_dataset - download the dataset if not cached
59
+ # $1: l_tar_file - path to tar file
60
+ # $2: l_url - download URL
61
+ #
62
+ download_dataset() {
63
+ local l_tar_file="$1"
64
+ local l_url="$2"
65
+
66
+ if [[ ! -f "$l_tar_file" ]]; then
67
+ action "Downloading dataset from $l_url"
68
+ curl -L -o "$l_tar_file" "$l_url" || error "Download failed"
69
+ success "Download complete"
70
+ else
71
+ success "Using cached: $l_tar_file"
72
+ fi
73
+ }
74
+
75
+ #
76
+ # extract_dataset - extract dataset if not already extracted
77
+ # $1: l_download_dir - directory containing the tar file
78
+ # $2: l_tar_file - path to tar file
79
+ #
80
+ extract_dataset() {
81
+ local l_download_dir="$1"
82
+ local l_tar_file="$2"
83
+
84
+ # Check if extraction already happened (look for .ttl or .nt files)
85
+ if find "$l_download_dir" -maxdepth 1 -type f \( -name "*.ttl" -o -name "*.nt" -o -name "*.rdf" \) -print -quit | grep -q .; then
86
+ success "Already extracted"
87
+ else
88
+ action "Extracting $l_tar_file"
89
+ cd "$l_download_dir" || error "Cannot cd to $l_download_dir"
90
+ tar -xzf "$l_tar_file" || error "Extraction failed"
91
+ success "Extracted"
92
+ fi
93
+ }
94
+
95
+ #
96
+ # start_triplestore - start the triplestore
97
+ # $1: l_triplestore - name of triplestore
98
+ #
99
+ start_triplestore() {
100
+ local l_triplestore="$1"
101
+ action "Starting $l_triplestore"
102
+ omnigraph -s "$l_triplestore" --cmd start || error "Failed to start $l_triplestore"
103
+ }
104
+
105
+ #
106
+ # load_dataset - load dataset into triplestore
107
+ # $1: l_triplestore - name of triplestore
108
+ # $2: l_dataset - dataset name
109
+ #
110
+ load_dataset() {
111
+ local l_triplestore="$1"
112
+ local l_dataset="$2"
113
+ action "Loading $l_dataset dataset into $l_triplestore"
114
+ omnigraph -s "$l_triplestore" --cmd load --datasets "$l_dataset" || error "Failed to load dataset"
115
+ }
116
+
117
+ #
118
+ # open_webui - open the web UI
119
+ # $1: l_triplestore - name of triplestore
120
+ #
121
+ open_webui() {
122
+ local l_triplestore="$1"
123
+ success "Done! Opening web UI"
124
+ omnigraph -s "$l_triplestore" --cmd webui
125
+ }
126
+
127
+ #
128
+ # run_quickstart - main quickstart workflow
129
+ # $1: l_dataset - dataset name
130
+ # $2: l_triplestore - triplestore name
131
+ # $3: l_do_download - whether to download (true/false)
132
+ # $4: l_download_url_base - base download URL
133
+ # $5: l_open_webui - whether to open webui (true/false)
134
+ #
135
+ run_quickstart() {
136
+ local l_dataset="$1"
137
+ local l_triplestore="$2"
138
+ local l_do_download="$3"
139
+ local l_download_url_base="$4"
140
+ local l_open_webui="$5"
141
+
142
+ local l_download_dir="${HOME}/.omnigraph/rdf_dumps/$l_dataset"
143
+
144
+ action "Dataset: $l_dataset"
145
+ action "Triple store: $l_triplestore"
146
+
147
+ # Only download and extract if --download flag is set
148
+ if [[ "$l_do_download" == "true" ]]; then
149
+ # Calculate full download URL from base URL and dataset name
150
+ local l_full_url="${l_download_url_base}/${l_dataset}.tar.gz"
151
+ local l_tar_file="${l_download_dir}/${l_dataset}.tar.gz"
152
+ mkdir -p "$l_download_dir" || error "Cannot create directory $l_download_dir"
153
+ download_dataset "$l_tar_file" "$l_full_url"
154
+ extract_dataset "$l_download_dir" "$l_tar_file"
155
+ else
156
+ # Verify RDF dumps exist
157
+ if [[ ! -d "$l_download_dir" ]]; then
158
+ error "RDF dump directory not found: $l_download_dir
159
+ Use rdfdump to create dumps, e.g.:
160
+ rdfdump -ds $l_dataset -4o --dump --limit 100000
161
+ Or use --download flag for external datasets"
162
+ fi
163
+ fi
164
+
165
+ start_triplestore "$l_triplestore"
166
+ load_dataset "$l_triplestore" "$l_dataset"
167
+
168
+ if [[ "$l_open_webui" == "true" ]]; then
169
+ open_webui "$l_triplestore"
170
+ else
171
+ success "Done!"
172
+ fi
173
+ }
174
+
175
+ # Main loop
176
+ case $# in
177
+ *)
178
+ while [[ "$1" != "" ]]; do
179
+ case "$1" in
180
+ -h|--help)
181
+ usage
182
+ ;;
183
+ --dataset)
184
+ DATASET="$2"
185
+ shift
186
+ ;;
187
+ --triplestore)
188
+ TRIPLESTORE="$2"
189
+ shift
190
+ ;;
191
+ --download)
192
+ DO_DOWNLOAD="true"
193
+ ;;
194
+ --url)
195
+ DOWNLOAD_URL="$2"
196
+ shift
197
+ ;;
198
+ --no-webui)
199
+ OPEN_WEBUI="false"
200
+ ;;
201
+ *)
202
+ error "Unknown option: $1" 1
203
+ ;;
204
+ esac
205
+ shift
206
+ done
207
+
208
+ run_quickstart "$DATASET" "$TRIPLESTORE" "$DO_DOWNLOAD" "$DOWNLOAD_URL" "$OPEN_WEBUI"
209
+ ;;
210
+ esac
@@ -4,10 +4,14 @@ Created on 2025-06-04
4
4
  @author: wf
5
5
  """
6
6
 
7
+ from pathlib import Path
8
+
7
9
  from lodstorage.prefix_config import PrefixConfigs
8
10
 
9
11
  from omnigraph.ominigraph_paths import OmnigraphPaths
12
+ from omnigraph.omnigraph_cmd import OmnigraphCmd
10
13
  from omnigraph.omniserver import OmniServer
14
+ from omnigraph.rdf_dataset import RdfDatasets
11
15
  from omnigraph.server_config import ServerEnv
12
16
  from omnigraph.sparql_server import SparqlServer
13
17
  from tests.basetest import Basetest
@@ -133,3 +137,53 @@ class TestOmniServer(Basetest):
133
137
  self.assertTrue(server.config.container_name.endswith("-test"))
134
138
  expected_test_dir = self.ogp.omnigraph_dir / "test" / server.name / "data"
135
139
  self.assertEqual(server.config.base_data_dir, expected_test_dir)
140
+
141
+ def test_configure_dumps_dir_with_local_file(self):
142
+ """
143
+ Test configuring dumps directory with local rdf_file in dataset.
144
+ """
145
+ test_dataset_yaml = "/tmp/omnigraph_test/farm_dataset.yaml"
146
+ test_rdf_file = "/tmp/omnigraph_test/apache_configs.ttl"
147
+
148
+ # Skip if test files don't exist
149
+ if not Path(test_dataset_yaml).exists():
150
+ self.skipTest(f"Test dataset YAML not found: {test_dataset_yaml}")
151
+ if not Path(test_rdf_file).exists():
152
+ self.skipTest(f"Test RDF file not found: {test_rdf_file}")
153
+
154
+ # Load datasets
155
+ datasets = RdfDatasets.ofYaml(test_dataset_yaml)
156
+ self.assertIn("apache_configs", datasets.datasets)
157
+ dataset = datasets.datasets["apache_configs"]
158
+
159
+ # Verify dataset has rdf_file
160
+ self.assertEqual(dataset.rdf_file, test_rdf_file)
161
+
162
+ # Create an OmnigraphCmd instance to test configure_dumps_dir
163
+ cmd = OmnigraphCmd()
164
+
165
+ # Load servers configuration
166
+ if not self.servers_yaml_path.exists():
167
+ self.skipTest(f"Server config file not found: {self.servers_yaml_path}")
168
+
169
+ servers_dict = self.omni_server.servers(self.servers_yaml_path, filter_active=False)
170
+
171
+ # Get a test server (use jena since that's what the dataset specifies)
172
+ if "jena" not in servers_dict:
173
+ self.skipTest("Jena server not found in configuration")
174
+
175
+ server = servers_dict["jena"]
176
+
177
+ # Test configure_dumps_dir with local file dataset
178
+ cmd.configure_dumps_dir(server, dataset)
179
+
180
+ # Verify dumps_dir is set to the parent directory of the rdf_file
181
+ expected_dumps_dir = Path(test_rdf_file).expanduser().resolve().parent
182
+ actual_dumps_dir = Path(server.config.dumps_dir)
183
+
184
+ if self.debug:
185
+ print(f"Dataset rdf_file: {dataset.rdf_file}")
186
+ print(f"Expected dumps_dir: {expected_dumps_dir}")
187
+ print(f"Actual dumps_dir: {actual_dumps_dir}")
188
+
189
+ self.assertEqual(actual_dumps_dir, expected_dumps_dir)
@@ -5,9 +5,10 @@ Created on 2025-05-26
5
5
  """
6
6
 
7
7
  from argparse import Namespace
8
+ from pathlib import Path
8
9
 
9
10
  from omnigraph.ominigraph_paths import OmnigraphPaths
10
- from omnigraph.rdf_dataset import RdfDatasets
11
+ from omnigraph.rdf_dataset import RdfDataset, RdfDatasets
11
12
  from omnigraph.rdfdump import RdfDumpDownloader
12
13
  from tests.basetest import Basetest
13
14
 
@@ -39,6 +40,16 @@ class TestRdfDumpDownloader(Basetest):
39
40
  }
40
41
  self.assertIsNotNone(self.datasets)
41
42
  for name, dataset in self.datasets.datasets.items():
43
+ # Skip inactive datasets
44
+ if not dataset.active:
45
+ if self.debug:
46
+ print(f"Skipping inactive dataset: {name}")
47
+ continue
48
+ # Skip gov endpoints in public CI (not publicly accessible yet)
49
+ if self.inPublicCI() and name.startswith("gov"):
50
+ if self.debug:
51
+ print(f"Skipping {name} in public CI")
52
+ continue
42
53
  database = databases.get(name)
43
54
  tryit_url = dataset.getTryItUrl(database)
44
55
  if self.debug:
@@ -88,3 +99,42 @@ class TestRdfDumpDownloader(Basetest):
88
99
  print(f" Downloaded {chunks} chunks for {name}")
89
100
 
90
101
  self.assertGreater(chunks, 0)
102
+
103
+ def test_local_rdf_file_dataset(self):
104
+ """
105
+ Test loading dataset configuration with local rdf_file.
106
+ """
107
+ # Create a temporary test dataset YAML with local file
108
+ test_yaml_path = "/tmp/omnigraph_test/test_dataset.yaml"
109
+ test_rdf_file = "/tmp/omnigraph_test/test_data.ttl"
110
+
111
+ # Verify test files exist
112
+ if not Path(test_yaml_path).exists():
113
+ self.skipTest(f"Test dataset YAML not found: {test_yaml_path}")
114
+ if not Path(test_rdf_file).exists():
115
+ self.skipTest(f"Test RDF file not found: {test_rdf_file}")
116
+
117
+ # Load datasets from YAML
118
+ datasets = RdfDatasets.ofYaml(test_yaml_path)
119
+ self.assertIsNotNone(datasets)
120
+ self.assertIn("test_local", datasets.datasets)
121
+
122
+ dataset = datasets.datasets["test_local"]
123
+ self.assertIsInstance(dataset, RdfDataset)
124
+ self.assertEqual(dataset.name, "Test Local RDF File")
125
+ self.assertEqual(dataset.rdf_file, test_rdf_file)
126
+ self.assertIsNone(dataset.endpoint_url, "endpoint_url should be None for local file datasets")
127
+ self.assertIsNone(dataset.sparql, "sparql should be None for local file datasets")
128
+
129
+ if self.debug:
130
+ print(f"Dataset: {dataset.name}")
131
+ print(f"RDF file: {dataset.rdf_file}")
132
+ print(f"Database: {dataset.database}")
133
+
134
+ # Verify file path expansion works
135
+ expanded_path = Path(dataset.rdf_file).expanduser().resolve()
136
+ self.assertTrue(expanded_path.exists(), f"RDF file should exist: {expanded_path}")
137
+
138
+ if self.debug:
139
+ print(f"Expanded path: {expanded_path}")
140
+ print(f"File parent: {expanded_path.parent}")
@@ -1 +0,0 @@
1
- __version__ = "0.2.0"
@@ -1,35 +0,0 @@
1
- #!/bin/bash
2
- # WF 2026-02-28
3
- # Build the free Stardog Docker image from zazuko/stardog-docker
4
-
5
- repo_url="https://github.com/zazuko/stardog-docker"
6
- image_name="stardog-docker:local"
7
-
8
- # Check if Docker is available
9
- if ! command -v docker &> /dev/null; then
10
- echo "Docker not available, skipping Stardog build"
11
- exit 0
12
- fi
13
-
14
- # Check if image already exists
15
- if docker images -q "$image_name" 2>/dev/null | grep -q .; then
16
- echo "✅ Image $image_name already exists"
17
- exit 0
18
- fi
19
-
20
- # Check for existing clone in order of preference
21
- if [ -d "$HOME/source/docker/stardog-docker" ]; then
22
- build_dir="$HOME/source/docker/stardog-docker"
23
- echo "Using existing clone at $build_dir"
24
- elif [ -d "/tmp/stardog-docker" ]; then
25
- build_dir="/tmp/stardog-docker"
26
- echo "Using existing clone at $build_dir"
27
- else
28
- build_dir="/tmp/stardog-docker"
29
- echo "Cloning $repo_url to $build_dir..."
30
- git clone "$repo_url" "$build_dir" || exit 1
31
- fi
32
-
33
- echo "Building $image_name from $build_dir..."
34
- cd "$build_dir" && docker build -t "$image_name" . || exit 1
35
- echo "✅ Built $image_name"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes