Package org.incenp.obofoundry.kgcl
Interface ILabelResolver
-
- All Known Implementing Classes:
OntologyBasedLabelResolver,SimpleLabelResolver
public interface ILabelResolverAn object that can resolve labels into proper entity identifiers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(String label, String identifier)Registers a new label-to-identifier mapping.StringgetNewId(String label)Mints a new identifier for the given label.Stringresolve(String label)Finds the identifier corresponding to the given label.
-
-
-
Method Detail
-
resolve
String resolve(String label)
Finds the identifier corresponding to the given label.- Parameters:
label- The label to resolve.- Returns:
- The identifier of the entity with the given label, or
nullif the label could not be resolved.
-
add
void add(String label, String identifier)
Registers a new label-to-identifier mapping.- Parameters:
label- The label to register.identifier- Its corresponding identifier.
-
getNewId
String getNewId(String label)
Mints a new identifier for the given label.This method is used when a KGCL “create” instruction does not include an identifier for the node to be created (e.g.,
create class 'my new class'). It shall return a new identifier for the node to be created.Any subsequent call to
resolve(String)with the same label shall return the same identifier.- Parameters:
label- The label for which an identifier is requested.- Returns:
- The newly minted identifier.
-
-