Fix/duplicate namespace declarations #471
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is to fix an annoying problem with duplicate main-ontology namespaces appearing. For example, simply run against this Turtle to see the problem:
This results in Widoco generating:
Table 1: Namespaces used in the document
:I would have added a simple regression test (using the Turtle I provided above), but I don't see any unit tests beyond the basic
test/widoco/CreateDocInThreadTest.java
file. There are very few tests in there, and I can't easily see how I'd assert on the correct behaviour, i.e., to assert that only the correct namespaces are listed in the generated output. Perhaps you could add such a test, at least as an initial example for others contributing to this codebase.(This PR also introduces a blank line between the main ontology's namespace and the rest, just 'cos that's the most important namespace, and the blank line makes it stand out more - but feel free remove that if you prefer!)