@@ -20,3 +20,25 @@ def setUp(self):
2020 Property (name = "prop1" , values = [1.3 ], parent = sec )
2121
2222 self .doc = doc
23+
24+ def test_rdf_formats (self ):
25+ """
26+ Test if document gets correctly converted to odml for turtle, xml and n3.
27+ """
28+ w = RDFWriter (self .doc ).get_rdf_str ()
29+ r = RDFReader ().from_string (w , "turtle" )
30+ self .assertEqual (len (r [0 ].sections ), 1 )
31+ self .assertEqual (len (r [0 ].sections [0 ].sections ), 1 )
32+ self .assertEqual (len (r [0 ].sections [0 ].properties ), 1 )
33+
34+ w = RDFWriter (self .doc ).get_rdf_str ("xml" )
35+ r = RDFReader ().from_string (w , "xml" )
36+ self .assertEqual (len (r [0 ].sections ), 1 )
37+ self .assertEqual (len (r [0 ].sections [0 ].sections ), 1 )
38+ self .assertEqual (len (r [0 ].sections [0 ].properties ), 1 )
39+
40+ w = RDFWriter (self .doc ).get_rdf_str ("n3" )
41+ r = RDFReader ().from_string (w , "n3" )
42+ self .assertEqual (len (r [0 ].sections ), 1 )
43+ self .assertEqual (len (r [0 ].sections [0 ].sections ), 1 )
44+ self .assertEqual (len (r [0 ].sections [0 ].properties ), 1 )
0 commit comments