URL Functions & Operators

These functions apply to MonetDB SQL type: URL (Uniform Resource Locator). A URL string has a specific syntax, see URL syntax for valid URL string patterns.

For the examples below we use following url_example string: 'https://me@www.monetdb.org:458/Doc/Abc.html?lang=nl&sort=asc#example' to create the shown results.

Note: You must include the sys. prefix for all these URL functions (see examples) in order to work properly from other schemas than sys.

FunctionReturn typeDescriptionExampleResult
sys.getanchor(url)clobextract the anchor part (after the #) from the url, may return null if no achor existssys.getanchor(url_example)example
sys.getbasename(url)clobextract the base name part (after the / excluding the extension) from the path of the url, may return nullsys.getbasename(url_example)Abc
sys.getcontext(url)clobextract the path context part of the urlsys.getcontext(url_example)/Doc/Abc.html
sys.getdomain(url)clobextract the top-level domain part of the host part of the url, may return nullsys.getdomain(url_example)org
sys.getextension(url)clobextract the file extension part of the url, may return nullsys.getextension(url_example)html
sys.getfile(url)clobextract the last file part of the path of the url, may return nullsys.getfile(url_example)Abc.html
sys.gethost(url)clobextract the host part of the url, may return nullsys.gethost(url_example)www.monetdb.org
sys.getport(url)clobextract the port number part of the url, may return nullsys.getport(url_example)458
sys.getprotocol(url)clobextract the protocol or scheme part of the urlsys.getprotocol(url_example)https
sys.getquery(url)clobextract the query part (after the ?) of the url, may return nullsys.getquery(url_example)lang=nl&sort=asc
sys.getroboturl(url)clobextract the location of the robot control file of the urlsys.getroboturl(url_example)https://me@www.monetdb.org:458/robots.txt
sys.getuser(url)clobextract the user part of the url, may return nullsys.getuser(url_example)me
sys.isaurl(string)booleanchecks whether a character string complies to the url syntax formatsys.isaurl(url_example)true
sys.newurl(scheme, authority, path)urlcreate a new url from three strings: scheme, authority or host and pathsys.newurl('https', 'usr@www.a.com:123', 'docs/index.html')https://usr@www.a.com:123/docs/index.html
sys.newurl(scheme, host, int port, path)urlcreate a new url from three strings and a port number as third argumentsys.newurl('https', 'www.a.com', 5567, 'docs/index.html')https://www.a.com:5567/docs/index.html