Skip to content

Recognize the .ttl file extension as RDF Turtle - #343

Merged
goneall merged 1 commit into
spdx:masterfrom
tommyquak:recognize-ttl-extension
Nov 27, 2026
Merged

goneall merged 1 commit into
spdx:masterfrom
tommyquak:recognize-ttl-extension

Conversation

@tommyquak

Copy link
Copy Markdown
Contributor

Fixes #252.

Convert only picks RDF Turtle from the rdf.ttl suffix, so spdx Convert doc.spdx doc.ttl fails with "does not end with a valid SPDX file extension" unless TAG RDFTTL is given. This maps ttl to RDFTTL in SpdxToolsHelper, the same way rdf already maps to RDFXML (so .rdf from the issue already works).

I added testTagToTtl, which converts the tag-value example to a .ttl file without giving the file types and compares the result with the source. It failed with the message above before the change.

Tested with mvn verify on Java 17, and with the built jar: Convert SPDXTagExample-v2.3.spdx out.ttl writes Turtle and Verify out.ttl reports it as valid.

Convert only recognized the RDFTTL type from the rdf.ttl suffix, so a
plain .ttl output file failed with "does not end with a valid SPDX file
extension" unless the file types were given on the command line.

Map the ttl extension to RDFTTL, as rdf already maps to RDFXML.

Issue 252.

Signed-off-by: Tommy Quak <tommy@u.nus.edu>
@bact bact added the enhancement New feature or request label Nov 27, 2026

@goneall goneall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Thanks @tommyquak

@goneall
goneall merged commit 9ee8125 into spdx:master Nov 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

recognize extension .ttl (and .rdf)

3 participants