Skip to content

Zero-sized name table is allowed for a producer #86

@adanilenka

Description

@adanilenka

Currently, rdf to-jelly allows for passing 0 for opt.max-name-table-size, leading to generating an invalid .jelly file

Query used:
jelly-cli rdf to-jelly ./in_001.nt --to ./out.jelly --opt.generalized-statements=false --opt.rdf-star=false --opt.max-name-table-size=0 --opt.max-prefix-table-size=0 --opt.max-datatype-table-size=0

Input triples:
http://example.org/resource/r1 http://example.org/property/p1 http://example.org/resource/r2 .
http://example.org/resource/r2 http://example.org/property/p2 "Label" .

Resulting jelly-text (top rows):

# Frame 0
rows {
  options {
    stream_name: ""
    physical_type: PHYSICAL_STREAM_TYPE_TRIPLES
    generalized_statements: false
    rdf_star: false
    max_name_table_size: 0
    max_prefix_table_size: 0
    max_datatype_table_size: 0
    logical_type: LOGICAL_STREAM_TYPE_FLAT_TRIPLES
    version: 1
  }
}
rows {
  name {
    id: 0
    value: "http://example.org/resource/r1"
  }
}
rows {
  name {
    id: 0
    value: "http://example.org/property/p1"
  }
}
rows {
  name {
    id: 0
    value: "http://example.org/resource/r2"
  }
}
rows {
  triple {
    s_iri {
      prefix_id: 0
      name_id: 0
    }
    p_iri {
      prefix_id: 0
      name_id: 0
    }
    o_iri {
      prefix_id: 0
      name_id: 0
    }
  }
}
...

No error is produced in the process.

But if try to decode the resulting file with jelly-cli rdf from-jelly ./out.jelly
The error appears:

Image

When passing opt.max-name-table-size = -1, with jelly-cli rdf to-jelly ./in.nt --to ./out.jelly --opt.generalized-statements=false --opt.rdf-star=false --opt.max-name-table-size=-1 --opt.max-prefix-table-size=0 --opt.max-datatype-table-size=0 --debug

Such an error appears:

Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions