Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
aaxelb committed Dec 6, 2024
1 parent a04488b commit ce20fc4
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions trove/render/_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import dataclasses
from typing import Iterator

from primitive_metadata import primitive_rdf as rdf

from trove import exceptions as trove_exceptions


Expand Down Expand Up @@ -47,23 +45,3 @@ def iter_content(self):
raise trove_exceptions.CannotRenderStreamTwice
self._started_already = True
yield from self.content_stream


@dataclasses.dataclass
class LiteralRendering(ProtoRendering):
literal: rdf.Literal
# (TODO: languages)

@property
def mediatype(self) -> str:
try:
return next(
rdf.iri_minus_namespace(_iri, namespace=rdf.IANA_MEDIATYPE)
for _iri in self.literal.datatype_iris
if _iri in rdf.IANA_MEDIATYPE
)
except StopIteration: # no mediatype iri
return 'text/plain; charset=utf-8'

def iter_content(self):
yield self.literal.unicode_value

0 comments on commit ce20fc4

Please sign in to comment.