Skip to content

naming module

This is the naming module.

This module contains geographic metadata structures regarding naming derived from the ISO 19115-1:2014 international standard.

GenericName

Bases: ABC

A sequence of identifiers rooted within the context of a namespace.

Source code in opengis/metadata/naming.py
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
class GenericName(ABC):
    """A sequence of identifiers rooted within the context of a namespace."""

    @property
    @abstractmethod
    def depth(self) -> int:
        """
        Indicates the number of levels specified by this name. For any
        `LocalName`, it is always one. For a `ScopedName` it is some number
        greater than or equal to 2.
        """

    @property
    @abstractmethod
    def scope(self) -> NameSpace:
        """
        The scope (name space) in which this name is local. All names carry an
        association with their scope in which they are considered local, but
        the scope can be the global namespace.
        """

    @property
    @abstractmethod
    def parsed_name(self) -> Sequence['LocalName']:
        """
        The sequence of local names making this generic name. The length of
        this sequence is the depth. It does not include the scope.
        """

depth: int abstractmethod property

Indicates the number of levels specified by this name. For any LocalName, it is always one. For a ScopedName it is some number greater than or equal to 2.

parsed_name: Sequence[LocalName] abstractmethod property

The sequence of local names making this generic name. The length of this sequence is the depth. It does not include the scope.

scope: NameSpace abstractmethod property

The scope (name space) in which this name is local. All names carry an association with their scope in which they are considered local, but the scope can be the global namespace.

LocalName

Bases: GenericName

Identifier within a name space for a local object. Local names are names that are directly accessible to and maintained by a NameSpace. Names are local to one and only one name space. The name space within which they are local is indicated by the scope.

Source code in opengis/metadata/naming.py
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
class LocalName(GenericName):
    """
    Identifier within a name space for a local object. Local names are names
    that are directly accessible to and maintained by a `NameSpace`. Names are
    local to one and only one name space. The name space within which they are
    local is indicated by the scope.
    """

    @abstractmethod
    def __str__(self) -> str:
        """A string representation of this local name."""

    @property
    @abstractmethod
    def depth(self) -> int:
        """
        The number of levels specified by this name, which is always 1 for
        a local name.
        """
        return 1

    @property
    @abstractmethod
    def parsed_name(self) -> Sequence['LocalName']:
        """
        The sequence of local names. Since this object is itself a locale name,
        the parsed name is always a singleton containing only `self`.
        """

depth: int abstractmethod property

The number of levels specified by this name, which is always 1 for a local name.

parsed_name: Sequence[LocalName] abstractmethod property

The sequence of local names. Since this object is itself a locale name, the parsed name is always a singleton containing only self.

__str__() abstractmethod

A string representation of this local name.

Source code in opengis/metadata/naming.py
87
88
89
@abstractmethod
def __str__(self) -> str:
    """A string representation of this local name."""

MemberName

Bases: LocalName

A name that references either an attribute slot in a record, an attribute, operation, or association role in an object instance or a type description in some schema.

Source code in opengis/metadata/naming.py
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
class MemberName(LocalName):
    """
    A name that references either an attribute slot in a record, an attribute,
    operation, or association role in an object instance or a type description
    in some schema.
    """

    @property
    @abstractmethod
    def attribute_type(self) -> TypeName:
        """The type of the data associated with the member."""

    @abstractmethod
    def __str__(self) -> str:
        """A string representation of this member name."""

attribute_type: TypeName abstractmethod property

The type of the data associated with the member.

__str__() abstractmethod

A string representation of this member name.

Source code in opengis/metadata/naming.py
164
165
166
@abstractmethod
def __str__(self) -> str:
    """A string representation of this member name."""

NameSpace

Bases: ABC

A domain in which names are defined.

Source code in opengis/metadata/naming.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class NameSpace(ABC):
    """A domain in which names are defined."""

    @property
    @abstractmethod
    def is_global(self):
        """
        Indicates whether this namespace is a "top level" namespace. Global,
        or top-level namespaces are not contained within another namespace.
        The global namespace has no parent.
        """

    @property
    @abstractmethod
    def name(self) -> 'GenericName':
        """The identifier of this namespace."""

is_global abstractmethod property

Indicates whether this namespace is a "top level" namespace. Global, or top-level namespaces are not contained within another namespace. The global namespace has no parent.

name: GenericName abstractmethod property

The identifier of this namespace.

Record

Bases: ABC

A list of logically related fields as (name, value) pairs in a dictionary.

Source code in opengis/metadata/naming.py
186
187
188
189
190
191
192
193
194
195
196
197
198
199
class Record(ABC):
    """
    A list of logically related fields as (name, value) pairs in a dictionary.
    """

    @property
    @abstractmethod
    def type(self) -> RecordType:
        """The type definition of this record."""

    @property
    @abstractmethod
    def field(self):
        """The dictionary of all (name, value) pairs in this record."""

field abstractmethod property

The dictionary of all (name, value) pairs in this record.

type: RecordType abstractmethod property

The type definition of this record.

RecordType

Bases: Type

The type definition of a record. A RecordType defines dynamically constructed data type.

Source code in opengis/metadata/naming.py
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
class RecordType(Type):
    """
    The type definition of a record. A `RecordType` defines dynamically
    constructed data type.
    """

    @property
    @abstractmethod
    def type_name(self) -> TypeName:
        """The name that identifies this record type."""

    @property
    @abstractmethod
    def field_type(self):
        """The dictionary of all (name, type) pairs in this record type."""

field_type abstractmethod property

The dictionary of all (name, type) pairs in this record type.

type_name: TypeName abstractmethod property

The name that identifies this record type.

ScopedName

Bases: GenericName

A composite of a LocalName (as head) for locating another name space, and a GenericName (as tail) valid in that name space.

Source code in opengis/metadata/naming.py
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
class ScopedName(GenericName):
    """
    A composite of a `LocalName` (as head) for locating another name space,
    and a `GenericName` (as tail) valid in that name space.
    """

    @property
    @abstractmethod
    def head(self) -> LocalName:
        """
        The first element in the sequence of parsed names. The head element
        must exists in the same name space as this scoped name.
        """

    @property
    @abstractmethod
    def tail(self) -> GenericName:
        """
        Every elements in the sequence of parsed names except for the head.
        """

    @abstractmethod
    def __str__(self) -> str:
        """A string representation of this scoped name."""

head: LocalName abstractmethod property

The first element in the sequence of parsed names. The head element must exists in the same name space as this scoped name.

tail: GenericName abstractmethod property

Every elements in the sequence of parsed names except for the head.

__str__() abstractmethod

A string representation of this scoped name.

Source code in opengis/metadata/naming.py
130
131
132
@abstractmethod
def __str__(self) -> str:
    """A string representation of this scoped name."""

Type

Bases: ABC

Base interface of type definitions.

Source code in opengis/metadata/naming.py
143
144
145
146
147
148
149
class Type(ABC):
    """Base interface of type definitions."""

    @property
    @abstractmethod
    def type_name(self) -> TypeName:
        """The name that identifies this type."""

type_name: TypeName abstractmethod property

The name that identifies this type.

TypeName

Bases: LocalName

A local name that references a record type.

Source code in opengis/metadata/naming.py
135
136
137
138
139
140
class TypeName(LocalName):
    """A local name that references a record type."""

    @abstractmethod
    def __str__(self) -> str:
        """A string representation of this type name."""

__str__() abstractmethod

A string representation of this type name.

Source code in opengis/metadata/naming.py
138
139
140
@abstractmethod
def __str__(self) -> str:
    """A string representation of this type name."""