Java utility library to translate CURIEs to IRIs and vice-versa.
Add the dependency:
<dependency>
<groupId>org.prefixcommons</groupId>
<artifactId>curie-util</artifactId>
<version>0.0.2</version>
</dependency
Map<String, String> map = new HashMap<>();
map.put("", "http://x.org/");
map.put("A", "http://x.org/a_");
map.put("B", "http://x.org/B_");
map.put("CC", "http://x.org/C_C");
map.put("C", "http://x.org/C_");
CurieUtil curieUtil = new CurieUtil(map);
CurieUtil curieUtil = CurieUtil.fromJsonLdFile("path/to/file");
Both methods will return an Option:
curieUtil.getCurie("http://x.org/a_foo"); // Optional.of("A:foo")
curieUtil.getIri("A:foo"); // Optional.of("http://x.org/a_foo")
curieUtil.getCurie("none"); // Optional.absent();