On this page:
prefixed-name-separator
prefixed-name-string?
prefixed-name
make-prefixed-name
string->prefixed-name
prefixed-name->string
prefixed-name->nsname
prefixed-name->url
nsname->prefixed-name
namespace+  name->prefixed-name

4.2 Prefixed Names🔗ℹ

A prefixed-name comprises a name and corresponding prefix, commonly noted as a tuple (prefix, local-name).

The colon character used to separate the prefix and local name parts of a prefixed name.

predicate

(prefixed-name-string? v)  boolean?

  v : any/c
Returns #t if v is a string, and that string is a prefixed name according to the SPARQL production PrefixedName.

struct

(struct prefixed-name (prefix name))

  prefix : (or/c prefix-name? #f)
  name : local-name?
The prefix and local-name pair.

constructor

(make-prefixed-name prefix name)  prefixed-name?

  prefix : (or/c prefix-string? prefix-name?)
  name : (or/c local-name-string? local-name?)
TBD

Examples:
> (prefixed-name->string
   (make-prefixed-name (string->prefix "rdf:") "Hello"))

"rdf:Hello"

> (prefixed-name->string
   (make-prefixed-name ":" "Hello"))

":Hello"

> (prefixed-name->string
   (make-prefixed-name (empty-prefix) "Hello"))

":Hello"

TBD

TBD

procedure

(prefixed-name->nsname name nsmap)  (or/c nsname? #f)

  name : prefixed-name?
  nsmap : nsmap?

procedure

(prefixed-name->url name nsmap)  (or/c url-absolute? #f)

  name : prefixed-name?
  nsmap : nsmap?

procedure

(nsname->prefixed-name name map)  prefixed-name?

  name : nsname?
  map : nsmap?

procedure

(namespace+name->prefixed-name ns name map)  prefixed-name?

  ns : namespace?
  name : local-name-string?
  map : nsmap?
Returns a new prefixed-name if ns is in map, else #f.

Example:
> (let ((map (make-common-nsmap)))
    (prefixed-name->string
     (namespace+name->prefixed-name
      (string->namespace "http://purl.org/dc/terms/")
      (string->local-name "description")
      map)))

"dcterms:description"