@@ -1506,7 +1506,7 @@ def object(
15061506
15071507 j , s = self .strconst (argstr , i , delim )
15081508
1509- res .append (self . _store . newLiteral (s )) # type: ignore[call-arg] # TODO FIXME
1509+ res .append (Literal (s ))
15101510 return j
15111511 else :
15121512 return - 1
@@ -1570,11 +1570,14 @@ def nodeOrLiteral(self, argstr: str, i: int, res: MutableSequence[Any]) -> int:
15701570 i = m .end ()
15711571 lang = argstr [j + 1 : i ]
15721572 j = i
1573- if argstr [j : j + 2 ] == "^^" :
1573+ res .append (Literal (s , lang = lang ))
1574+ elif argstr [j : j + 2 ] == "^^" :
15741575 res2 : typing .List [Any ] = []
15751576 j = self .uri_ref2 (argstr , j + 2 , res2 ) # Read datatype URI
15761577 dt = res2 [0 ]
1577- res .append (self ._store .newLiteral (s , dt , lang ))
1578+ res .append (Literal (s , datatype = dt ))
1579+ else :
1580+ res .append (Literal (s ))
15781581 return j
15791582 else :
15801583 return - 1
@@ -1852,12 +1855,6 @@ def newBlankNode(
18521855 bn = BNode (str (arg [0 ]).split ("#" ).pop ().replace ("_" , "b" ))
18531856 return bn
18541857
1855- def newLiteral (self , s : str , dt : Optional [URIRef ], lang : Optional [str ]) -> Literal :
1856- if dt :
1857- return Literal (s , datatype = dt )
1858- else :
1859- return Literal (s , lang = lang )
1860-
18611858 def newList (self , n : typing .List [Any ], f : Optional [Formula ]) -> IdentifiedNode :
18621859 nil = self .newSymbol ("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" )
18631860 if not n :
0 commit comments