@@ -1229,6 +1229,54 @@ class LIBSBML_EXTERN SBase
12291229 * @see unsetAnnotation()
12301230 */
12311231 virtual int setAnnotation (const XMLNode* annotation);
1232+
1233+ /* *
1234+ * Sets the value of the "annotation" subelement of this SBML object.
1235+ *
1236+ * The content of @p annotation is copied, and any previous content of
1237+ * this object's "annotation" subelement is deleted.
1238+ *
1239+ * Whereas the SBase "notes" subelement is a container for content to be
1240+ * shown directly to humans, the "annotation" element is a container for
1241+ * optional software-generated content @em not meant to be shown to
1242+ * humans. Every object derived from SBase can have its own value for
1243+ * "annotation". The element's content type is <a target="_blank"
1244+ * href="http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls">XML type
1245+ * "any"</a>, allowing essentially arbitrary well-formed XML data
1246+ * content.
1247+ *
1248+ * SBML places a few restrictions on the organization of the content of
1249+ * annotations; these are intended to help software tools read and write
1250+ * the data as well as help reduce conflicts between annotations added by
1251+ * different tools. Please see the SBML specifications for more details.
1252+ *
1253+ * Call this method will result in any existing content of the
1254+ * "annotation" subelement to be discarded. Unless you have taken steps
1255+ * to first copy and reconstitute any existing annotations into the @p
1256+ * annotation that is about to be assigned, it is likely that performing
1257+ * such wholesale replacement is unfriendly towards other software
1258+ * applications whose annotations are discarded. An alternative may be
1259+ * to use SBase::appendAnnotation(const XMLNode* annotation) or
1260+ * SBase::appendAnnotation(const std::string& annotation).
1261+ *
1262+ * @param annotation an XML structure that is to be used as the new content
1263+ * of the "annotation" subelement of this object.
1264+ *
1265+ * @param parseRdf if true, the annotation will be parsed for RDF content.
1266+ * This should only be set, if the RDF follows the subset described in the
1267+ * SBML specification.
1268+ *
1269+ * @copydetails doc_returns_one_success_code
1270+ * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1271+ *
1272+ * @see getAnnotationString()
1273+ * @see isSetAnnotation()
1274+ * @see setAnnotation(const std::string& annotation)
1275+ * @see appendAnnotation(const XMLNode* annotation)
1276+ * @see appendAnnotation(const std::string& annotation)
1277+ * @see unsetAnnotation()
1278+ */
1279+ virtual int setAnnotation (const XMLNode* annotation, bool parseRdf);
12321280
12331281
12341282 /* *
@@ -1262,6 +1310,55 @@ class LIBSBML_EXTERN SBase
12621310 *
12631311 * @param annotation an XML string that is to be used as the content
12641312 * of the "annotation" subelement of this object.
1313+ *
1314+ * @copydetails doc_returns_success_code
1315+ * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1316+ * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1317+ *
1318+ * @see getAnnotationString()
1319+ * @see isSetAnnotation()
1320+ * @see setAnnotation(const XMLNode* annotation)
1321+ * @see appendAnnotation(const XMLNode* annotation)
1322+ * @see appendAnnotation(const std::string& annotation)
1323+ * @see unsetAnnotation()
1324+ */
1325+ virtual int setAnnotation (const std::string& annotation);
1326+
1327+ /* *
1328+ * Sets the value of the "annotation" subelement of this SBML object.
1329+ *
1330+ * The content of @p annotation is copied, and any previous content of
1331+ * this object's "annotation" subelement is deleted.
1332+ *
1333+ * Whereas the SBase "notes" subelement is a container for content to be
1334+ * shown directly to humans, the "annotation" element is a container for
1335+ * optional software-generated content @em not meant to be shown to
1336+ * humans. Every object derived from SBase can have its own value for
1337+ * "annotation". The element's content type is <a target="_blank"
1338+ * href="http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls">XML type
1339+ * "any"</a>, allowing essentially arbitrary well-formed XML data
1340+ * content.
1341+ *
1342+ * SBML places a few restrictions on the organization of the content of
1343+ * annotations; these are intended to help software tools read and write
1344+ * the data as well as help reduce conflicts between annotations added by
1345+ * different tools. Please see the SBML specifications for more details.
1346+ *
1347+ * Call this method will result in any existing content of the
1348+ * "annotation" subelement to be discarded. Unless you have taken steps
1349+ * to first copy and reconstitute any existing annotations into the @p
1350+ * annotation that is about to be assigned, it is likely that performing
1351+ * such wholesale replacement is unfriendly towards other software
1352+ * applications whose annotations are discarded. An alternative may be
1353+ * to use SBase::appendAnnotation(const XMLNode* annotation) or
1354+ * SBase::appendAnnotation(const std::string& annotation).
1355+ *
1356+ * @param annotation an XML string that is to be used as the content
1357+ * of the "annotation" subelement of this object.
1358+ *
1359+ * @param parseRdf if true, the annotation will be parsed for RDF content.
1360+ * This should only be set, if the RDF follows the subset described in the
1361+ * SBML specification.
12651362 *
12661363 * @copydetails doc_returns_success_code
12671364 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
@@ -1274,7 +1371,7 @@ class LIBSBML_EXTERN SBase
12741371 * @see appendAnnotation(const std::string& annotation)
12751372 * @see unsetAnnotation()
12761373 */
1277- virtual int setAnnotation (const std::string& annotation);
1374+ virtual int setAnnotation (const std::string& annotation, bool parseRdf );
12781375
12791376
12801377 /* *
@@ -2313,7 +2410,9 @@ s.setNotes("<body xmlns='http://www.w3.org/1999/xhtml'><p>here is my note</p></b
23132410
23142411 /* *
23152412 * Returns a string consisting of a partial SBML corresponding to just
2316- * this object.
2413+ * this object.
2414+ *
2415+ * The string is owned by the caller and has to be freed manualy.
23172416 *
23182417 * @return the partial SBML that describes this SBML object.
23192418 *
@@ -2323,6 +2422,18 @@ s.setNotes("<body xmlns='http://www.w3.org/1999/xhtml'><p>here is my note</p></b
23232422 */
23242423 char * toSBML ();
23252424
2425+ /* *
2426+ * Returns a string consisting of a partial SBML corresponding to just
2427+ * this object.
2428+ *
2429+ * @return the partial SBML that describes this SBML object.
2430+ *
2431+ * @warning <span class="warning">This is primarily provided for testing
2432+ * and debugging purposes. It may be removed in a future version of
2433+ * libSBML.</span>
2434+ */
2435+ std::string toSBMLString ();
2436+
23262437
23272438 /* *
23282439 * Returns this element as an XMLNode.
0 commit comments