Class DefaultIRIDecoder

  • All Implemented Interfaces:
    IRIDecoder
    Direct Known Subclasses:
    RDFIRIDecoder

    public class DefaultIRIDecoder
    extends Object
    implements IRIDecoder
    A default implementation of IRI decoder.
    Author:
    burgetr
    • Constructor Detail

      • DefaultIRIDecoder

        public DefaultIRIDecoder()
    • Method Detail

      • initPrefixes

        protected void initPrefixes()
      • addPrefix

        public void addPrefix​(String prefix,
                              String uri)
        Adds a new prefix to be used.
        Parameters:
        prefix - the prefix string
        uri - the corresponding IRI prefix
      • getUriPrefixes

        public Map<String,​String> getUriPrefixes()
        Gets a map that assigns prefix names to uris.
        Returns:
        the map
      • declarePrefixes

        public String declarePrefixes()
        Gets the prefix declaration string (e.g. for SPARQL) containing the currenly defined prefixes.
        Specified by:
        declarePrefixes in interface IRIDecoder
        Returns:
        the prefix declaration string
      • encodeIri

        public String encodeIri​(org.eclipse.rdf4j.model.IRI iri)
        Converts an IRI to a prefixed string.
        Specified by:
        encodeIri in interface IRIDecoder
        Parameters:
        iri -
        Returns: