INCATools / INCATools/ontology-access-kit

`search` should create an empty file when no triples are found

Open
#460 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
198
Forks
35
Avg merge
3d 4h
Merged PRs (30d)
1

Description

We had a long-standing issue in a pipeline where we are using OAK search (`runoak -i wikidata: search -O rdf --output out.txt`), and everything kept working for months, while the pipeline was broken (for a reason unrelated to oak, the search terms where malformed). The problem was that the `search`, when it does not find anything, does not produce any output. So basically, the pipeline kept using the old output (`out.txt`), because it was never overwritten, which meant we only noticed the error months later when a new user tried running the pipeline.

Can I suggest that `search` creates an empty file when it "does to find anything" to prevent such errors in the future?

cc @sabrinatoro (FYI)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the `runoak -i wikidata: search -O rdf --output out.txt` command with search terms that return no triples. Trace the `search` CLI entry point and its `--output` handling, then verify that a no-result run creates or truncates `out.txt` and does not retain stale content.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.