Skip to content

sparql_escape_float checks for wrong type #31

@x-m-el

Description

@x-m-el

in the code

def sparql_escape_float(obj):
"""Converts the given float to a SPARQL-safe RDF object string with the right RDF-datatype. """
if not isinstance(obj, int):
warn("You are escaping something that isn't a float with \
the 'sparql_escape_float'-method. Implicit casting will occurr.")
obj = str(float(obj))
return '"{}"^^xsd:float'.format(obj)

The obj is checked for isinstance of int, but this should be a float.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions