nyx_client.property =================== .. py:module:: nyx_client.property .. autoapi-nested-parse:: Structures for defining custom metadata (properties) for :class:`nyx_client.data.Data`. Fields in said structures follow Nyx OpenAPI spec naming. Classes ------- .. autoapisummary:: nyx_client.property.LangLiteral nyx_client.property.StringLiteral nyx_client.property.Literal nyx_client.property.Uri nyx_client.property.Property Module Contents --------------- .. py:class:: LangLiteral A metadata property type describing a string with a given language. Implicit datatype: `rdf:langString` .. py:attribute:: lang :type: str 2-character language code .. py:attribute:: value :type: str String representation of the value .. py:class:: StringLiteral A metadata property type describing a string without a language. Implicit datatype: `rdf:string` .. py:attribute:: value :type: str String representation of the value .. py:class:: Literal A metadata property type describing a literal with the given datatype. Implicit datatype: `rdfs:Literal` .. py:attribute:: dataType :type: str XSD data type without its namespace prefix. The following types (from `XSD namespace `_) are currently supported: ``dateTime, time, date, boolean, integer, decimal, float, double, nonPositiveInteger, negativeInteger, nonNegativeInteger, positiveInteger, long, unsignedLong, int, unsignedInt, short, unsignedShort, byte, unsignedByte, base64Binary, anyURI`` .. py:attribute:: value :type: str String representation of the value .. py:class:: Uri A metadata property type describing a Uri. .. py:attribute:: uri :type: str String representation of the URI .. py:class:: Property A metadata property with a single value. Multiple instances are used to represent a key (predicate) with multiple values. .. py:attribute:: key :type: str The key (predicate) of the property. Must be an IRI. .. py:attribute:: value :type: PropertyValue The value (object) of the property .. py:method:: as_dict() Returns the object as a dictionary. :returns: A dictionary of the Property that matches layout expected by the API. .. py:method:: from_dict(data) :classmethod: Returns a new property instance constructed from the given dictionary. This is expected to be in the same format as generated by :meth:`as_dict()` (or returned nu the API). .. py:method:: lang_string(key, value, lang) :classmethod: Shorthand for creating a language-specific string property. See :class:`LangLiteral` for more details. .. py:method:: string(key, value) :classmethod: Shorthand for creating a string property (without language). See :class:`StringLiteral` for more details. .. py:method:: literal(key, value, data_type) :classmethod: Shorthand for creating a property with a specific data type. See :class:`Literal` for more details. .. py:method:: uri(key, uri) :classmethod: Shorthand for creating a URI property. See :class:`Uri` for more details.