org.eclipse.rdf4j.model.util

## Class Namespaces

- java.lang.Object
- - org.eclipse.rdf4j.model.util.Namespaces

-     public class Namespaces
      extends Object

  A utility class to perform operations on `Namespace`s.
  Author:
    Peter Ansell

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Set<Namespace>` | `DEFAULT_RDF4J` RDFa initial namespaces + additional set of prefixes for RDF4J
    `static Set<Namespace>` | `DEFAULT_RDFA11` Set of RDFa 1.1 "initial context" namespaces

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Map<String,String>` | `asMap(Set<Namespace> namespaces)` Converts a set of `Namespace`s into a map containing the `Namespace.getPrefix()` strings as keys, with the `Namespace.getName()` strings as values in the map for each namespace in the given set.
    `static Map<String,String>` | `wrap(Set<Namespace> namespaces)` Wraps the given `Set` of `Namespace`s as a `Map` of prefix to URI mappings, so that it can be used where a `Map` is required by the API.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_RDFA11

          public static final Set<Namespace> DEFAULT_RDFA11

      Set of RDFa 1.1 "initial context" namespaces
      See Also:
        `http://www.w3.org/2011/rdfa-context/rdfa-1.1`, `http://www.w3.org/2013/json-ld-context/rdfa11`

    - #### DEFAULT_RDF4J

          public static final Set<Namespace> DEFAULT_RDF4J

      RDFa initial namespaces + additional set of prefixes for RDF4J

  - ### Method Detail

    - #### asMap

          public static Map<String,String> asMap(Set<Namespace> namespaces)

      Converts a set of `Namespace`s into a map containing the `Namespace.getPrefix()` strings as keys, with the `Namespace.getName()` strings as values in the map for each namespace in the given set.
      Parameters:
        `namespaces` - The `Set` of `Namespace`s to transform.
      Returns:
        A `Map` of `String` to `String` where the key/value combinations are created based on the prefix and names from `Namespace`s in the input set.

    - #### wrap

          public static Map<String,String> wrap(Set<Namespace> namespaces)

      Wraps the given `Set` of `Namespace`s as a `Map` of prefix to URI mappings, so that it can be used where a `Map` is required by the API.
      NOTE: The Map returned by this method is not synchronized.
      Parameters:
        `namespaces` - The Set to wrap.
      Returns:
        A Map of prefix to URI mappings which is backed by the given Set of `Namespace`s.

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.