File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -788,10 +788,6 @@ def get_triples(self, graph_type: str) -> str:
788788 -------
789789 str
790790 """
791-
792- ### TODO: make triples works again
793- raise InterfaceError ("get_triples is temporary not avaliable in this version" )
794-
795791 self ._check_connection ()
796792 self ._validate_graph_type (graph_type )
797793 result = requests .get (
Original file line number Diff line number Diff line change @@ -166,6 +166,23 @@ def test_log(docker_url):
166166 assert log [0 ]['@type' ] == 'InitialCommit'
167167
168168
169+ def test_get_triples (docker_url ):
170+ client = Client (docker_url , user_agent = test_user_agent , team = "admin" )
171+ client .connect ()
172+ db_name = "testDB" + str (random ())
173+ client .create_database (db_name , team = "admin" )
174+ client .connect (db = db_name )
175+ # Add a philosopher schema
176+ schema = {"@type" : "Class" ,
177+ "@id" : "Philosopher" ,
178+ "name" : "xsd:string"
179+ }
180+ # Add schema and Socrates
181+ client .insert_document (schema , graph_type = "schema" )
182+ schema_triples = client .get_triples (graph_type = 'schema' )
183+ assert "<schema#Philosopher>\n a sys:Class ;\n <schema#name> xsd:string ." in schema_triples
184+
185+
169186def test_get_database (docker_url ):
170187 client = Client (docker_url , user_agent = test_user_agent , team = "admin" )
171188 client .connect ()
You can’t perform that action at this time.
0 commit comments