Class SimpleLabelResolver

    • Constructor Detail

      • SimpleLabelResolver

        public SimpleLabelResolver()
    • Method Detail

      • resolve

        public String resolve​(String label)
        Description copied from interface: ILabelResolver
        Finds the identifier corresponding to the given label.
        Specified by:
        resolve in interface ILabelResolver
        Parameters:
        label - The label to resolve.
        Returns:
        The identifier of the entity with the given label, or null if the label could not be resolved.
      • getNewId

        public String getNewId​(String label)
        Description copied from interface: ILabelResolver
        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 ILabelResolver.resolve(String) with the same label shall return the same identifier.

        Specified by:
        getNewId in interface ILabelResolver
        Parameters:
        label - The label for which an identifier is requested.
        Returns:
        The newly minted identifier.
      • add

        public void add​(String label,
                        String identifier)
        Description copied from interface: ILabelResolver
        Registers a new label-to-identifier mapping.
        Specified by:
        add in interface ILabelResolver
        Parameters:
        label - The label to register.
        identifier - Its corresponding identifier.