<s>
LibSBML	B-Language
is	O
an	O
open-source	B-Application
software	I-Application
library	B-Library
that	O
provides	O
an	O
application	B-Application
programming	I-Application
interface	I-Application
(	O
API	B-Application
)	O
for	O
the	O
SBML	O
(	O
Systems	O
Biology	O
Markup	O
Language	O
)	O
format	O
.	O
</s>
<s>
The	O
libSBML	B-Language
library	B-Library
can	O
be	O
embedded	O
in	O
a	O
software	B-Application
application	I-Application
or	O
used	O
in	O
a	O
web	O
servlet	B-Application
(	O
such	O
as	O
one	O
that	O
might	O
be	O
served	O
by	O
Apache	B-Language
Tomcat	I-Language
)	O
as	O
part	O
of	O
the	O
application	O
or	O
servlet	B-Application
's	O
implementation	O
of	O
support	O
for	O
reading	O
,	O
writing	O
,	O
and	O
manipulating	O
SBML	O
documents	O
and	O
data	O
streams	O
.	O
</s>
<s>
The	O
core	O
of	O
libSBML	B-Language
is	O
written	O
in	O
ISO	O
standard	O
C++	B-Language
;	O
the	O
library	B-Library
provides	O
API	B-Application
for	O
many	O
programming	O
languages	O
via	O
interfaces	O
generated	O
with	O
the	O
help	O
of	O
SWIG	B-Application
.	O
</s>
<s>
The	O
libSBML	B-Language
library	B-Library
is	O
free	B-Application
software	I-Application
released	O
under	O
the	O
terms	O
of	O
the	O
GNU	B-Application
Lesser	I-Application
General	I-Application
Public	I-Application
License	I-Application
as	O
published	O
by	O
the	B-Operating_System
Free	I-Operating_System
Software	I-Operating_System
Foundation	I-Operating_System
;	O
either	O
version	O
2.1	O
of	O
the	O
License	O
,	O
or	O
any	O
later	O
version	O
.	O
</s>
<s>
LibSBML	B-Language
was	O
developed	O
thanks	O
to	O
funding	O
from	O
many	O
agencies	O
,	O
particularly	O
the	O
National	O
Institute	O
of	O
General	O
Medical	O
Sciences	O
(	O
NIGMS	O
,	O
USA	O
)	O
as	O
well	O
as	O
the	O
Defense	O
Advanced	O
Research	O
Projects	O
Agency	O
(	O
DARPA	O
,	O
USA	O
)	O
under	O
the	O
program	O
.	O
</s>
<s>
The	O
Systems	O
Biology	O
Markup	O
Language	O
(	O
SBML	O
)	O
is	O
an	O
XML-based	O
format	O
for	O
encoding	O
computational	B-Application
models	I-Application
of	O
a	O
sort	O
common	O
in	O
systems	O
biology	O
.	O
</s>
<s>
Although	O
SBML	O
is	O
based	O
upon	O
XML	B-Protocol
,	O
and	O
thus	O
software	O
developers	O
could	O
support	O
SBML	O
using	O
off-the-shelf	O
XML	B-Protocol
parser	I-Protocol
libraries	O
,	O
libSBML	B-Language
offers	O
numerous	O
advantages	O
that	O
make	O
it	O
easier	O
for	O
developers	O
to	O
implement	O
support	O
for	O
SBML	O
in	O
their	O
software	O
.	O
</s>
<s>
The	O
premise	O
behind	O
the	O
development	O
of	O
libSBML	B-Language
is	O
that	O
it	O
is	O
more	O
convenient	O
and	O
efficient	O
for	O
developers	O
to	O
start	O
with	O
a	O
higher-level	O
API	B-Application
tailored	O
specifically	O
to	O
SBML	O
and	O
its	O
distinctive	O
features	O
than	O
it	O
is	O
to	O
start	O
with	O
a	O
plain	O
XML	B-Protocol
parser	I-Protocol
library	B-Library
.	O
</s>
<s>
The	O
following	O
is	O
a	O
partial	O
list	O
of	O
libSBML	B-Language
's	O
features	O
:	O
</s>
<s>
Supports	O
all	O
Levels	O
and	O
Versions	O
of	O
SBML	O
with	O
common	O
API	B-Application
classes	O
and	O
methods	O
,	O
thus	O
smoothing	O
the	O
differences	O
between	O
different	O
flavors	O
of	O
SBML	O
from	O
the	O
perspective	O
of	O
the	O
application	B-Application
software	I-Application
.	O
</s>
<s>
Provides	O
facilities	O
for	O
manipulating	O
mathematical	O
formulas	O
in	O
both	O
text-string	O
format	O
and	O
MathML	B-Language
2.0	O
format	O
,	O
as	O
well	O
as	O
the	O
ability	O
to	O
interconvert	O
mathematical	O
expressions	O
between	O
these	O
forms	O
.	O
</s>
<s>
Internally	O
,	O
libSBML	B-Language
uses	O
familiar	O
Abstract	B-Data_Structure
Syntax	I-Data_Structure
Trees	I-Data_Structure
(	O
ASTs	O
)	O
to	O
represent	O
formulas	O
,	O
and	O
provides	O
AST-oriented	O
methods	O
for	O
calling	O
applications	O
.	O
</s>
<s>
Performs	O
validation	O
of	O
XML	B-Protocol
and	O
SBML	O
at	O
the	O
time	O
of	O
parsing	O
files	O
and	O
data	O
streams	O
.	O
</s>
<s>
LibSBML	B-Language
implements	O
a	O
thorough	O
system	O
for	O
dimensional	O
analysis	O
and	O
checking	O
units	O
of	O
quantities	O
in	O
a	O
model	O
.	O
</s>
<s>
The	O
formats	O
and	O
standards	O
supported	O
by	O
libSBML	B-Language
include	O
MIRIAM	O
(	O
Minimal	O
Information	O
Requested	O
in	O
the	O
Annotation	O
of	O
a	O
Model	O
)	O
and	O
SBO	O
(	O
the	O
Systems	O
Biology	O
Ontology	O
)	O
.	O
</s>
<s>
Supports	O
transparently	O
reading	O
and	O
writing	O
compressed	O
files	O
in	O
the	O
ZIP	B-General_Concept
,	O
GZIP	B-Application
and	O
BZIP	B-Application
formats	O
.	O
</s>
<s>
Provides	O
interfaces	O
for	O
the	O
C	B-Language
,	O
C++	B-Language
,	O
C#	B-Application
,	O
Java	B-Language
,	O
Python	B-Language
,	O
Perl	B-Language
,	O
MATLAB	B-Language
,	O
Octave	B-Language
,	O
and	O
Ruby	B-Language
programming	I-Language
languages	I-Language
.	O
</s>
<s>
The	O
C	B-Language
and	O
C++	B-Language
interfaces	O
are	O
implemented	O
natively	O
;	O
the	O
C#	B-Application
,	O
Java	B-Language
,	O
Perl	B-Language
,	O
Python	B-Language
,	O
and	O
Ruby	B-Language
interfaces	O
are	O
implemented	O
using	O
SWIG	B-Application
,	O
the	O
Simplified	O
Wrapper	O
Interface	O
Generator	O
;	O
and	O
the	O
MATLAB	B-Language
and	O
Octave	B-Language
interfaces	O
are	O
implemented	O
through	O
custom	O
hand-written	O
code	O
.	O
</s>
<s>
Some	O
further	O
explanations	O
may	O
be	O
warranted	O
concerning	O
libSBML	B-Language
's	O
support	O
for	O
working	O
with	O
mathematical	O
formulas	O
.	O
</s>
<s>
In	O
SBML	O
Level1	O
,	O
mathematical	O
formulas	O
are	O
represented	O
as	O
text	O
strings	O
using	O
a	O
C-like	O
syntax	O
.	O
</s>
<s>
Rather	O
than	O
growing	O
the	O
simple	O
C-like	O
syntax	O
into	O
something	O
more	O
complicated	O
and	O
esoteric	O
in	O
order	O
to	O
support	O
these	O
features	O
,	O
and	O
consequently	O
having	O
to	O
manage	O
two	O
standards	O
in	O
two	O
different	O
formats	O
(	O
XML	B-Protocol
and	O
text	O
string	O
formulas	O
)	O
,	O
SBML	O
Levels2	O
and3	O
leverage	O
an	O
existing	O
standard	O
for	O
expressing	O
mathematical	O
formulas	O
,	O
namely	O
the	O
content	O
portion	O
of	O
MathML	B-Language
.	O
</s>
<s>
As	O
mentioned	O
above	O
,	O
LibSBML	B-Language
provides	O
an	O
abstraction	O
for	O
working	O
with	O
mathematical	O
expressions	O
in	O
both	O
text-string	O
and	O
MathML	B-Language
form	O
:	O
Abstract	B-Data_Structure
Syntax	I-Data_Structure
Trees	I-Data_Structure
(	O
ASTs	O
)	O
.	O
</s>
<s>
Abstract	B-Data_Structure
Syntax	I-Data_Structure
Trees	I-Data_Structure
are	O
well	O
known	O
in	O
the	O
computer	O
science	O
community	O
;	O
they	O
are	O
simple	O
recursive	O
data	O
structures	O
useful	O
for	O
representing	O
the	O
syntactic	O
structure	O
of	O
sentences	O
in	O
certain	O
kinds	O
of	O
languages	O
(	O
mathematical	O
or	O
otherwise	O
)	O
.	O
</s>
<s>
Much	O
as	O
libSBML	B-Language
allows	O
programmers	O
to	O
manipulate	O
SBML	O
at	O
the	O
level	O
of	O
domain-specific	O
objects	O
,	O
regardless	O
of	O
SBML	O
Level	O
or	O
version	O
,	O
it	O
also	O
allows	O
programmers	O
to	O
work	O
with	O
mathematical	O
formula	O
at	O
the	O
level	O
of	O
ASTs	O
regardless	O
of	O
whether	O
the	O
original	O
format	O
was	O
C-like	O
infix	O
or	O
MathML	B-Language
.	O
</s>
<s>
LibSBML	B-Language
goes	O
one	O
step	O
further	O
by	O
allowing	O
programmers	O
to	O
work	O
exclusively	O
with	O
infix	O
formula	O
strings	O
and	O
instantly	O
convert	O
them	O
to	O
the	O
appropriate	O
MathML	B-Language
whenever	O
needed	O
.	O
</s>
<s>
LibSBML	B-Language
requires	O
a	O
separate	O
library	B-Library
to	O
do	O
low-level	O
read/write	O
operations	O
on	O
XML	B-Protocol
.	O
</s>
<s>
It	O
can	O
use	O
any	O
one	O
of	O
three	O
XML	B-Protocol
parser	I-Protocol
libraries	O
:	O
Xerces	B-Language
,	O
expat	B-Language
or	O
libxml2	B-Application
.	O
</s>
<s>
Users	O
can	O
specify	O
which	O
library	B-Library
they	O
wish	O
to	O
use	O
at	O
libSBML	B-Language
compilation	O
time	O
.	O
</s>
<s>
LibSBML	B-Language
hides	O
the	O
differences	O
between	O
these	O
parser	O
libraries	O
behind	O
an	O
abstraction	O
layer	O
;	O
it	O
seamlessly	O
uses	O
whichever	O
library	B-Library
against	O
which	O
a	O
given	O
instance	O
of	O
libSBML	B-Language
has	O
been	O
compiled	O
.	O
</s>
<s>
(	O
However	O
,	O
released	O
binary	O
distributions	O
of	O
libSBML	B-Language
all	O
make	O
use	O
of	O
the	O
libxml2	B-Application
library	B-Library
.	O
)	O
</s>
<s>
LibSBML	B-Language
uses	O
software	O
objects	O
(	O
i.e.	O
,	O
instances	O
of	O
classes	O
)	O
that	O
correspond	O
to	O
SBML	O
components	O
,	O
with	O
member	B-Application
variables	I-Application
representing	O
the	O
attributes	O
of	O
the	O
corresponding	O
SBML	O
objects	O
.	O
</s>
<s>
The	O
libSBML	B-Language
API	B-Application
is	O
constructed	O
to	O
provide	O
an	O
intuitive	O
way	O
of	O
relating	O
SBML	O
and	O
the	O
code	O
needed	O
to	O
create	O
or	O
manipulate	O
it	O
with	O
a	O
class	O
hierarchy	O
that	O
mimics	O
the	O
SBML	O
structure	O
.	O
</s>
<s>
More	O
information	O
about	O
the	O
libSBML	B-Language
objects	O
is	O
available	O
in	O
the	O
.	O
</s>
<s>
LibSBML	B-Language
enables	O
reading	O
from	O
and	O
writing	O
to	O
either	O
files	O
or	O
strings	O
.	O
</s>
<s>
Once	O
an	O
SBML	O
document	O
is	O
read	O
,	O
libSBML	B-Language
stores	O
the	O
SBML	O
content	O
in	O
an	O
SBMLDocument	O
object	O
.	O
</s>
<s>
The	O
following	O
is	O
an	O
example	O
written	O
in	O
Python	B-Language
:	O
</s>
<s>
The	O
libSBML	B-Language
API	B-Application
allows	O
easy	O
creation	O
of	O
objects	O
and	O
subobjects	O
representing	O
SBML	O
elements	O
and	O
the	O
subelements	O
contained	O
within	O
them	O
.	O
</s>
<s>
The	O
following	O
is	O
an	O
example	O
written	O
in	O
C++	B-Language
:	O
</s>
<s>
These	O
are	O
stored	O
as	O
member	B-Application
variables	I-Application
of	O
a	O
given	O
class	O
,	O
and	O
libSBML	B-Language
provides	O
functions	O
to	O
retrieve	O
and	O
query	O
these	O
values	O
.	O
</s>
<s>
The	O
syntax	O
of	O
these	O
functions	O
is	O
consistent	O
throughout	O
libSBML	B-Language
.	O
</s>
<s>
The	O
following	O
is	O
an	O
example	O
written	O
in	O
Python	B-Language
:	O
</s>
