Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default prefix manager in prefix ontology format objects cannot be overriden #9

Closed
ansell opened this issue May 27, 2013 · 2 comments
Closed
Assignees

Comments

@ansell
Copy link
Member

ansell commented May 27, 2013

The prefix mapper current has an inbuilt Comparator attached to a TreeMap that at least one user would like to override to change to return the prefixes in a different order.

Is there any code that depends on the iterator for the TreeMap returning the prefixes in string-length order rather than plain lexical ordering? For example, does anything iterate through to find the longest match and relies on the current Comparator implementation.

If there isn't it shouldn't be too difficult to expose the ability to set the prefix manager.

@ignazio1977
Copy link
Contributor

There might be code which relies on the best match, but I reckon that code is fragile and broken: fragile because a change in the namespaces available would cause changes in the output, and broken because the namespace match should be exact.
By that I mean, take this example:
http://test.com/ontology/onto.owl#testNamespace

It could be broken as:
ns:
http://test.com/ontology/onto.owl#test

fragment:
Namespace

so that the short form is ns:Namespace

I don't think this is correct, because it is arbitrary in picking the split point and cannot be roundtripped easily - so there should be no dependency on this behaviour.

In this case what's necessary is the ability to set the comparator for the DefaultPrefixManager, which cannot currently be injected. Optionally, a few more dependencies could be made less set in stone.

@ghost ghost assigned ignazio1977 May 27, 2013
@ignazio1977
Copy link
Contributor

I have changed the classes to enable choosing the prefix manager and to choose the sorting; however I don't think this enables an arbitrary sorting of the prefixes, as many storers and renderers are creating DefaultPrefixManagers themselves. At a guess, that code needs redesign, as most of what's going on appears redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants