File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -288,3 +288,25 @@ def test_get_rdf_string(self):
288288
289289 with self .assertRaises (ValueError ):
290290 rdf_writer .get_rdf_str ("abc" )
291+
292+ def test_rdf_subclassing_switch (self ):
293+ """
294+ Test the RDF section subclassing switch.
295+ """
296+ # Section type term defined in odml/resources/section_subclasses.yaml that will
297+ # be converted to an RDF Section Subclass of Class "Cell".
298+ sub_class_term = "cell"
299+
300+ # Create minimal document
301+ doc = odml .Document ()
302+ _ = odml .Section (name = "test_subclassing" , type = sub_class_term , parent = doc )
303+
304+ # Test default subclassing
305+ rdf_writer = RDFWriter ([doc ])
306+ result = rdf_writer .get_rdf_str ()
307+ self .assertIn ("odml:Cell" , result )
308+
309+ # Test inactivation of subclassing feature
310+ rdf_writer = RDFWriter ([doc ], rdf_subclassing = False )
311+ result = rdf_writer .get_rdf_str ()
312+ self .assertNotIn ("odml:Cell" , result )
You can’t perform that action at this time.
0 commit comments