Skip to content

Commit

Permalink
Merge pull request #69 from sys-bio/develop
Browse files Browse the repository at this point in the history
Merge version 1.2.7 from develop into master
  • Loading branch information
Ciaran Welsh committed Apr 28, 2021
2 parents 9713b60 + 695e74f commit 51b7b5f
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 33 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,8 @@ stages:
ParallelCount: 8


- stage: GenerateManyLinuxPipWheel
displayName: GenerateManyLinuxPipWheel
- stage: ManyLinux2014
displayName: ManyLinux2014
dependsOn: []
jobs:
- job:
Expand Down
27 changes: 21 additions & 6 deletions src/omexmeta/PurgeRDFBag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/omexmeta/include/omexmeta/Predicate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/omexmeta/include/omexmeta/PurgeRDFBag.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ namespace omexmeta {

private:
RDF* rdf_;
unsigned int currentBlankId_;
};
}// namespace omexmeta

Expand Down
3 changes: 2 additions & 1 deletion src/omexmeta/include/omexmeta/VCardTranslator.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ namespace omexmeta {
*/
void translateEmail();


RDF *rdf_;

unsigned int currentBlankId = 0;
};


Expand Down
2 changes: 1 addition & 1 deletion src/pyomexmeta/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.6
1.2.7
49 changes: 34 additions & 15 deletions tests/cpp/omexmeta/PurgeRDFBagTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,28 @@ TEST_F(PurgeRDFBagTests, WithRDFBagLists) {
"\n"
"<http://omex-library.org/NewOmex.omex/NewModel.xml#_272044>\n"
" <http://purl.org/dc/elements/1.1/creator> [\n"
" <http://xmlns.com/foaf/0.1/Organization> \"EMBL-EBI\", \"\"\"Institute of Biochemistry and Biology, University of Potsdam, 14476\n"
" <http://xmlns.com/foaf/0.1/Organization> \"EMBL-EBI\" ;\n"
" <http://xmlns.com/foaf/0.1/familyName> \"Chelliah\" ;\n"
" <http://xmlns.com/foaf/0.1/givenName> \"Vijayalakshmi\" ;\n"
" <http://xmlns.com/foaf/0.1/mbox> \"viji@ebi.ac.uk\"\n"
" ], [\n"
" <http://xmlns.com/foaf/0.1/Organization> \"\"\"Institute of Biochemistry and Biology, University of Potsdam, 14476\n"
" Potsdam, Germany\n"
" \"\"\", \"Max-Planck-Institute of Molecular Plant Physiology\" ;\n"
" <http://xmlns.com/foaf/0.1/familyName> \"Arnold\", \"Chelliah\", \"Nikoloski\" ;\n"
" <http://xmlns.com/foaf/0.1/givenName> \"Anne\", \"Vijayalakshmi\", \"Zoran\" ;\n"
" <http://xmlns.com/foaf/0.1/mbox> \"arnold@mpimp-golm.mpg.de\", \"nikoloski@mpimp-golm.mpg.de\", \"viji@ebi.ac.uk\"\n"
" \"\"\" ;\n"
" <http://xmlns.com/foaf/0.1/familyName> \"Nikoloski\" ;\n"
" <http://xmlns.com/foaf/0.1/givenName> \"Zoran\" ;\n"
" <http://xmlns.com/foaf/0.1/mbox> \"nikoloski@mpimp-golm.mpg.de\"\n"
" ], [\n"
" <http://xmlns.com/foaf/0.1/Organization> \"Max-Planck-Institute of Molecular Plant Physiology\" ;\n"
" <http://xmlns.com/foaf/0.1/familyName> \"Arnold\" ;\n"
" <http://xmlns.com/foaf/0.1/givenName> \"Anne\" ;\n"
" <http://xmlns.com/foaf/0.1/mbox> \"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) {
Expand All @@ -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: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n"
"@prefix bqmodel: <http://biomodels.net/model-qualifiers/> .\n"
"@prefix bqbiol: <http://biomodels.net/biology-qualifiers/> .\n"
Expand All @@ -228,12 +237,22 @@ TEST_F(PurgeRDFBagTests, Both) {
" bqmodel:is <http://identifiers.org/biomodels.db/BIOMD0000000385>, <http://identifiers.org/biomodels.db/MODEL1109270001>, <http://identifiers.org/obo.go/GO:0019253> ;\n"
" bqmodel:isDescribedBy <http://identifiers.org/pubmed/22001849> ;\n"
" <http://purl.org/dc/elements/1.1/creator> [\n"
" <http://xmlns.com/foaf/0.1/Organization> \"EMBL-EBI\", \"\"\"Institute of Biochemistry and Biology, University of Potsdam, 14476\n"
" <http://xmlns.com/foaf/0.1/Organization> \"EMBL-EBI\" ;\n"
" <http://xmlns.com/foaf/0.1/familyName> \"Chelliah\" ;\n"
" <http://xmlns.com/foaf/0.1/givenName> \"Vijayalakshmi\" ;\n"
" <http://xmlns.com/foaf/0.1/mbox> \"viji@ebi.ac.uk\"\n"
" ], [\n"
" <http://xmlns.com/foaf/0.1/Organization> \"\"\"Institute of Biochemistry and Biology, University of Potsdam, 14476\n"
" Potsdam, Germany\n"
" \"\"\", \"Max-Planck-Institute of Molecular Plant Physiology\" ;\n"
" <http://xmlns.com/foaf/0.1/familyName> \"Arnold\", \"Chelliah\", \"Nikoloski\" ;\n"
" <http://xmlns.com/foaf/0.1/givenName> \"Anne\", \"Vijayalakshmi\", \"Zoran\" ;\n"
" <http://xmlns.com/foaf/0.1/mbox> \"arnold@mpimp-golm.mpg.de\", \"nikoloski@mpimp-golm.mpg.de\", \"viji@ebi.ac.uk\"\n"
" \"\"\" ;\n"
" <http://xmlns.com/foaf/0.1/familyName> \"Nikoloski\" ;\n"
" <http://xmlns.com/foaf/0.1/givenName> \"Zoran\" ;\n"
" <http://xmlns.com/foaf/0.1/mbox> \"nikoloski@mpimp-golm.mpg.de\"\n"
" ], [\n"
" <http://xmlns.com/foaf/0.1/Organization> \"Max-Planck-Institute of Molecular Plant Physiology\" ;\n"
" <http://xmlns.com/foaf/0.1/familyName> \"Arnold\" ;\n"
" <http://xmlns.com/foaf/0.1/givenName> \"Anne\" ;\n"
" <http://xmlns.com/foaf/0.1/mbox> \"arnold@mpimp-golm.mpg.de\"\n"
" ] ;\n"
" <http://purl.org/dc/terms/created> [\n"
" <http://purl.org/dc/terms/W3CDTF> \"2011-10-19T14:51:13Z\"\n"
Expand Down
22 changes: 16 additions & 6 deletions tests/cpp/omexmeta/RDFTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,20 +411,30 @@ TEST_F(RDFTests, TestBagConversion) {
" bqmodel:is <http://identifiers.org/biomodels.db/BIOMD0000000385>, <http://identifiers.org/biomodels.db/MODEL1109270001>, <http://identifiers.org/obo.go/GO:0019253> ;\n"
" bqmodel:isDescribedBy <http://identifiers.org/pubmed/22001849> ;\n"
" <http://purl.org/dc/elements/1.1/creator> [\n"
" <http://xmlns.com/foaf/0.1/Organization> \"EMBL-EBI\", \"\"\"Institute of Biochemistry and Biology, University of Potsdam, 14476\n"
" <http://xmlns.com/foaf/0.1/Organization> \"EMBL-EBI\" ;\n"
" <http://xmlns.com/foaf/0.1/familyName> \"Chelliah\" ;\n"
" <http://xmlns.com/foaf/0.1/givenName> \"Vijayalakshmi\" ;\n"
" <http://xmlns.com/foaf/0.1/mbox> \"viji@ebi.ac.uk\"\n"
" ], [\n"
" <http://xmlns.com/foaf/0.1/Organization> \"\"\"Institute of Biochemistry and Biology, University of Potsdam, 14476\n"
" Potsdam, Germany\n"
" \"\"\", \"Max-Planck-Institute of Molecular Plant Physiology\" ;\n"
" <http://xmlns.com/foaf/0.1/familyName> \"Arnold\", \"Chelliah\", \"Nikoloski\" ;\n"
" <http://xmlns.com/foaf/0.1/givenName> \"Anne\", \"Vijayalakshmi\", \"Zoran\" ;\n"
" <http://xmlns.com/foaf/0.1/mbox> \"arnold@mpimp-golm.mpg.de\", \"nikoloski@mpimp-golm.mpg.de\", \"viji@ebi.ac.uk\"\n"
" \"\"\" ;\n"
" <http://xmlns.com/foaf/0.1/familyName> \"Nikoloski\" ;\n"
" <http://xmlns.com/foaf/0.1/givenName> \"Zoran\" ;\n"
" <http://xmlns.com/foaf/0.1/mbox> \"nikoloski@mpimp-golm.mpg.de\"\n"
" ], [\n"
" <http://xmlns.com/foaf/0.1/Organization> \"Max-Planck-Institute of Molecular Plant Physiology\" ;\n"
" <http://xmlns.com/foaf/0.1/familyName> \"Arnold\" ;\n"
" <http://xmlns.com/foaf/0.1/givenName> \"Anne\" ;\n"
" <http://xmlns.com/foaf/0.1/mbox> \"arnold@mpimp-golm.mpg.de\"\n"
" ] ;\n"
" <http://purl.org/dc/terms/created> [\n"
" <http://purl.org/dc/terms/W3CDTF> \"2011-10-19T14:51:13Z\"\n"
" ] ;\n"
" <http://purl.org/dc/terms/modified> [\n"
" <http://purl.org/dc/terms/W3CDTF> \"2012-04-20T19:52:45Z\"\n"
" ] .";
ASSERT_TRUE(RDF::equals(&rdf, expected, "turtle"));
ASSERT_TRUE(RDF::equals(&rdf, expected, "turtle", true));
}


Expand Down

0 comments on commit 51b7b5f

Please sign in to comment.