@@ -70,6 +70,8 @@ class RepresentationContext(BaseModel):
7070
7171 _projected_uom : Optional [str ] = None
7272 _vertical_uom : Optional [str ] = None
73+
74+ _interpretation : Optional [Any ] = None
7375
7476 def __init__ (self , obj : Any , workspace : EnergymlStorageInterface , ** data ):
7577 super ().__init__ (obj = obj , workspace = workspace , uri = get_obj_uri (obj ), ** data )
@@ -85,6 +87,8 @@ def update(self):
8587 self ._collect_crs ()
8688 self ._collect_graphical_info (self .rels )
8789 self .collect_time_series ()
90+
91+
8892
8993 def collect_time_series (self ):
9094 self .time_series = []
@@ -172,13 +176,57 @@ def get_property(self, property_uuid: str) -> Optional[Any]:
172176 """Return the property object with the given uuid, or None."""
173177 return self ._props .get (property_uuid )
174178
179+ @property
180+ def vertical_is_time (self ) -> bool :
181+ """Return True if the vertical axis of the representation is time, based on interpretation domain or CRS info."""
182+ # Check interpretation domain first
183+ domain = self .domain
184+ if domain is not None and "time" in domain .lower ():
185+ return True
186+
187+ return False
188+
189+ @property
190+ def domain (self ) -> Optional [str ]:
191+ """Return the domain of the representation (e.g. "depth", "time", "depth/time", etc.) if available from interpretation, or None."""
192+ interp = self .interpretation
193+ if interp is not None :
194+ try :
195+ interp .domain
196+ except Exception :
197+ pass
198+ return None
199+
200+ @property
201+ def interpretation (self ) -> Optional [Any ]:
202+ """Return the interpretation object related to this representation, or None if not found."""
203+ if self ._interpretation is not None :
204+ return self ._interpretation
205+
206+ interpretation_dor = None
207+ try :
208+ interpretation_dor = self .obj .represented_interpretation
209+ except Exception as exc :
210+ try :
211+ interpretation_dor = self .obj .represented_object
212+ except Exception as exc :
213+ pass
214+ if interpretation_dor is not None :
215+ interpretation_obj = self .workspace .get_object (get_obj_uri (interpretation_dor ))
216+ if interpretation_obj is not None :
217+ self ._interpretation = interpretation_obj
218+ return interpretation_obj
219+
220+ return None
221+
175222 @property
176223 def projected_uom (self ) -> Optional [str ]:
177224 """Return the projected unit of measure (e.g. "m") if available from CRS info, or None."""
178225 for ci in self .crs_infos :
179226 if ci .projected_uom is not None :
180227 return ci .projected_uom
181228 return None
229+
182230 @property
183231 def vertical_uom (self ) -> Optional [str ]:
184232 """Return the vertical unit of measure (e.g. "m") if available from CRS info, or None."""
0 commit comments