knowsys / knowsys/nemo

Exporting a right-recursive predicate panics with `rowscan.rs:83` index out of bounds (v0.10.1 and main)

Open
#808 0 comments 0 reactions 1 assignee Claimed by @mmarx View on GitHub
Dominant language
Rust
Stars
289
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Exporting the results of a right-recursive rule over RDF imported data panics. The reasoning seems to be correct. With exports disabled I get the correct result. The closure is computed but lost in the export.

Here is minimal example:

*data.nt*

```
.
.
```

*rules.rls*

```
@import triple :- ntriples{resource = "data.nt"} .

par(?X, ?Y) :- triple(?X, , ?Y) .

tc(?X, ?Y) :- par(?X, ?Y) .
tc(?X, ?Y) :- par(?X, ?Z), tc(?Z, ?Y) .

@export tc :- csv{resource = "tc.csv"} .
```

Running the example:

```console
$ nmo repro.rls --export-dir /tmp/out -o --report none
thread 'main' panicked at nemo-physical/src/tabular/rowscan.rs:83:27:
index out of bounds: the len is 2 but the index is 2
$ echo $?
101
$ ls /tmp/out
(empty)
```

Running without export:

```console
$ nmo repro.rls -e none --print-facts idb --report none
tc(, ).
tc(, ).
tc(, ).
$ echo $?
0
```

My environment:

- Ubuntu 24.04.4 LTS, kernel 7.0.0-29-generic, x86_64 (AMD Ryzen 3 PRO 5450U).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.