summaryrefslogtreecommitdiff
path: root/rdflib/util.py
diff options
context:
space:
mode:
authorGraham Higgins <gjh@bel-epa.com>2022-03-23 10:49:36 +0000
committerGraham Higgins <gjh@bel-epa.com>2022-03-23 10:49:36 +0000
commit1b3d313ddcb11fb641229434117567a412a23cc6 (patch)
treef2ece0aafae969b0f8687b9fb99fc683b9098e65 /rdflib/util.py
parent6756983dd45f5503873e103461c1be993916e070 (diff)
downloadrdflib-1b3d313ddcb11fb641229434117567a412a23cc6.tar.gz
blacked
Diffstat (limited to 'rdflib/util.py')
-rw-r--r--rdflib/util.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/rdflib/util.py b/rdflib/util.py
index 48a24eb6..bf9ee0c6 100644
--- a/rdflib/util.py
+++ b/rdflib/util.py
@@ -203,7 +203,13 @@ def from_n3(s: str, default=None, backend=None, nsm=None):
return Literal(value, language, datatype)
elif s == "true" or s == "false":
return Literal(s == "true")
- elif s.lower().replace('.','').replace('-','').replace('e','').isnumeric():
+ elif (
+ s.lower()
+ .replace('.', '', 1)
+ .replace('-', '', 1)
+ .replace('e', '', 1)
+ .isnumeric()
+ ):
if "." in s:
return (
Literal(s, datatype=XSD.double)