From 4ffd58d75078c91f87a6077bdaaf6024f7f33d99 Mon Sep 17 00:00:00 2001 From: Ciaran Welsh Date: Mon, 26 Apr 2021 09:57:21 +0100 Subject: [PATCH 1/4] rename manylinux on azure --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d0e8bc5aa5..7e016b0bd2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -442,8 +442,8 @@ stages: ParallelCount: 8 - - stage: GenerateManyLinuxPipWheel - displayName: GenerateManyLinuxPipWheel + - stage: ManyLinux2014 + displayName: ManyLinux2014 dependsOn: [] jobs: - job: From 070c58ab08d345f28fefa87147066f4838ba72c9 Mon Sep 17 00:00:00 2001 From: Ciaran Welsh Date: Mon, 26 Apr 2021 10:47:29 +0100 Subject: [PATCH 2/4] bugfix in rdf bag conversion where list elements were all assigned to the same blank node, causing loss of information --- src/omexmeta/PurgeRDFBag.cpp | 27 +++++++--- src/omexmeta/include/omexmeta/Predicate.h | 2 +- src/omexmeta/include/omexmeta/PurgeRDFBag.h | 1 + .../include/omexmeta/VCardTranslator.h | 3 +- tests/cpp/omexmeta/PurgeRDFBagTests.cpp | 49 +++++++++++++------ tests/cpp/omexmeta/RDFTests.cpp | 22 ++++++--- 6 files changed, 75 insertions(+), 29 deletions(-) diff --git a/src/omexmeta/PurgeRDFBag.cpp b/src/omexmeta/PurgeRDFBag.cpp index c5c974e8dc..43ed7c337f 100644 --- a/src/omexmeta/PurgeRDFBag.cpp +++ b/src/omexmeta/PurgeRDFBag.cpp @@ -40,7 +40,7 @@ namespace omexmeta { const std::string &p = results["p"][i]; const std::string &r = results["r"][i]; - // std::cout << x << "; " << j << "; " << s << "; " << rdf_li << "; " << y << "; " << p << "; " << r << std::endl; + // std::cout << x << "; " << j << "; " << s << "; " << rdf_li << "; " << y << "; " << p << "; " << r << std::endl; // remove triples of form "r1r7268r10; http://www.w3.org/1999/02/22-rdf-syntax-ns#_1; r1r7268r3" Triple t1( @@ -60,21 +60,36 @@ namespace omexmeta { LibrdfNode::fromLiteral(r, "", "")); librdf_model_remove_statement(rdf_->getModel(), t2.getStatement()); - // And remove the bag + // remove the model creator blank triple Triple t3( + rdf_->getUriHandler(), + LibrdfNode::fromUriString(x), + LibrdfNode::fromUriString(j), + LibrdfNode::fromBlank(s)); + librdf_model_remove_statement(rdf_->getModel(), t3.getStatement()); + + // And remove the bag + Triple t4( rdf_->getUriHandler(), LibrdfNode::fromBlank(s), LibrdfNode::fromUriString("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), LibrdfNode::fromUriString("http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag")); - librdf_model_remove_statement(rdf_->getModel(), t3.getStatement()); + librdf_model_remove_statement(rdf_->getModel(), t4.getStatement()); + + Triple t5( + rdf_->getUriHandler(), + LibrdfNode::fromUriString(x), + LibrdfNode::fromUriString(j), + LibrdfNode::fromBlank(rdf_li)); + librdf_model_add_statement(rdf_->getModel(), t5.getStatement()); // we now construct a triple to add the information back in - Triple t4( + Triple t6( rdf_->getUriHandler(), - LibrdfNode::fromBlank(s), + LibrdfNode::fromBlank(rdf_li), LibrdfNode::fromUriString(p), LibrdfNode::fromLiteral(r, "", "")); - librdf_model_add_statement(rdf_->getModel(), t4.getStatement()); + librdf_model_add_statement(rdf_->getModel(), t6.getStatement()); } } diff --git a/src/omexmeta/include/omexmeta/Predicate.h b/src/omexmeta/include/omexmeta/Predicate.h index 96961fb8aa..044a3bdf08 100644 --- a/src/omexmeta/include/omexmeta/Predicate.h +++ b/src/omexmeta/include/omexmeta/Predicate.h @@ -259,7 +259,7 @@ namespace omexmeta { * @class Subclass of Predicate specifically for predicates from the * DCTerm set of predicates. All * DCTerm predicates have the namespace - * `https://dublincore.org/specifications/dublin-core/dcmi-terms/` and a `bqmodel` prefix. + * `https://dublincore.org/specifications/dublin-core/dcmi-terms/` * * @example * @code diff --git a/src/omexmeta/include/omexmeta/PurgeRDFBag.h b/src/omexmeta/include/omexmeta/PurgeRDFBag.h index e7ee37e0af..c3e72672ab 100644 --- a/src/omexmeta/include/omexmeta/PurgeRDFBag.h +++ b/src/omexmeta/include/omexmeta/PurgeRDFBag.h @@ -41,6 +41,7 @@ namespace omexmeta { private: RDF* rdf_; + unsigned int currentBlankId_; }; }// namespace omexmeta diff --git a/src/omexmeta/include/omexmeta/VCardTranslator.h b/src/omexmeta/include/omexmeta/VCardTranslator.h index d9ea969974..93ac4274a0 100644 --- a/src/omexmeta/include/omexmeta/VCardTranslator.h +++ b/src/omexmeta/include/omexmeta/VCardTranslator.h @@ -59,8 +59,9 @@ namespace omexmeta { */ void translateEmail(); - RDF *rdf_; + + unsigned int currentBlankId = 0; }; diff --git a/tests/cpp/omexmeta/PurgeRDFBagTests.cpp b/tests/cpp/omexmeta/PurgeRDFBagTests.cpp index bbab627690..e24fe09ca0 100644 --- a/tests/cpp/omexmeta/PurgeRDFBagTests.cpp +++ b/tests/cpp/omexmeta/PurgeRDFBagTests.cpp @@ -178,19 +178,28 @@ TEST_F(PurgeRDFBagTests, WithRDFBagLists) { "\n" "\n" " [\n" - " \"EMBL-EBI\", \"\"\"Institute of Biochemistry and Biology, University of Potsdam, 14476\n" + " \"EMBL-EBI\" ;\n" + " \"Chelliah\" ;\n" + " \"Vijayalakshmi\" ;\n" + " \"viji@ebi.ac.uk\"\n" + " ], [\n" + " \"\"\"Institute of Biochemistry and Biology, University of Potsdam, 14476\n" " Potsdam, Germany\n" - " \"\"\", \"Max-Planck-Institute of Molecular Plant Physiology\" ;\n" - " \"Arnold\", \"Chelliah\", \"Nikoloski\" ;\n" - " \"Anne\", \"Vijayalakshmi\", \"Zoran\" ;\n" - " \"arnold@mpimp-golm.mpg.de\", \"nikoloski@mpimp-golm.mpg.de\", \"viji@ebi.ac.uk\"\n" + " \"\"\" ;\n" + " \"Nikoloski\" ;\n" + " \"Zoran\" ;\n" + " \"nikoloski@mpimp-golm.mpg.de\"\n" + " ], [\n" + " \"Max-Planck-Institute of Molecular Plant Physiology\" ;\n" + " \"Arnold\" ;\n" + " \"Anne\" ;\n" + " \"arnold@mpimp-golm.mpg.de\"\n" " ] ."; RDF rdf = RDF::fromString(inputWithLists); - PurgeRDFBag PurgeRDFBag(&rdf); - PurgeRDFBag.purge(); + std::cout << rdf.toString() << std::endl; - ASSERT_TRUE(RDF::equals(&rdf, expected)); + ASSERT_TRUE(RDF::equals(&rdf, expected, "turtle", true)); } TEST_F(PurgeRDFBagTests, WithOutRDFBagLists) { @@ -213,10 +222,10 @@ TEST_F(PurgeRDFBagTests, WithOutRDFBagLists) { RDF rdf = RDF::fromString(inputWithoutLists); PurgeRDFBag PurgeRDFBag(&rdf); PurgeRDFBag.purge(); - ASSERT_TRUE(RDF::equals(&rdf, expected)); + ASSERT_TRUE(RDF::equals(&rdf, expected, "turtle", true)); } -TEST_F(PurgeRDFBagTests, Both) { +TEST_F(PurgeRDFBagTests, BothWithAndWithoutRdfBagLists) { std::string expected = "@prefix rdf: .\n" "@prefix bqmodel: .\n" "@prefix bqbiol: .\n" @@ -228,12 +237,22 @@ TEST_F(PurgeRDFBagTests, Both) { " bqmodel:is , , ;\n" " bqmodel:isDescribedBy ;\n" " [\n" - " \"EMBL-EBI\", \"\"\"Institute of Biochemistry and Biology, University of Potsdam, 14476\n" + " \"EMBL-EBI\" ;\n" + " \"Chelliah\" ;\n" + " \"Vijayalakshmi\" ;\n" + " \"viji@ebi.ac.uk\"\n" + " ], [\n" + " \"\"\"Institute of Biochemistry and Biology, University of Potsdam, 14476\n" " Potsdam, Germany\n" - " \"\"\", \"Max-Planck-Institute of Molecular Plant Physiology\" ;\n" - " \"Arnold\", \"Chelliah\", \"Nikoloski\" ;\n" - " \"Anne\", \"Vijayalakshmi\", \"Zoran\" ;\n" - " \"arnold@mpimp-golm.mpg.de\", \"nikoloski@mpimp-golm.mpg.de\", \"viji@ebi.ac.uk\"\n" + " \"\"\" ;\n" + " \"Nikoloski\" ;\n" + " \"Zoran\" ;\n" + " \"nikoloski@mpimp-golm.mpg.de\"\n" + " ], [\n" + " \"Max-Planck-Institute of Molecular Plant Physiology\" ;\n" + " \"Arnold\" ;\n" + " \"Anne\" ;\n" + " \"arnold@mpimp-golm.mpg.de\"\n" " ] ;\n" " [\n" " \"2011-10-19T14:51:13Z\"\n" diff --git a/tests/cpp/omexmeta/RDFTests.cpp b/tests/cpp/omexmeta/RDFTests.cpp index 0bb34d5c99..0cdaf4f929 100644 --- a/tests/cpp/omexmeta/RDFTests.cpp +++ b/tests/cpp/omexmeta/RDFTests.cpp @@ -411,12 +411,22 @@ TEST_F(RDFTests, TestBagConversion) { " bqmodel:is , , ;\n" " bqmodel:isDescribedBy ;\n" " [\n" - " \"EMBL-EBI\", \"\"\"Institute of Biochemistry and Biology, University of Potsdam, 14476\n" + " \"EMBL-EBI\" ;\n" + " \"Chelliah\" ;\n" + " \"Vijayalakshmi\" ;\n" + " \"viji@ebi.ac.uk\"\n" + " ], [\n" + " \"\"\"Institute of Biochemistry and Biology, University of Potsdam, 14476\n" " Potsdam, Germany\n" - " \"\"\", \"Max-Planck-Institute of Molecular Plant Physiology\" ;\n" - " \"Arnold\", \"Chelliah\", \"Nikoloski\" ;\n" - " \"Anne\", \"Vijayalakshmi\", \"Zoran\" ;\n" - " \"arnold@mpimp-golm.mpg.de\", \"nikoloski@mpimp-golm.mpg.de\", \"viji@ebi.ac.uk\"\n" + " \"\"\" ;\n" + " \"Nikoloski\" ;\n" + " \"Zoran\" ;\n" + " \"nikoloski@mpimp-golm.mpg.de\"\n" + " ], [\n" + " \"Max-Planck-Institute of Molecular Plant Physiology\" ;\n" + " \"Arnold\" ;\n" + " \"Anne\" ;\n" + " \"arnold@mpimp-golm.mpg.de\"\n" " ] ;\n" " [\n" " \"2011-10-19T14:51:13Z\"\n" @@ -424,7 +434,7 @@ TEST_F(RDFTests, TestBagConversion) { " [\n" " \"2012-04-20T19:52:45Z\"\n" " ] ."; - ASSERT_TRUE(RDF::equals(&rdf, expected, "turtle")); + ASSERT_TRUE(RDF::equals(&rdf, expected, "turtle", true)); } From b00829b16e7517dbb93ef367ac935351a515b50f Mon Sep 17 00:00:00 2001 From: Ciaran Welsh Date: Wed, 28 Apr 2021 11:24:51 +0100 Subject: [PATCH 3/4] increment version to 1.2.7 --- CMakeLists.txt | 2 +- src/pyomexmeta/VERSION.txt | 2 +- tests/cpp/omexmeta/RDFTests.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cf0f1431e..3e96654541 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.15) # Set version. set(VERSION_MAJOR 1) set(VERSION_MINOR 2) -set(VERSION_MICRO 6) +set(VERSION_MICRO 7) set(LIBOMEXMETA_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}) configure_file(VERSION.txt.in VERSION.txt) diff --git a/src/pyomexmeta/VERSION.txt b/src/pyomexmeta/VERSION.txt index 3c43790f5d..c04c650a7a 100644 --- a/src/pyomexmeta/VERSION.txt +++ b/src/pyomexmeta/VERSION.txt @@ -1 +1 @@ -1.2.6 +1.2.7 diff --git a/tests/cpp/omexmeta/RDFTests.cpp b/tests/cpp/omexmeta/RDFTests.cpp index 4bc3b6da07..a0a86426c1 100644 --- a/tests/cpp/omexmeta/RDFTests.cpp +++ b/tests/cpp/omexmeta/RDFTests.cpp @@ -320,7 +320,7 @@ TEST_F(RDFTests, TestSerializeCellMlAnnotationNoTrailingHashes) { " bqbiol:hasTaxon ;\n" " dc:creator ."; ASSERT_TRUE(RDF::equals(&rdf, expected)); -} + class ParserReadTesReadFromFileHasPrefixesTests : public ::testing::Test { From 695e74f8cdaf8eff0c42ca6161a3fd68c9b449a2 Mon Sep 17 00:00:00 2001 From: Ciaran Welsh Date: Wed, 28 Apr 2021 12:50:14 +0100 Subject: [PATCH 4/4] fix accidental removal of end brace in test --- tests/cpp/omexmeta/RDFTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cpp/omexmeta/RDFTests.cpp b/tests/cpp/omexmeta/RDFTests.cpp index 06fc1201fe..0cdaf4f929 100644 --- a/tests/cpp/omexmeta/RDFTests.cpp +++ b/tests/cpp/omexmeta/RDFTests.cpp @@ -321,7 +321,7 @@ TEST_F(RDFTests, TestSerializeCellMlAnnotationNoTrailingHashes) { " bqbiol:hasTaxon ;\n" " dc:creator ."; ASSERT_TRUE(RDF::equals(&rdf, expected)); - +} TEST_F(RDFTests, TestBagConversion) { std::string input = "