pyshacl/inference/custom_rdfs_closure.py
def add_new_datatype(
        uri, conversion_function, datatype_list, subsumption_dict=None, subsumption_key=None, subsumption_list=None
    ):
        """If an extension wants to add new datatypes, this method should be invoked at initialization time.

        @param uri: URI for the new datatypes, like owl_ns["Rational"]
        @param conversion_function: a function converting the lexical representation of the datatype to a Python value,
        possibly raising an exception in case of unsuitable lexical form
        @param datatype_list: list of datatypes already in use that has to be checked
        @param subsumption_dict: dictionary of subsumption hierarchies (indexed by the datatype URI-s)
        @param subsumption_key: key in the dictionary, if None, the uri parameter is used
        @param subsumption_list: list of subsumptions associated to a subsumption key (ie, all datatypes that are
        superclasses of the new datatype)
        """
        from owlrl.DatatypeHandling import AltXSDToPYTHON, use_Alt_lexical_conversions

        if datatype_list:
            datatype_list.append(uri)

        if subsumption_dict and subsumption_list:
            if subsumption_key:
                subsumption_dict[subsumption_key] = subsumption_list
            else:
                subsumption_dict[uri] = subsumption_list

        AltXSDToPYTHON[uri] = conversion_function
        use_Alt_lexical_conversions()
If an extension wants to add new datatypes, this method should be invoked at initialization time.

        @param uri: URI for the new datatypes, like owl_ns["Rational"]
        @param conversion_function: a function converting the lexical representation of the datatype to a Python value,
        possibly raising an exception in case of unsuitable lexical form
        @param datatype_list: list of datatypes already in use that has to be checked
        @param subsumption_dict: dictionary of subsumption hierarchies (indexed by the datatype URI-s)
        @param subsumption_key: key in the dictionary, if None, the uri parameter is used
        @param subsumption_list: list of subsumptions associated to a subsumption key (ie, all datatypes that are
        superclasses of the new datatype)
        
If an extension wants to add new datatypes, this method should be invoked at initialization time.
If an extension wants to add new datatypes this method should be invoked at initialization time .
def add_new_datatype(
        uri, conversion_function, datatype_list, subsumption_dict=None, subsumption_key=None, subsumption_list=None
    ):
        from owlrl.DatatypeHandling import AltXSDToPYTHON, use_Alt_lexical_conversions
        if datatype_list:
            datatype_list.append(uri)
        if subsumption_dict and subsumption_list:
            if subsumption_key:
                subsumption_dict[subsumption_key] = subsumption_list
            else:
                subsumption_dict[uri] = subsumption_list
        AltXSDToPYTHON[uri] = conversion_function
        use_Alt_lexical_conversions()
def add_new_datatype ( uri , conversion_function , datatype_list , subsumption_dict = None , subsumption_key = None , subsumption_list = None ) : from owlrl . DatatypeHandling import AltXSDToPYTHON , use_Alt_lexical_conversions if datatype_list : datatype_list . append ( uri ) if subsumption_dict and subsumption_list : if subsumption_key : subsumption_dict [ subsumption_key ] = subsumption_list else : subsumption_dict [ uri ] = subsumption_list AltXSDToPYTHON [ uri ] = conversion_function use_Alt_lexical_conversions ( )
If an extension wants to add new datatypes, this method should be invoked at initialization time.
If an extension wants to add new datatypes this method should be invoked at initialization time .
"""If an extension wants to add new datatypes, this method should be invoked at initialization time.

        @param uri: URI for the new datatypes, like owl_ns["Rational"]
        @param conversion_function: a function converting the lexical representation of the datatype to a Python value,
        possibly raising an exception in case of unsuitable lexical form
        @param datatype_list: list of datatypes already in use that has to be checked
        @param subsumption_dict: dictionary of subsumption hierarchies (indexed by the datatype URI-s)
        @param subsumption_key: key in the dictionary, if None, the uri parameter is used
        @param subsumption_list: list of subsumptions associated to a subsumption key (ie, all datatypes that are
        superclasses of the new datatype)
        """
uri
URI for the new datatypes, like owl_ns["Rational"]
URI for the new datatypes like owl_ns [ " Rational " ]
conversion_function
a function converting the lexical representation of the datatype to a Python value,
possibly raising an exception in case of unsuitable lexical form
a function converting the lexical representation of the datatype to a Python value possibly raising an exception in case of unsuitable lexical form
datatype_list
list of datatypes already in use that has to be checked
list of datatypes already in use that has to be checked
subsumption_dict
dictionary of subsumption hierarchies (indexed by the datatype URI-s)
dictionary of subsumption hierarchies ( indexed by the datatype URI - s )
subsumption_key
key in the dictionary, if None, the uri parameter is used
key in the dictionary if None the uri parameter is used
subsumption_list
list of subsumptions associated to a subsumption key
list of subsumptions associated to a subsumption key