@@ -713,6 +713,8 @@ def test_12_property_string_with_language(self) -> None:
713713
714714 def test_12_property_string_with_quote (self ) -> None :
715715 """Test emitting a string property literal with a quote in it."""
716+ # see pyobo.struct.struct_utils._escape_literal for
717+ # implementation of escaping for these literals
716718 term = Term (reference = LYSINE_DEHYDROGENASE_ACT )
717719 term .annotate_string (RO_DUMMY , '"value" added' )
718720 self .assert_obo_stanza (
@@ -727,7 +729,7 @@ def test_12_property_string_with_quote(self) -> None:
727729 ofn = """\
728730 Declaration(Class(GO:0050069))
729731 AnnotationAssertion(rdfs:label GO:0050069 "lysine dehydrogenase activity")
730- AnnotationAssertion(RO:1234567 GO:0050069 "\\ "value\\ " added"@en )
732+ AnnotationAssertion(RO:1234567 GO:0050069 "\\ "value\\ " added"^^xsd:string )
731733 """ ,
732734 )
733735
@@ -791,6 +793,26 @@ def test_12_property_year(self) -> None:
791793 typedefs = {RO_DUMMY .pair : RO_DUMMY },
792794 )
793795
796+ def test_12_property_date (self ) -> None :
797+ """Test emitting property literals that were annotated as a date."""
798+ term = Term (reference = LYSINE_DEHYDROGENASE_ACT )
799+ term .annotate_date (RO_DUMMY , "1993-01-01" )
800+ self .assert_obo_stanza (
801+ term ,
802+ obo = """\
803+ [Term]
804+ id: GO:0050069
805+ name: lysine dehydrogenase activity
806+ property_value: RO:1234567 "1993-01-01" xsd:date
807+ """ ,
808+ ofn = """\
809+ Declaration(Class(GO:0050069))
810+ AnnotationAssertion(rdfs:label GO:0050069 "lysine dehydrogenase activity")
811+ AnnotationAssertion(RO:1234567 GO:0050069 "1993-01-01"^^xsd:date)
812+ """ ,
813+ typedefs = {RO_DUMMY .pair : RO_DUMMY },
814+ )
815+
794816 def test_12_property_object (self ) -> None :
795817 """Test emitting property literals."""
796818 term = Term (reference = LYSINE_DEHYDROGENASE_ACT )
0 commit comments