Skip to content

Commit c12625d

Browse files
committed
Install rdftab.
To generate SemSQL release artefacts, we need the Rdftab tool, which must be installed in a native ODK environment.
1 parent 432e5d3 commit c12625d

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ the PATH. The various tools used by ODK workflows are:
5858
(required for projects using SSSOM mappings),
5959
* [DOSDP-Tools](https://github.com/INCATools/dosdp-tools) (required for
6060
projects using DOSDP patterns),
61-
* [SQLite3](https://www.sqlite.org/) and
61+
* [SQLite3](https://www.sqlite.org/),
62+
[Rdftab](https://github.com/ontodev/rdftab.rs), and
6263
[Relation-Graph](https://github.com/INCATools/relation-graph)
6364
(required for exporting release artefacts to [SemSQL
6465
format](https://incatools.github.io/semantic-sql/), if desired),

src/incatools/odk/setup.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,35 @@ def install(self, target: ODKEnvironment) -> None:
261261
dstfile.chmod(0o755)
262262

263263

264+
class RdftabTool(Tool):
265+
"""Jim Balhoff's RDFTab tool."""
266+
267+
def __init__(self):
268+
Tool.__init__(
269+
self,
270+
"rdftab",
271+
"https://github.com/ontodev/rdftab.rs/releases/download/v0.1.1/rdftab-",
272+
)
273+
274+
def install(self, target: ODKEnvironment) -> None:
275+
if target.system == "Linux" and target.machine == "x86_64":
276+
self.source = self.source + "x86_64-unknown-linux-musl"
277+
elif target.system == "Darwin" and target.machine == "x86_64":
278+
self.source = self.source + "x86_64-apple-darwin"
279+
elif target.system == "Darwin" and target.machine == "arm64":
280+
# Jim does not provide a pre-built binary for arm64 macOS,
281+
# so we use our own
282+
self.source = "https://incenp.org/files/softs/rdftab/0.1/rdftab-0.1.1-aarch64-apple-darwin"
283+
else:
284+
raise Exception(
285+
f"Unsupported system/machine {target.system}/{target.machine}"
286+
)
287+
288+
dstfile = self.get_final_location(target)
289+
self.download(dstfile)
290+
dstfile.chmod(0o755)
291+
292+
264293
class RobotPlugin(DownloadableFile):
265294
"""A file that is a plugin for ROBOT."""
266295

@@ -340,6 +369,7 @@ def __init__(self, target: Union[Path, str]):
340369
),
341370
SqliteTool("3.51.1"),
342371
GithubTool("2.83.1"),
372+
RdftabTool(),
343373
RobotPlugin("odk", ODK_PLUGIN_SOURCE),
344374
RobotPlugin("sssom", SSSOM_PLUGIN_SOURCE),
345375
ResourceFile("obo.epm.json", OBO_EPM_SOURCE),

0 commit comments

Comments
 (0)