diff options
author | gebele <gebele@in-silico.ch> | 2012-05-03 17:17:14 +0200 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2012-05-03 17:17:14 +0200 |
commit | 9ee6c46003a1cf9c6f61e23d122013998d49baa6 (patch) | |
tree | ebfb5650680b23e96a2de88eb133d4c94816b41f | |
parent | 894674a238e2c00c72674e6077282cbccff00472 (diff) |
tests rdf content with TB specific fields
-rw-r--r-- | test/rdf_check.rb | 79 |
1 files changed, 28 insertions, 51 deletions
diff --git a/test/rdf_check.rb b/test/rdf_check.rb index 82e1554..587e342 100644 --- a/test/rdf_check.rb +++ b/test/rdf_check.rb @@ -8,63 +8,40 @@ class UploadTest < Test::Unit::TestCase def teardown end - def test_01_query_sparqle_rdf_BII_I_1 + def test_01_check_rdf_with_ToxBank_specific_fields_on_BII_I_1 id = OpenTox::Authorization.authenticate($aa[:user],$aa[:password]) - #test_all - response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/`.chomp - assert_match /[https\:\/\/toxbanktest2, https\:\/\/toxbank\-dev]/, response + response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp + assert_match /[Investigation Identifier, BII\-I\-1]/, response + response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp + assert_match /[Investigation Title, Growth control of the eukaryote cell\: a systems biology study in yeast]/, response + response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp + assert_match /[Investigation Description, Background Cell growth underlies many key cellular and developmental processes]/, response + response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp + assert_match /[Owning Organisation URI, TBO\:G176]/, response #test_id_query_sparqle response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp - assert_match /[title, Manchester, givenname, Castrillo]/, response + assert_match /[Consortium URI, TBC:G2]/, response #test_resource_ISA - response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0/ISA_3981`.chomp - assert_match /[givenname, Castrillo, family\_name, Juan]/, response - #test_metadata_query_sparqle - response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0/metadata`.chomp - assert_match /[I2225, BII\-I\-1, S2223, S2224, Growth, Background]/, response - #test_resource_Investigation - response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0/I2225`.chomp - assert_match /[BII\-I\-1, title, Growth, abstract, Background]/, response - #test_resource_Study - response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0/S2223`.chomp - assert_match /[hasAssay, A1269, hasProtocol, P\_2202, description, Comprehensive, title, rapamycin, Rapamycin, Affymetrix]/, response - #test_resource_Assay - response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0/A1269`.chomp - #TODO fix Assay content - assert_match /Assay/, response - #test_resource_Protocol - response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0/P_2202`.chomp - assert_match /[mRNA, extraction]/, response - end - def test_02_query_sparqle_rdf_E_MTAB + response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp + assert_match /[Investigation keywords, TBK\:Blotting, Southwestern;TBK\:Molecular Imaging;DOID\:primary carcinoma of the liver cells]/, response + end + + def test_02_check_rdf_with_ToxBank_specific_fields_on_E_MTAB id = OpenTox::Authorization.authenticate($aa[:user],$aa[:password]) - #test_all - response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/`.chomp - assert_match /[https\:\/\/toxbanktest2, https\:\/\/toxbank\-dev]/, response + response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2`.chomp + assert_match /[Investigation Identifier, E\-MTAB\-798]/, response + response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2`.chomp + assert_match /[Investigation Title, Open TG\-GATEs \(in vitro, human\)]/, response + response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2`.chomp + assert_match /[Investigation Description, The Toxicogenomics Project was a 5\-year collaborative project]/, response + response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2`.chomp + assert_match /[Owning Organisation URI, TBO\:G176]/, response #test_id_query_sparqle response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2`.chomp - #TODO fix givenname - assert_match /[title, EMBL\-EBI, hasStudy, S2008, hasMember, ISA_60553]/, response + assert_match /[Consortium URI, TBC:G2]/, response #test_resource_ISA - response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2/ISA_60553`.chomp - assert_match /[givenname, Ruth, family\_name, Akhtar]/, response - #test_metadata_query_sparqle - response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2/metadata`.chomp - assert_match /[I2]/, response - #test_resource_Investigation - response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2/I2`.chomp - #TODO assert_match /[title, abstract]/, response - assert_match /[S2008]/, response - #test_resource_Study - response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2/S2008`.chomp - assert_match /[TG\-GATEs]/, response - assert_match /[hasAssay, A1838, hasProtocol, P_2010]/, response - #test_resource_Assay - response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2/A1838`.chomp - #TODO fix Assay content - assert_match /Assay/, response - #test_resource_Protocol - response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2/P_2010`.chomp - assert_match /[label, P\-MTAB\-23090]/, response - end + response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2`.chomp + assert_match /[Investigation keywords, TBK\:Fluxomics]/, response + end + end |