|
36 | 36 | # graphs.
|
37 | 37 |
|
38 | 38 | from __future__ import annotations
|
39 |
| - |
| 39 | +from typing import Any, Dict, IO, List, Optional |
40 | 40 | import warnings
|
41 |
| -from typing import IO, Any, Dict, List, Optional |
42 | 41 |
|
43 | 42 | from rdflib.graph import DATASET_DEFAULT_GRAPH_ID, Graph, _ObjectType
|
44 | 43 | from rdflib.namespace import RDF, XSD
|
45 | 44 | from rdflib.serializer import Serializer
|
46 | 45 | from rdflib.term import BNode, IdentifiedNode, Identifier, Literal, URIRef
|
47 | 46 |
|
48 |
| -from ..shared.jsonld.context import UNDEF, Context |
| 47 | +from ..shared.jsonld.context import Context, UNDEF |
49 | 48 | from ..shared.jsonld.keys import CONTEXT, GRAPH, ID, LANG, LIST, SET, VOCAB
|
50 | 49 | from ..shared.jsonld.util import _HAS_ORJSON, json, orjson
|
51 | 50 |
|
@@ -393,11 +392,8 @@ def to_raw_value(
|
393 | 392 | else:
|
394 | 393 | v = str(o)
|
395 | 394 | if o.datatype:
|
396 |
| - if native: |
397 |
| - if self.context.active: |
398 |
| - return v |
399 |
| - else: |
400 |
| - return {context.value_key: v} |
| 395 | + if native and self.context.active: |
| 396 | + return v |
401 | 397 | return {
|
402 | 398 | context.type_key: context.to_symbol(o.datatype),
|
403 | 399 | context.value_key: v,
|
|
0 commit comments