Skip to content

Java utility library to translate CURIEs to IRIs and vice-versa.

License

Notifications You must be signed in to change notification settings

prefixcommons/curie-util

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Maven Central Javadoc

curie-util

Java utility library to translate CURIEs to IRIs and vice-versa.

Usage

Add the dependency:

<dependency>
    <groupId>org.prefixcommons</groupId>
    <artifactId>curie-util</artifactId>
    <version>0.0.2</version>
</dependency

Create the CurieUtil object

From a java map object:

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);

From a json-ld file:

CurieUtil curieUtil = CurieUtil.fromJsonLdFile("path/to/file");

Translates CURIEs and IRIs

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();

About

Java utility library to translate CURIEs to IRIs and vice-versa.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages