You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current constructor is not informative about what it actually expects in the map. Just two strings? What should they contain? What is the expected key and value? What happens when they don't conform to the required format?
CurieUtil curieUtil = new CurieUtil(new HashMap<String, String>());
It might be easier to figure out with a couple of new types - CuriePrefix and CurieIri. These are basically wrapped strings, but ought to do some format checking when used. e.g.
CurieMappinghpMapping = CurieMapping.of("HP", "http://purl.obolibrary.org/obo/HP_");
//or maybe use a builder to avoid getting the strings the wrong way round at the expense of added verbosityCuriehpCurie = Curie.builder().prefix("HP").iri("http://purl.obolibrary.org/obo/HP_").build();
//then add these to the CurieUtil.CurieUtilcurieUtil = CurieUtil.just(hpMapping);
the prefix can then be checked that it doesn't contain any illegal characters, the IRI should be properly formed etc... This will save people headaches down the line when things start failing oddly due to incorrect mappings as happens in owlsim3. Sure currently it's disarmingly simple, but I think you're missing out on the benefits of type safety.
The text was updated successfully, but these errors were encountered:
I'm curious about the actual checks that you'll do to check if a CURIE is valid. I didn't find any formal way to identify a string as a CURIE or an IRI.
The current constructor is not informative about what it actually expects in the map. Just two strings? What should they contain? What is the expected key and value? What happens when they don't conform to the required format?
It might be easier to figure out with a couple of new types -
CuriePrefix
andCurieIri
. These are basically wrapped strings, but ought to do some format checking when used. e.g.or maybe less verbose would be:
the prefix can then be checked that it doesn't contain any illegal characters, the IRI should be properly formed etc... This will save people headaches down the line when things start failing oddly due to incorrect mappings as happens in owlsim3. Sure currently it's disarmingly simple, but I think you're missing out on the benefits of type safety.
The text was updated successfully, but these errors were encountered: