(absolute? iri)
A very basic check if an IRI is absolute. NB: A false result does not imply that it is a valid relative IRI.
A very basic check if an IRI is absolute. NB: A false result does not imply that it is a valid relative IRI.
(add-trailing-slash partial-iri)
In certain circumstances we want context partial IRIs to end in either a '/' or '#'. If it ends in neither, we assume it was meant to end in '/' and add it to the end.
i.e. if provided https://schema.org, we'll change it to https://schema.org/
In certain circumstances we want context partial IRIs to end in either a '/' or '#'. If it ends in neither, we assume it was meant to end in '/' and add it to the end. i.e. if provided https://schema.org, we'll change it to https://schema.org/
(any-iri? x)
Returns true if string has a colon, indicating it is either a compact iri or full iri.
Only to be used when a quick test is needed, not a thorough test.
Returns true if string has a colon, indicating it is either a compact iri or full iri. Only to be used when a quick test is needed, not a thorough test.
(join base ri)
Returns an IRI string for relative IRI ri
relative to absolute base
IRI.
Makes no attempt to correct trailing / leading character errors, so make sure
base
ends in / or # and ri
begins with neither.
Returns an IRI string for relative IRI `ri` relative to absolute `base` IRI. Makes no attempt to correct trailing / leading character errors, so make sure `base` ends in / or # and `ri` begins with neither.
(parse-compact-iri x)
Returns 3-tuple of [original-iri prefix suffix] if string looks like a compact IRI (i.e. xsd:string or schema:name), else nil.
Compact IRI must have only one colon (:) and no have a slash before or immediately after the colon which ensures it isn't a URL (i.e. https://schema.org).
Returns 3-tuple of [original-iri prefix suffix] if string looks like a compact IRI (i.e. xsd:string or schema:name), else nil. Compact IRI must have only one colon (:) and no have a slash before or immediately after the colon which ensures it isn't a URL (i.e. https://schema.org).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close