Repository: Informasjonsforvaltning/datacatalogtordf

Issue:
temporal_resolution property should be a list

Discussion:
codecov[bot]: # [Codecov](https://codecov.io/gh/Informasjonsforvaltning/datacatalogtordf/pull/69?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Informasjonsforvaltning) Report
> Merging [#69](https://codecov.io/gh/Informasjonsforvaltning/datacatalogtordf/pull/69?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Informasjonsforvaltning) (8fc2c22) into [main](https://codecov.io/gh/Informasjonsforvaltning/datacatalogtordf/commit/95d8a9af3843dab23cd5e8bff47c72c33cd7c54d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Informasjonsforvaltning) (95d8a9a) will **not change** coverage.
> The diff coverage is `100.00%`.

```diff
@@            Coverage Diff            @@
##              main       #69   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines         1442      1444    +2     
=========================================
+ Hits          1442      1444    +2     
```


| [Impacted Files](https://codecov.io/gh/Informasjonsforvaltning/datacatalogtordf/pull/69?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Informasjonsforvaltning) | Coverage Δ | |
|---|---|---|
| [src/datacatalogtordf/dataset.py](https://codecov.io/gh/Informasjonsforvaltning/datacatalogtordf/pull/69/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Informasjonsforvaltning#diff-c3JjL2RhdGFjYXRhbG9ndG9yZGYvZGF0YXNldC5weQ==) | `100.00% <100.00%> (ø)` | |
| [src/datacatalogtordf/distribution.py](https://codecov.io/gh/Informasjonsforvaltning/datacatalogtordf/pull/69/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Informasjonsforvaltning#diff-c3JjL2RhdGFjYXRhbG9ndG9yZGYvZGlzdHJpYnV0aW9uLnB5) | `100.00% <100.00%> (ø)` | |

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. [Learn more](https://about.codecov.io/product/feature/runtime-insights/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Informasjonsforvaltning)


Patch:
diff --git a/src/datacatalogtordf/dataset.py b/src/datacatalogtordf/dataset.py
index 419f9be..92eb7bb 100644
--- a/src/datacatalogtordf/dataset.py
+++ b/src/datacatalogtordf/dataset.py
@@ -54,7 +54,8 @@ class Dataset(Resource):
         spatial_resolution (Decimal): Minimum spatial separation resolvable \
             in a dataset, measured in meters.
         temporal_coverage (PeriodOfTime): The temporal period that the dataset covers.
-        temporal_resolution (str): Minimum time period resolvable in the dataset.
+        temporal_resolution (List[str]): A list of minimum time period resolvables in \
+        the dataset.
         was_generated_by (URI): A link to an activity that generated, \
             or provides the business context for, the creation of the dataset.
         access_rights_comments (List[URI]): Referanse til hjemmel \
@@ -82,7 +83,7 @@ class Dataset(Resource):
     _spatial: List[Union[Location, str]]
     _spatial_resolution: Decimal
     _temporal_coverage: PeriodOfTime
-    _temporal_resolution: str
+    _temporal_resolution: List[str]
     _was_generated_by: URI
     _access_rights_comments: List[str]
     _dct_identifier: str
@@ -143,12 +144,12 @@ class Dataset(Resource):
         self._temporal_coverage = temporal_coverage
 
     @property
-    def temporal_resolution(self: Dataset) -> str:
+    def temporal_resolution(self: Dataset) -> List[str]:
         """Get/set for temporal_resolution."""
         return self._temporal_resolution
 
     @temporal_resolution.setter
-    def temporal_resolution(self: Dataset, temporal_resolution: str) -> None:
+    def temporal_resolution(self: Dataset, temporal_resolution: List[str]) -> None:
         self._temporal_resolution = temporal_resolution
 
     @property
@@ -320,13 +321,14 @@ class Dataset(Resource):
 
     def _temporal_resolution_to_graph(self: Dataset) -> None:
         if getattr(self, "temporal_resolution", None):
-            self._g.add(
-                (
-                    URIRef(self.identifier),
-                    DCAT.temporalResolution,
-                    Literal(self.temporal_resolution, datatype=XSD.duration),
+            for temporal_resolution in self.temporal_resolution:
+                self._g.add(
+                    (
+                        URIRef(self.identifier),
+                        DCAT.temporalResolution,
+                        Literal(temporal_resolution, datatype=XSD.duration),
+                    )
                 )
-            )
 
     def _was_generated_by_to_graph(self: Dataset) -> None:
         if getattr(self, "was_generated_by", None):
diff --git a/src/datacatalogtordf/distribution.py b/src/datacatalogtordf/distribution.py
index 6555ddc..ae9013c 100644
--- a/src/datacatalogtordf/distribution.py
+++ b/src/datacatalogtordf/distribution.py
@@ -66,7 +66,7 @@ class Distribution:
         byte_size (Decimal): 	The size of a distribution in bytes.
         spatial_resolution (Decimal): 	The minimum spatial separation resolvable \
             in a dataset distribution, measured in meters.
-        temporal_resolution (str): Minimum time period resolvable in the \
+        temporal_resolution (List[str]): A list of minimum time period resolvables in the \
             dataset distribution.
         conforms_to (List[URI]): A list of links to established standards \
             to which the distribution conforms.
@@ -120,7 +120,7 @@ class Distribution:
     _download_URL: URI
     _byte_size: Decimal
     _spatial_resolution: Decimal
-    _temporal_resolution: str
+    _temporal_resolution: List[str]
     _conforms_to: List[str]
     _media_types: List[str]
     _formats: List[str]
@@ -263,12 +263,12 @@ class Distribution:
         self._spatial_resolution = spatial_resolution
 
     @property
-    def temporal_resolution(self: Distribution) -> str:
+    def temporal_resolution(self: Distribution) -> List[str]:
         """Get/set for temporal_resolution."""
         return self._temporal_resolution
 
     @temporal_resolution.setter
-    def temporal_resolution(self: Distribution, temporal_resolution: str) -> None:
+    def temporal_resolution(self: Distribution, temporal_resolution: List[str]) -> None:
         self._temporal_resolution = temporal_resolution
 
     @property
@@ -469,13 +469,14 @@ class Distribution:
 
     def _temporal_resolution_to_graph(self: Distribution) -> None:
         if getattr(self, "temporal_resolution", None):
-            self._g.add(
-                (
-                    URIRef(self.identifier),
-                    DCAT.temporalResolution,
-                    Literal(self.temporal_resolution, datatype=XSD.duration),
+            for temporal_resolution in self.temporal_resolution:
+                self._g.add(
+                    (
+                        URIRef(self.identifier),
+                        DCAT.temporalResolution,
+                        Literal(temporal_resolution, datatype=XSD.duration),
+                    )
                 )
-            )
 
     def _conforms_to_to_graph(self: Distribution) -> None:
         if getattr(self, "conforms_to", None):


Test patch:
diff --git a/tests/test_dataset.py b/tests/test_dataset.py
index 0a8c0c9..c7467cf 100644
--- a/tests/test_dataset.py
+++ b/tests/test_dataset.py
@@ -311,7 +311,7 @@ def test_to_graph_should_return_temporal_resolution() -> None:
     """It returns a temporal resolution graph isomorphic to spec."""
     dataset = Dataset()
     dataset.identifier = "http://example.com/datasets/1"
-    dataset.temporal_resolution = "PT15M"
+    dataset.temporal_resolution = ["PT15M"]
 
     src = """
     @prefix dct: <http://purl.org/dc/terms/> .
diff --git a/tests/test_distribution.py b/tests/test_distribution.py
index 9160e75..bb54cb8 100644
--- a/tests/test_distribution.py
+++ b/tests/test_distribution.py
@@ -452,7 +452,7 @@ def test_to_graph_should_return_temporal_resolution() -> None:
     """It returns a temporal resolution graph isomorphic to spec."""
     distribution = Distribution()
     distribution.identifier = "http://example.com/distributions/1"
-    distribution.temporal_resolution = "PT15M"
+    distribution.temporal_resolution = ["PT15M"]
 
     src = """
     @prefix dct: <http://purl.org/dc/terms/> .