@@ -217,6 +217,40 @@ def test_update_triples(docker_url):
217217 assert len (list (client .get_all_documents ())) == 1
218218
219219
220+ def test_insert_triples (docker_url ):
221+ ttl = """
222+ @base <terminusdb:///schema#> .
223+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
224+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
225+ @prefix woql: <http://terminusdb.com/schema/woql#> .
226+ @prefix json: <http://terminusdb.com/schema/json#> .
227+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
228+ @prefix xdd: <http://terminusdb.com/schema/xdd#> .
229+ @prefix vio: <http://terminusdb.com/schema/vio#> .
230+ @prefix sys: <http://terminusdb.com/schema/sys#> .
231+ @prefix api: <http://terminusdb.com/schema/api#> .
232+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
233+ @prefix doc: <data/> .
234+
235+ <schema#Philosopher>
236+ a sys:Class ;
237+ <schema#name> xsd:string .
238+
239+ <terminusdb://context>
240+ a sys:Context ;
241+ sys:base "terminusdb:///data/"^^xsd:string ;
242+ sys:schema "terminusdb:///schema#"^^xsd:string .
243+ """
244+ client = Client (docker_url , user_agent = test_user_agent , team = "admin" )
245+ client .connect ()
246+ db_name = "testDB" + str (random ())
247+ client .create_database (db_name , team = "admin" )
248+ client .connect (db = db_name )
249+ client .insert_triples (graph_type = 'schema' , content = ttl , commit_msg = "Insert triples" )
250+ client .insert_document ({"name" : "Socrates" })
251+ assert len (list (client .get_all_documents ())) == 1
252+
253+
220254def test_get_database (docker_url ):
221255 client = Client (docker_url , user_agent = test_user_agent , team = "admin" )
222256 client .connect ()
0 commit comments