@@ -183,6 +183,40 @@ def test_get_triples(docker_url):
183183 assert "<schema#Philosopher>\n a sys:Class ;\n <schema#name> xsd:string ." in schema_triples
184184
185185
186+ def test_update_triples (docker_url ):
187+ ttl = """
188+ @base <terminusdb:///schema#> .
189+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
190+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
191+ @prefix woql: <http://terminusdb.com/schema/woql#> .
192+ @prefix json: <http://terminusdb.com/schema/json#> .
193+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
194+ @prefix xdd: <http://terminusdb.com/schema/xdd#> .
195+ @prefix vio: <http://terminusdb.com/schema/vio#> .
196+ @prefix sys: <http://terminusdb.com/schema/sys#> .
197+ @prefix api: <http://terminusdb.com/schema/api#> .
198+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
199+ @prefix doc: <data/> .
200+
201+ <schema#Philosopher>
202+ a sys:Class ;
203+ <schema#name> xsd:string .
204+
205+ <terminusdb://context>
206+ a sys:Context ;
207+ sys:base "terminusdb:///data/" ;
208+ sys:schema "terminusdb:///schema#" .
209+ """
210+ client = Client (docker_url , user_agent = test_user_agent , team = "admin" )
211+ client .connect ()
212+ db_name = "testDB" + str (random ())
213+ client .create_database (db_name , team = "admin" )
214+ client .connect (db = db_name )
215+ client .update_triples (graph_type = 'schema' , content = ttl , commit_msg = "Update triples" )
216+ client .insert_document ({"name" : "Socrates" })
217+ assert len (client .get_all_documents ()) == 1
218+
219+
186220def test_get_database (docker_url ):
187221 client = Client (docker_url , user_agent = test_user_agent , team = "admin" )
188222 client .connect ()
0 commit comments