|
1 | | -// Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the |
2 | | -// University of Virginia, University of Heidelberg, and University |
3 | | -// of Connecticut School of Medicine. |
4 | | -// All rights reserved. |
5 | | - |
6 | | -// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual |
7 | | -// Properties, Inc., University of Heidelberg, and University of |
8 | | -// of Connecticut School of Medicine. |
9 | | -// All rights reserved. |
10 | | - |
11 | | -// Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual |
12 | | -// Properties, Inc., University of Heidelberg, and The University |
13 | | -// of Manchester. |
14 | | -// All rights reserved. |
15 | | - |
16 | | -// Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual |
17 | | -// Properties, Inc., EML Research, gGmbH, University of Heidelberg, |
18 | | -// and The University of Manchester. |
19 | | -// All rights reserved. |
20 | | - |
21 | | -// Copyright (C) 2007 by Pedro Mendes, Virginia Tech Intellectual |
22 | | -// Properties, Inc. and EML Research, gGmbH. |
23 | | -// All rights reserved. |
| 1 | +// Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the |
| 2 | +// University of Virginia, University of Heidelberg, and University |
| 3 | +// of Connecticut School of Medicine. |
| 4 | +// All rights reserved. |
| 5 | + |
| 6 | +// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual |
| 7 | +// Properties, Inc., University of Heidelberg, and University of |
| 8 | +// of Connecticut School of Medicine. |
| 9 | +// All rights reserved. |
| 10 | + |
| 11 | +// Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual |
| 12 | +// Properties, Inc., University of Heidelberg, and The University |
| 13 | +// of Manchester. |
| 14 | +// All rights reserved. |
| 15 | + |
| 16 | +// Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual |
| 17 | +// Properties, Inc., EML Research, gGmbH, University of Heidelberg, |
| 18 | +// and The University of Manchester. |
| 19 | +// All rights reserved. |
| 20 | + |
| 21 | +// Copyright (C) 2007 by Pedro Mendes, Virginia Tech Intellectual |
| 22 | +// Properties, Inc. and EML Research, gGmbH. |
| 23 | +// All rights reserved. |
24 | 24 |
|
25 | 25 | #include <iostream> |
26 | 26 | #include <fstream> |
|
29 | 29 | #include "copasi/copasi.h" |
30 | 30 |
|
31 | 31 | #include "copasi/MIRIAM/CModelMIRIAMInfo.h" |
32 | | -#include "copasi/MIRIAM/CRDFWriter.h" |
33 | 32 | #include "copasi/MIRIAM/CRDFLiteral.h" |
| 33 | +#include "copasi/MIRIAM/CRDFWriter.h" |
34 | 34 | #include "copasi/MIRIAM/CRDFParser.h" |
35 | 35 | #include "copasi/MIRIAM/CConstants.h" |
36 | 36 | #include "copasi/MIRIAM/CRDFObject.h" |
@@ -527,7 +527,11 @@ void CMIRIAMInfo::load(CDataContainer * pObject) |
527 | 527 | if (mpAnnotation != NULL && |
528 | 528 | !mpAnnotation->getMiriamAnnotation().empty()) |
529 | 529 | { |
| 530 | + #ifdef COPASI_USE_RAPTOR |
530 | 531 | mpRDFGraph = CRDFParser::graphFromXml(mpAnnotation->getMiriamAnnotation()); |
| 532 | + #else |
| 533 | + mpRDFGraph = CRDFGraph::fromString(mpAnnotation->getMiriamAnnotation()); |
| 534 | + #endif |
531 | 535 | } |
532 | 536 |
|
533 | 537 | if (mpRDFGraph == NULL) |
@@ -564,8 +568,11 @@ bool CMIRIAMInfo::save() |
564 | 568 | { |
565 | 569 | mpRDFGraph->clean(); |
566 | 570 | mpRDFGraph->updateNamespaces(); |
567 | | - |
| 571 | +#ifdef COPASI_USE_RAPTOR |
568 | 572 | mpAnnotation->setMiriamAnnotation(CRDFWriter::xmlFromGraph(mpRDFGraph), mpAnnotation->getKey(), mpAnnotation->getKey()); |
| 573 | +#else |
| 574 | + mpAnnotation->setMiriamAnnotation(mpRDFGraph->toXmlString(), mpAnnotation->getKey(), mpAnnotation->getKey()); |
| 575 | +#endif |
569 | 576 |
|
570 | 577 | return true; |
571 | 578 | } |
|
0 commit comments