Skip to content

Commit

Permalink
Merge branch 'main' into wip/xmlupload-change-serialisation-of-date-v…
Browse files Browse the repository at this point in the history
…alue
  • Loading branch information
Nora-Olivia-Ammann authored Nov 15, 2024
2 parents bef4f13 + cd2f940 commit 7a9893e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

from abc import ABC
from dataclasses import dataclass

from lxml import etree
Expand Down Expand Up @@ -32,7 +31,7 @@ class DataDeserialised:


@dataclass
class AbstractResource(ABC):
class AbstractResource:
res_id: str
label: str

Expand Down Expand Up @@ -119,7 +118,7 @@ class UriValueDeserialised(ValueDeserialised): ...


@dataclass
class AbstractFileValueDeserialised(ABC):
class AbstractFileValueDeserialised:
res_id: str
value: str | None

Expand Down
9 changes: 5 additions & 4 deletions src/dsp_tools/commands/validate_data/models/data_rdf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from abc import ABC
from abc import abstractmethod
from dataclasses import dataclass
from uuid import uuid4

Expand Down Expand Up @@ -28,8 +29,8 @@ def make_graph(self) -> Graph:


class RDFTriples(ABC):
def make_graph(self) -> Graph:
raise NotImplementedError
@abstractmethod
def make_graph(self) -> Graph: ...


@dataclass
Expand Down Expand Up @@ -219,8 +220,8 @@ class AbstractFileValueRDF(RDFTriples):
res_iri: URIRef
value: Literal

def make_graph(self) -> Graph:
raise NotImplementedError
@abstractmethod
def make_graph(self) -> Graph: ...


@dataclass
Expand Down
17 changes: 9 additions & 8 deletions src/dsp_tools/commands/validate_data/models/input_problems.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import warnings
from abc import ABC
from abc import abstractmethod
from collections import defaultdict
from dataclasses import dataclass
from datetime import datetime
Expand Down Expand Up @@ -146,14 +147,14 @@ class InputProblem(ABC):
prop_name: str

@property
def problem(self) -> str:
raise NotImplementedError
@abstractmethod
def problem(self) -> str: ...

def get_msg(self) -> str:
raise NotImplementedError
@abstractmethod
def get_msg(self) -> str: ...

def to_dict(self) -> dict[str, str]:
raise NotImplementedError
@abstractmethod
def to_dict(self) -> dict[str, str]: ...

def _base_dict(self) -> dict[str, str]:
return {
Expand All @@ -163,8 +164,8 @@ def _base_dict(self) -> dict[str, str]:
"Problem": self.problem,
}

def sort_value(self) -> str:
raise NotImplementedError
@abstractmethod
def sort_value(self) -> str: ...


#######################
Expand Down

0 comments on commit 7a9893e

Please sign in to comment.