Serializing RDF Graphs
Serializing is just a fancy term for writing the information in an RDF graph to a string or file. There are several syntaxes that are supported by libOmexMeta, including:
ntriples, turtle, rdfxml-xmp, rdfxml-abbrev, rdfxml, dot, json-triples, json, nquads, html
Writing to string
Write to a string in Python
from pyomexmeta import RDF, eUriType
turtle_string = """@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix bqbiol: <http://biomodels.net/biology-qualifiers/> .
@prefix OMEXlib: <http://omex-library.org/> .
@prefix myOMEX: <http://omex-library.org/NewOmex.omex/> .
@prefix local: <http://omex-library.org/NewOmex.omex/NewModel.rdf#> .
local:OmexMetaId0001
    bqbiol:isPropertyOf local:EntityProperty0000 ;
    bqbiol:isVersionOf <https://identifiers.org/OPB/OPB_00340> .
local:EntityProperty0000
    bqbiol:is <https://identifiers.org/uniprot/P84022> ;
    bqbiol:isPartOf <https://identifiers.org/fma/FMA:24178>, <https://identifiers.org/fma/FMA:63877>, <https://identifiers.org/fma/FMA:70737>, <https://identifiers.org/fma/FMA:7163> .
"""
# remember that the default parser is "guess".
# the parser will try to figure out which syntax is being used.
# but if it doesn't guess well, you can use the format argument for `from_string`
rdf = RDF.from_string(turtle_string)
formats = [
    "ntriples",
    "turtle",
    "rdfxml-abbrev",
    "rdfxml",
    "dot",
    "json-triples",
    "json",
    "nquads",
    "html"
]
for syntax in formats:
    print("Serializing to {}".format(syntax))
    print(rdf.to_string(syntax))
    print("\n\n")
# Note: printing the rdf object is the same as rdf.to_string("turtle")
Output
Serializing to ntriples
<http://omex-library.org/NewOmex.omex/NewModel.rdf#OmexMetaId0001> <http://biomodels.net/biology-qualifiers/isPropertyOf> <http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000> .
<http://omex-library.org/NewOmex.omex/NewModel.rdf#OmexMetaId0001> <http://biomodels.net/biology-qualifiers/isVersionOf> <https://identifiers.org/OPB/OPB_00340> .
<http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000> <http://biomodels.net/biology-qualifiers/is> <https://identifiers.org/uniprot/P84022> .
<http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:24178> .
<http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:63877> .
<http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:70737> .
<http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:7163> .
Serializing to turtle
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix bqbiol: <http://biomodels.net/biology-qualifiers/> .
@prefix OMEXlib: <http://omex-library.org/> .
@prefix local: <http://omex-library.org/NewOmex.omex/NewModel.rdf#> .
local:EntityProperty0000
    bqbiol:is <https://identifiers.org/uniprot/P84022> ;
    bqbiol:isPartOf <https://identifiers.org/fma/FMA:24178>, <https://identifiers.org/fma/FMA:63877>, <https://identifiers.org/fma/FMA:70737>, <https://identifiers.org/fma/FMA:7163> .
local:OmexMetaId0001
    bqbiol:isPropertyOf local:EntityProperty0000 ;
    bqbiol:isVersionOf <https://identifiers.org/OPB/OPB_00340> .
Serializing to rdfxml-abbrev
<?xml version="1.1" encoding="utf-8"?>
<rdf:RDF xmlns:OMEXlib="http://omex-library.org/"
   xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
   xmlns:local="http://omex-library.org/NewOmex.omex/NewModel.rdf#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000">
    <bqbiol:is rdf:resource="https://identifiers.org/uniprot/P84022"/>
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:24178"/>
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:63877"/>
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:70737"/>
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:7163"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/NewOmex.omex/NewModel.rdf#OmexMetaId0001">
    <bqbiol:isPropertyOf rdf:resource="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000"/>
    <bqbiol:isVersionOf rdf:resource="https://identifiers.org/OPB/OPB_00340"/>
  </rdf:Description>
</rdf:RDF>
Serializing to rdfxml
<?xml version="1.1" encoding="utf-8"?>
<rdf:RDF xmlns:OMEXlib="http://omex-library.org/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:local="http://omex-library.org/NewOmex.omex/NewModel.rdf#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="http://omex-library.org/NewOmex.omex/NewModel.rdf#OmexMetaId0001">
    <bqbiol:isPropertyOf rdf:resource="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/NewOmex.omex/NewModel.rdf#OmexMetaId0001">
    <bqbiol:isVersionOf rdf:resource="https://identifiers.org/OPB/OPB_00340"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000">
    <bqbiol:is rdf:resource="https://identifiers.org/uniprot/P84022"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000">
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:24178"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000">
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:63877"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000">
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:70737"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000">
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:7163"/>
  </rdf:Description>
</rdf:RDF>
Serializing to dot
digraph {
	rankdir = LR;
	charset="utf-8";
	"ROMEXlib:NewOmex.omex/NewModel.rdf#OmexMetaId0001" -> "ROMEXlib:NewOmex.omex/NewModel.rdf#EntityProperty0000" [ label="bqbiol:isPropertyOf" ];
	"ROMEXlib:NewOmex.omex/NewModel.rdf#OmexMetaId0001" -> "Rhttps://identifiers.org/OPB/OPB_00340" [ label="bqbiol:isVersionOf" ];
	"ROMEXlib:NewOmex.omex/NewModel.rdf#EntityProperty0000" -> "Rhttps://identifiers.org/uniprot/P84022" [ label="bqbiol:is" ];
	"ROMEXlib:NewOmex.omex/NewModel.rdf#EntityProperty0000" -> "Rhttps://identifiers.org/fma/FMA:24178" [ label="bqbiol:isPartOf" ];
	"ROMEXlib:NewOmex.omex/NewModel.rdf#EntityProperty0000" -> "Rhttps://identifiers.org/fma/FMA:63877" [ label="bqbiol:isPartOf" ];
	"ROMEXlib:NewOmex.omex/NewModel.rdf#EntityProperty0000" -> "Rhttps://identifiers.org/fma/FMA:70737" [ label="bqbiol:isPartOf" ];
	"ROMEXlib:NewOmex.omex/NewModel.rdf#EntityProperty0000" -> "Rhttps://identifiers.org/fma/FMA:7163" [ label="bqbiol:isPartOf" ];
	// Resources
	"ROMEXlib:NewOmex.omex/NewModel.rdf#OmexMetaId0001" [ label="OMEXlib:NewOmex.omex/NewModel.rdf#OmexMetaId0001", shape = ellipse, color = blue ];
	"ROMEXlib:NewOmex.omex/NewModel.rdf#EntityProperty0000" [ label="OMEXlib:NewOmex.omex/NewModel.rdf#EntityProperty0000", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/OPB/OPB_00340" [ label="https://identifiers.org/OPB/OPB_00340", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/uniprot/P84022" [ label="https://identifiers.org/uniprot/P84022", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/fma/FMA:24178" [ label="https://identifiers.org/fma/FMA:24178", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/fma/FMA:63877" [ label="https://identifiers.org/fma/FMA:63877", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/fma/FMA:70737" [ label="https://identifiers.org/fma/FMA:70737", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/fma/FMA:7163" [ label="https://identifiers.org/fma/FMA:7163", shape = ellipse, color = blue ];
	// Anonymous nodes
	// Literals
	label="\n\nModel:\nbase\n\nNamespaces:\nbqbiol: http://biomodels.net/biology-qualifiers/\nOMEXlib: http://omex-library.org/\nlocal: http://omex-library.org/NewOmex.omex/NewModel.rdf#\n";
}
Serializing to json-triples
{
  "triples" : [
    {
      "subject" : {
        "value" : "http://omex-library.org/NewOmex.omex/NewModel.rdf#OmexMetaId0001",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPropertyOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/NewOmex.omex/NewModel.rdf#OmexMetaId0001",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isVersionOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/OPB/OPB_00340",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/is",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/uniprot/P84022",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPartOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/fma/FMA:24178",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPartOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/fma/FMA:63877",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPartOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/fma/FMA:70737",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPartOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/fma/FMA:7163",
        "type" : "uri"
        }
      }
    ]
  }
Serializing to json
{
  "http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000" : {
    "http://biomodels.net/biology-qualifiers/is" : [ {
        "value" : "https://identifiers.org/uniprot/P84022",
        "type" : "uri"
        }
      
      ],
    "http://biomodels.net/biology-qualifiers/isPartOf" : [ {
        "value" : "https://identifiers.org/fma/FMA:24178",
        "type" : "uri"
        }
      ,
      {
        "value" : "https://identifiers.org/fma/FMA:63877",
        "type" : "uri"
        }
      ,
      {
        "value" : "https://identifiers.org/fma/FMA:70737",
        "type" : "uri"
        }
      ,
      {
        "value" : "https://identifiers.org/fma/FMA:7163",
        "type" : "uri"
        }
      
      ]
    }
  ,
  "http://omex-library.org/NewOmex.omex/NewModel.rdf#OmexMetaId0001" : {
    "http://biomodels.net/biology-qualifiers/isPropertyOf" : [ {
        "value" : "http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000",
        "type" : "uri"
        }
      
      ],
    "http://biomodels.net/biology-qualifiers/isVersionOf" : [ {
        "value" : "https://identifiers.org/OPB/OPB_00340",
        "type" : "uri"
        }
      
      ]
    }
  }
Serializing to nquads
<http://omex-library.org/NewOmex.omex/NewModel.rdf#OmexMetaId0001> <http://biomodels.net/biology-qualifiers/isPropertyOf> <http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000> .
<http://omex-library.org/NewOmex.omex/NewModel.rdf#OmexMetaId0001> <http://biomodels.net/biology-qualifiers/isVersionOf> <https://identifiers.org/OPB/OPB_00340> .
<http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000> <http://biomodels.net/biology-qualifiers/is> <https://identifiers.org/uniprot/P84022> .
<http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:24178> .
<http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:63877> .
<http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:70737> .
<http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:7163> .
Serializing to html
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Raptor Graph Serialisation</title>
</head>
<body>
  <table id="triples" border="1">
    <tr>
      <th>Subject</th>
      <th>Predicate</th>
      <th>Object</th>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/NewOmex.omex/NewModel.rdf#OmexMetaId0001">http://omex-library.org/NewOmex.omex/NewModel.rdf#OmexMetaId0001</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPropertyOf">http://biomodels.net/biology-qualifiers/isPropertyOf</a></span></td>
      <td><span class="uri"><a href="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000">http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/NewOmex.omex/NewModel.rdf#OmexMetaId0001">http://omex-library.org/NewOmex.omex/NewModel.rdf#OmexMetaId0001</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isVersionOf">http://biomodels.net/biology-qualifiers/isVersionOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/OPB/OPB_00340">https://identifiers.org/OPB/OPB_00340</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000">http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/is">http://biomodels.net/biology-qualifiers/is</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/uniprot/P84022">https://identifiers.org/uniprot/P84022</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000">http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPartOf">http://biomodels.net/biology-qualifiers/isPartOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/fma/FMA:24178">https://identifiers.org/fma/FMA:24178</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000">http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPartOf">http://biomodels.net/biology-qualifiers/isPartOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/fma/FMA:63877">https://identifiers.org/fma/FMA:63877</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000">http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPartOf">http://biomodels.net/biology-qualifiers/isPartOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/fma/FMA:70737">https://identifiers.org/fma/FMA:70737</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000">http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPartOf">http://biomodels.net/biology-qualifiers/isPartOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/fma/FMA:7163">https://identifiers.org/fma/FMA:7163</a></span></td>
    </tr>
  </table>
  <p>Total number of triples: <span class="count">7</span>.</p>
</body>
</html>
Write to a string in C++
#include "omexmeta/OmexMeta.h"
#include <vector>
using namespace omexmeta;
int main() {
    std::string turtle_string = "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n"
                                "@prefix bqbiol: <http://biomodels.net/biology-qualifiers/> .\n"
                                "@prefix OMEXlib: <http://omex-library.org/> .\n"
                                "@prefix myOMEX: <http://omex-library.org/NewOmex.omex/> .\n"
                                "@prefix local: <http://omex-library.org/NewOmex.omex/NewModel.rdf#> .\n"
                                "\n"
                                "<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001>\n"
                                "    bqbiol:isPropertyOf local:EntityProperty0000 ;\n"
                                "    bqbiol:isVersionOf <https://identifiers.org/OPB/OPB_00340> .\n"
                                "\n"
                                "<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000>\n"
                                "    bqbiol:is <https://identifiers.org/uniprot/P84022> ;\n"
                                "    bqbiol:isPartOf <https://identifiers.org/fma/FMA:24178>, <https://identifiers.org/fma/FMA:63877>, <https://identifiers.org/fma/FMA:70737>, <https://identifiers.org/fma/FMA:7163> .\n";
    // remember that the default parser is "guess".
    // the parser will try to figure out which syntax is being used.
    // but if it doesn't guess well, you can use the format argument for `fromString`
    RDF rdf = RDF::fromString(turtle_string);
    std::vector<std::string> formats = {
            "ntriples",
            "turtle",
            "rdfxml-abbrev",
            "rdfxml",
            "dot",
            "json-triples",
            "json",
            "nquads",
            "html"
    };
    for (auto &syntax: formats){
        std::cout << "Serializing to " << syntax << ":" << std::endl;
        std::cout << rdf.toString(syntax) << std::endl;
        std::cout << std::endl;
        std::cout << std::endl;
    }
    return 0;
}
Output
Serializing to ntriples:
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001> <http://biomodels.net/biology-qualifiers/isPropertyOf> <http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001> <http://biomodels.net/biology-qualifiers/isVersionOf> <https://identifiers.org/OPB/OPB_00340> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/is> <https://identifiers.org/uniprot/P84022> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:24178> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:63877> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:70737> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:7163> .
Serializing to turtle:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix bqbiol: <http://biomodels.net/biology-qualifiers/> .
@prefix OMEXlib: <http://omex-library.org/> .
@prefix local: <http://omex-library.org/NewOmex.omex/NewModel.rdf#> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000>
    bqbiol:is <https://identifiers.org/uniprot/P84022> ;
    bqbiol:isPartOf <https://identifiers.org/fma/FMA:24178>, <https://identifiers.org/fma/FMA:63877>, <https://identifiers.org/fma/FMA:70737>, <https://identifiers.org/fma/FMA:7163> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001>
    bqbiol:isPropertyOf local:EntityProperty0000 ;
    bqbiol:isVersionOf <https://identifiers.org/OPB/OPB_00340> .
Serializing to rdfxml-abbrev:
<?xml version="1.1" encoding="utf-8"?>
<rdf:RDF xmlns:OMEXlib="http://omex-library.org/"
   xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
   xmlns:local="http://omex-library.org/NewOmex.omex/NewModel.rdf#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">
    <bqbiol:is rdf:resource="https://identifiers.org/uniprot/P84022"/>
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:24178"/>
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:63877"/>
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:70737"/>
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:7163"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001">
    <bqbiol:isPropertyOf rdf:resource="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000"/>
    <bqbiol:isVersionOf rdf:resource="https://identifiers.org/OPB/OPB_00340"/>
  </rdf:Description>
</rdf:RDF>
Serializing to rdfxml:
<?xml version="1.1" encoding="utf-8"?>
<rdf:RDF xmlns:OMEXlib="http://omex-library.org/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:local="http://omex-library.org/NewOmex.omex/NewModel.rdf#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001">
    <bqbiol:isPropertyOf rdf:resource="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001">
    <bqbiol:isVersionOf rdf:resource="https://identifiers.org/OPB/OPB_00340"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">
    <bqbiol:is rdf:resource="https://identifiers.org/uniprot/P84022"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:24178"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:63877"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:70737"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:7163"/>
  </rdf:Description>
</rdf:RDF>
Serializing to dot:
digraph {
	rankdir = LR;
	charset="utf-8";
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#OmexMetaId0001" -> "ROMEXlib:NewOmex.omex/NewModel.rdf#EntityProperty0000" [ label="bqbiol:isPropertyOf" ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#OmexMetaId0001" -> "Rhttps://identifiers.org/OPB/OPB_00340" [ label="bqbiol:isVersionOf" ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#EntityProperty0000" -> "Rhttps://identifiers.org/uniprot/P84022" [ label="bqbiol:is" ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#EntityProperty0000" -> "Rhttps://identifiers.org/fma/FMA:24178" [ label="bqbiol:isPartOf" ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#EntityProperty0000" -> "Rhttps://identifiers.org/fma/FMA:63877" [ label="bqbiol:isPartOf" ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#EntityProperty0000" -> "Rhttps://identifiers.org/fma/FMA:70737" [ label="bqbiol:isPartOf" ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#EntityProperty0000" -> "Rhttps://identifiers.org/fma/FMA:7163" [ label="bqbiol:isPartOf" ];
	// Resources
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#OmexMetaId0001" [ label="OMEXlib:Welsh2020.omex/Welsh2020.xml#OmexMetaId0001", shape = ellipse, color = blue ];
	"ROMEXlib:NewOmex.omex/NewModel.rdf#EntityProperty0000" [ label="OMEXlib:NewOmex.omex/NewModel.rdf#EntityProperty0000", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/OPB/OPB_00340" [ label="https://identifiers.org/OPB/OPB_00340", shape = ellipse, color = blue ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#EntityProperty0000" [ label="OMEXlib:Welsh2020.omex/Welsh2020.xml#EntityProperty0000", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/uniprot/P84022" [ label="https://identifiers.org/uniprot/P84022", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/fma/FMA:24178" [ label="https://identifiers.org/fma/FMA:24178", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/fma/FMA:63877" [ label="https://identifiers.org/fma/FMA:63877", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/fma/FMA:70737" [ label="https://identifiers.org/fma/FMA:70737", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/fma/FMA:7163" [ label="https://identifiers.org/fma/FMA:7163", shape = ellipse, color = blue ];
	// Anonymous nodes
	// Literals
	label="\n\nModel:\nbase\n\nNamespaces:\nbqbiol: http://biomodels.net/biology-qualifiers/\nOMEXlib: http://omex-library.org/\nlocal: http://omex-library.org/NewOmex.omex/NewModel.rdf#\n";
}
Serializing to json-triples:
{
  "triples" : [
    {
      "subject" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPropertyOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isVersionOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/OPB/OPB_00340",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/is",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/uniprot/P84022",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPartOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/fma/FMA:24178",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPartOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/fma/FMA:63877",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPartOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/fma/FMA:70737",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPartOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/fma/FMA:7163",
        "type" : "uri"
        }
      }
    ]
  }
Serializing to json:
{
  "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000" : {
    "http://biomodels.net/biology-qualifiers/is" : [ {
        "value" : "https://identifiers.org/uniprot/P84022",
        "type" : "uri"
        }
      
      ],
    "http://biomodels.net/biology-qualifiers/isPartOf" : [ {
        "value" : "https://identifiers.org/fma/FMA:24178",
        "type" : "uri"
        }
      ,
      {
        "value" : "https://identifiers.org/fma/FMA:63877",
        "type" : "uri"
        }
      ,
      {
        "value" : "https://identifiers.org/fma/FMA:70737",
        "type" : "uri"
        }
      ,
      {
        "value" : "https://identifiers.org/fma/FMA:7163",
        "type" : "uri"
        }
      
      ]
    }
  ,
  "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001" : {
    "http://biomodels.net/biology-qualifiers/isPropertyOf" : [ {
        "value" : "http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000",
        "type" : "uri"
        }
      
      ],
    "http://biomodels.net/biology-qualifiers/isVersionOf" : [ {
        "value" : "https://identifiers.org/OPB/OPB_00340",
        "type" : "uri"
        }
      
      ]
    }
  }
Serializing to nquads:
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001> <http://biomodels.net/biology-qualifiers/isPropertyOf> <http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001> <http://biomodels.net/biology-qualifiers/isVersionOf> <https://identifiers.org/OPB/OPB_00340> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/is> <https://identifiers.org/uniprot/P84022> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:24178> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:63877> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:70737> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:7163> .
Serializing to html:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Raptor Graph Serialisation</title>
</head>
<body>
  <table id="triples" border="1">
    <tr>
      <th>Subject</th>
      <th>Predicate</th>
      <th>Object</th>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001">http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPropertyOf">http://biomodels.net/biology-qualifiers/isPropertyOf</a></span></td>
      <td><span class="uri"><a href="http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000">http://omex-library.org/NewOmex.omex/NewModel.rdf#EntityProperty0000</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001">http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isVersionOf">http://biomodels.net/biology-qualifiers/isVersionOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/OPB/OPB_00340">https://identifiers.org/OPB/OPB_00340</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/is">http://biomodels.net/biology-qualifiers/is</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/uniprot/P84022">https://identifiers.org/uniprot/P84022</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPartOf">http://biomodels.net/biology-qualifiers/isPartOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/fma/FMA:24178">https://identifiers.org/fma/FMA:24178</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPartOf">http://biomodels.net/biology-qualifiers/isPartOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/fma/FMA:63877">https://identifiers.org/fma/FMA:63877</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPartOf">http://biomodels.net/biology-qualifiers/isPartOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/fma/FMA:70737">https://identifiers.org/fma/FMA:70737</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPartOf">http://biomodels.net/biology-qualifiers/isPartOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/fma/FMA:7163">https://identifiers.org/fma/FMA:7163</a></span></td>
    </tr>
  </table>
  <p>Total number of triples: <span class="count">7</span>.</p>
</body>
</html>
Write to a string in C
#include "omexmeta/OmexMeta.h"
#include "omexmeta/OmexMetaCApi.h"
using namespace omexmeta;
int main() {
    const char* turtle_string = "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n"
                                "@prefix bqbiol: <http://biomodels.net/biology-qualifiers/> .\n"
                                "@prefix OMEXlib: <http://omex-library.org/> .\n"
                                "@prefix local: <http://omex-library.org/Welsh2020.omex/Welsh2020.rdf#> .\n"
                                "\n"
                                "<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001>\n"
                                "    bqbiol:isPropertyOf local:EntityProperty0000 ;\n"
                                "    bqbiol:isVersionOf <https://identifiers.org/OPB/OPB_00340> .\n"
                                "\n"
                                "<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000>\n"
                                "    bqbiol:is <https://identifiers.org/uniprot/P84022> ;\n"
                                "    bqbiol:isPartOf <https://identifiers.org/fma/FMA:24178>, <https://identifiers.org/fma/FMA:63877>, <https://identifiers.org/fma/FMA:70737>, <https://identifiers.org/fma/FMA:7163> .\n";
    // remember that the default parser is "guess".
    // the parser will try to figure out which syntax is being used.
    // but if it doesn't guess well, you can use the format argument for `fromString`
    RDF* rdf = RDF_fromString(turtle_string, "guess");
    const char* formats[9] = {
            "ntriples",
            "turtle",
            "rdfxml-abbrev",
            "rdfxml",
            "dot",
            "json-triples",
            "json",
            "nquads",
            "html"
    };
    for (int i=0; i<9; i++){
        printf("Serializing to %s: \n", formats[i]);
        char* string = RDF_toString(rdf, formats[i]);
        printf("%s\n", string );
        printf("\n\n");
        free(string);
    }
    RDF_delete(rdf);
    return 0;
}
Output
Serializing to ntriples: 
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001> <http://biomodels.net/biology-qualifiers/isPropertyOf> <http://omex-library.org/Welsh2020.omex/Welsh2020.rdf#EntityProperty0000> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001> <http://biomodels.net/biology-qualifiers/isVersionOf> <https://identifiers.org/OPB/OPB_00340> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/is> <https://identifiers.org/uniprot/P84022> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:24178> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:63877> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:70737> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:7163> .
Serializing to turtle: 
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix bqbiol: <http://biomodels.net/biology-qualifiers/> .
@prefix OMEXlib: <http://omex-library.org/> .
@prefix local: <http://omex-library.org/NewOmex.omex/NewModel.rdf#> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000>
    bqbiol:is <https://identifiers.org/uniprot/P84022> ;
    bqbiol:isPartOf <https://identifiers.org/fma/FMA:24178>, <https://identifiers.org/fma/FMA:63877>, <https://identifiers.org/fma/FMA:70737>, <https://identifiers.org/fma/FMA:7163> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001>
    bqbiol:isPropertyOf <http://omex-library.org/Welsh2020.omex/Welsh2020.rdf#EntityProperty0000> ;
    bqbiol:isVersionOf <https://identifiers.org/OPB/OPB_00340> .
Serializing to rdfxml-abbrev: 
<?xml version="1.1" encoding="utf-8"?>
<rdf:RDF xmlns:OMEXlib="http://omex-library.org/"
   xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
   xmlns:local="http://omex-library.org/NewOmex.omex/NewModel.rdf#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">
    <bqbiol:is rdf:resource="https://identifiers.org/uniprot/P84022"/>
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:24178"/>
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:63877"/>
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:70737"/>
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:7163"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001">
    <bqbiol:isPropertyOf rdf:resource="http://omex-library.org/Welsh2020.omex/Welsh2020.rdf#EntityProperty0000"/>
    <bqbiol:isVersionOf rdf:resource="https://identifiers.org/OPB/OPB_00340"/>
  </rdf:Description>
</rdf:RDF>
Serializing to rdfxml: 
<?xml version="1.1" encoding="utf-8"?>
<rdf:RDF xmlns:OMEXlib="http://omex-library.org/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:local="http://omex-library.org/NewOmex.omex/NewModel.rdf#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001">
    <bqbiol:isPropertyOf rdf:resource="http://omex-library.org/Welsh2020.omex/Welsh2020.rdf#EntityProperty0000"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001">
    <bqbiol:isVersionOf rdf:resource="https://identifiers.org/OPB/OPB_00340"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">
    <bqbiol:is rdf:resource="https://identifiers.org/uniprot/P84022"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:24178"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:63877"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:70737"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">
    <bqbiol:isPartOf rdf:resource="https://identifiers.org/fma/FMA:7163"/>
  </rdf:Description>
</rdf:RDF>
Serializing to dot: 
digraph {
	rankdir = LR;
	charset="utf-8";
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#OmexMetaId0001" -> "ROMEXlib:Welsh2020.omex/Welsh2020.rdf#EntityProperty0000" [ label="bqbiol:isPropertyOf" ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#OmexMetaId0001" -> "Rhttps://identifiers.org/OPB/OPB_00340" [ label="bqbiol:isVersionOf" ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#EntityProperty0000" -> "Rhttps://identifiers.org/uniprot/P84022" [ label="bqbiol:is" ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#EntityProperty0000" -> "Rhttps://identifiers.org/fma/FMA:24178" [ label="bqbiol:isPartOf" ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#EntityProperty0000" -> "Rhttps://identifiers.org/fma/FMA:63877" [ label="bqbiol:isPartOf" ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#EntityProperty0000" -> "Rhttps://identifiers.org/fma/FMA:70737" [ label="bqbiol:isPartOf" ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#EntityProperty0000" -> "Rhttps://identifiers.org/fma/FMA:7163" [ label="bqbiol:isPartOf" ];
	// Resources
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#OmexMetaId0001" [ label="OMEXlib:Welsh2020.omex/Welsh2020.xml#OmexMetaId0001", shape = ellipse, color = blue ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.rdf#EntityProperty0000" [ label="OMEXlib:Welsh2020.omex/Welsh2020.rdf#EntityProperty0000", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/OPB/OPB_00340" [ label="https://identifiers.org/OPB/OPB_00340", shape = ellipse, color = blue ];
	"ROMEXlib:Welsh2020.omex/Welsh2020.xml#EntityProperty0000" [ label="OMEXlib:Welsh2020.omex/Welsh2020.xml#EntityProperty0000", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/uniprot/P84022" [ label="https://identifiers.org/uniprot/P84022", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/fma/FMA:24178" [ label="https://identifiers.org/fma/FMA:24178", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/fma/FMA:63877" [ label="https://identifiers.org/fma/FMA:63877", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/fma/FMA:70737" [ label="https://identifiers.org/fma/FMA:70737", shape = ellipse, color = blue ];
	"Rhttps://identifiers.org/fma/FMA:7163" [ label="https://identifiers.org/fma/FMA:7163", shape = ellipse, color = blue ];
	// Anonymous nodes
	// Literals
	label="\n\nModel:\nbase\n\nNamespaces:\nbqbiol: http://biomodels.net/biology-qualifiers/\nOMEXlib: http://omex-library.org/\nlocal: http://omex-library.org/NewOmex.omex/NewModel.rdf#\n";
}
Serializing to json-triples: 
{
  "triples" : [
    {
      "subject" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPropertyOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.rdf#EntityProperty0000",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isVersionOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/OPB/OPB_00340",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/is",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/uniprot/P84022",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPartOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/fma/FMA:24178",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPartOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/fma/FMA:63877",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPartOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/fma/FMA:70737",
        "type" : "uri"
        }
      },
    {
      "subject" : {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000",
        "type" : "uri"
        },
      "predicate" : {
        "value" : "http://biomodels.net/biology-qualifiers/isPartOf",
        "type" : "uri"
        },
      "object" : {
        "value" : "https://identifiers.org/fma/FMA:7163",
        "type" : "uri"
        }
      }
    ]
  }
Serializing to json: 
{
  "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000" : {
    "http://biomodels.net/biology-qualifiers/is" : [ {
        "value" : "https://identifiers.org/uniprot/P84022",
        "type" : "uri"
        }
      
      ],
    "http://biomodels.net/biology-qualifiers/isPartOf" : [ {
        "value" : "https://identifiers.org/fma/FMA:24178",
        "type" : "uri"
        }
      ,
      {
        "value" : "https://identifiers.org/fma/FMA:63877",
        "type" : "uri"
        }
      ,
      {
        "value" : "https://identifiers.org/fma/FMA:70737",
        "type" : "uri"
        }
      ,
      {
        "value" : "https://identifiers.org/fma/FMA:7163",
        "type" : "uri"
        }
      
      ]
    }
  ,
  "http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001" : {
    "http://biomodels.net/biology-qualifiers/isPropertyOf" : [ {
        "value" : "http://omex-library.org/Welsh2020.omex/Welsh2020.rdf#EntityProperty0000",
        "type" : "uri"
        }
      
      ],
    "http://biomodels.net/biology-qualifiers/isVersionOf" : [ {
        "value" : "https://identifiers.org/OPB/OPB_00340",
        "type" : "uri"
        }
      
      ]
    }
  }
Serializing to nquads: 
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001> <http://biomodels.net/biology-qualifiers/isPropertyOf> <http://omex-library.org/Welsh2020.omex/Welsh2020.rdf#EntityProperty0000> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001> <http://biomodels.net/biology-qualifiers/isVersionOf> <https://identifiers.org/OPB/OPB_00340> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/is> <https://identifiers.org/uniprot/P84022> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:24178> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:63877> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:70737> .
<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000> <http://biomodels.net/biology-qualifiers/isPartOf> <https://identifiers.org/fma/FMA:7163> .
Serializing to html: 
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Raptor Graph Serialisation</title>
</head>
<body>
  <table id="triples" border="1">
    <tr>
      <th>Subject</th>
      <th>Predicate</th>
      <th>Object</th>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001">http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPropertyOf">http://biomodels.net/biology-qualifiers/isPropertyOf</a></span></td>
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.rdf#EntityProperty0000">http://omex-library.org/Welsh2020.omex/Welsh2020.rdf#EntityProperty0000</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001">http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isVersionOf">http://biomodels.net/biology-qualifiers/isVersionOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/OPB/OPB_00340">https://identifiers.org/OPB/OPB_00340</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/is">http://biomodels.net/biology-qualifiers/is</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/uniprot/P84022">https://identifiers.org/uniprot/P84022</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPartOf">http://biomodels.net/biology-qualifiers/isPartOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/fma/FMA:24178">https://identifiers.org/fma/FMA:24178</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPartOf">http://biomodels.net/biology-qualifiers/isPartOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/fma/FMA:63877">https://identifiers.org/fma/FMA:63877</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPartOf">http://biomodels.net/biology-qualifiers/isPartOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/fma/FMA:70737">https://identifiers.org/fma/FMA:70737</a></span></td>
    </tr>
    <tr class="triple">
      <td><span class="uri"><a href="http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000">http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000</a></span></td>
      <td><span class="uri"><a href="http://biomodels.net/biology-qualifiers/isPartOf">http://biomodels.net/biology-qualifiers/isPartOf</a></span></td>
      <td><span class="uri"><a href="https://identifiers.org/fma/FMA:7163">https://identifiers.org/fma/FMA:7163</a></span></td>
    </tr>
  </table>
  <p>Total number of triples: <span class="count">7</span>.</p>
</body>
</html>
Writing to a file
Write to a file in Python
from pyomexmeta import RDF, eUriType
import os
turtle_string = """@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix bqbiol: <http://biomodels.net/biology-qualifiers/> .
@prefix OMEXlib: <http://omex-library.org/> .
@prefix myOMEX: <http://omex-library.org/NewOmex.omex/> .
@prefix local: <http://omex-library.org/NewOmex.omex/NewModel.rdf#> .
local:OmexMetaId0001
    bqbiol:isPropertyOf local:EntityProperty0000 ;
    bqbiol:isVersionOf <https://identifiers.org/OPB/OPB_00340> .
local:EntityProperty0000
    bqbiol:is <https://identifiers.org/uniprot/P84022> ;
    bqbiol:isPartOf <https://identifiers.org/fma/FMA:24178>, <https://identifiers.org/fma/FMA:63877>, <https://identifiers.org/fma/FMA:70737>, <https://identifiers.org/fma/FMA:7163> .
"""
# remember that the default parser is "guess".
# the parser will try to figure out which syntax is being used.
# but if it doesn't guess well, you can use the format argument for `from_string`
rdf = RDF.from_string(turtle_string)
syntax = "ntriples"
filename = os.path.join(os.path.dirname(__file__), "write_to_file.rdf")
print("Serializing to {}:".format(syntax))
print(rdf.to_file(filename, syntax))
print(f"RDF graph serialized to \"{filename}\"")
print(f"Counted \"{len(rdf)}\" triples")
# clear up file
if os.path.isfile(filename):
    os.remove(filename)
# Note: printing the rdf object is the same as rdf.to_string("turtle")
Output
Serializing to ntriples:
0
RDF graph serialized to "D:\libOmexMeta\docs\write_to_file.rdf"
Counted "7" triples
Write to a file in C++
#include "omexmeta/OmexMeta.h"
#include <vector>
#include <filesystem>
using namespace omexmeta;
int main() {
    std::string turtle_string = "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n"
                                "@prefix bqbiol: <http://biomodels.net/biology-qualifiers/> .\n"
                                "@prefix OMEXlib: <http://omex-library.org/> .\n"
                                "@prefix myOMEX: <http://omex-library.org/NewOmex.omex/> .\n"
                                "@prefix local: <http://omex-library.org/NewOmex.omex/NewModel.rdf#> .\n"
                                "\n"
                                "<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001>\n"
                                "    bqbiol:isPropertyOf local:EntityProperty0000 ;\n"
                                "    bqbiol:isVersionOf <https://identifiers.org/OPB/OPB_00340> .\n"
                                "\n"
                                "<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000>\n"
                                "    bqbiol:is <https://identifiers.org/uniprot/P84022> ;\n"
                                "    bqbiol:isPartOf <https://identifiers.org/fma/FMA:24178>, <https://identifiers.org/fma/FMA:63877>, <https://identifiers.org/fma/FMA:70737>, <https://identifiers.org/fma/FMA:7163> .\n";
    // remember that the default parser is "guess".
    // the parser will try to figure out which syntax is being used.
    // but if it doesn't guess well, you can use the format argument for `fromString`
    RDF rdf = RDF::fromString(turtle_string);
    std::string syntax = "ntriples";
    std::filesystem::path filename = std::filesystem::current_path() /+ "annotations.rdf";
    std::cout << "Serializing to " << syntax << ":" << std::endl;
    rdf.toFile(filename.string(), syntax);
    std::cout << "RDF graph serialized to \"" << filename << "\"" << std::endl;
    std::cout << "Counted \""<< rdf.size() <<"\" triples" << std::endl;
    // clean up
    if(std::filesystem::exists(filename)){
        std::filesystem::remove(filename);
    }
    return 0;
}
Output
Serializing to ntriples:
RDF graph serialized to ""D:\\libOmexMeta\\cmake-build-release\\docs\\annotations.rdf""
Counted "7" triples
Write to a file in C
#include "omexmeta/OmexMeta.h"
#include "omexmeta/OmexMetaCApi.h"
using namespace omexmeta;
int main() {
    const char* turtle_string = "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n"
                                "@prefix bqbiol: <http://biomodels.net/biology-qualifiers/> .\n"
                                "@prefix OMEXlib: <http://omex-library.org/> .\n"
                                "@prefix local: <http://omex-library.org/Welsh2020.omex/Welsh2020.rdf#> .\n"
                                "\n"
                                "<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#OmexMetaId0001>\n"
                                "    bqbiol:isPropertyOf local:EntityProperty0000 ;\n"
                                "    bqbiol:isVersionOf <https://identifiers.org/OPB/OPB_00340> .\n"
                                "\n"
                                "<http://omex-library.org/Welsh2020.omex/Welsh2020.xml#EntityProperty0000>\n"
                                "    bqbiol:is <https://identifiers.org/uniprot/P84022> ;\n"
                                "    bqbiol:isPartOf <https://identifiers.org/fma/FMA:24178>, <https://identifiers.org/fma/FMA:63877>, <https://identifiers.org/fma/FMA:70737>, <https://identifiers.org/fma/FMA:7163> .\n";
    // remember that the default parser is "guess".
    // the parser will try to figure out which syntax is being used.
    // but if it doesn't guess well, you can use the format argument for `fromString`
    RDF* rdf = RDF_fromString(turtle_string, "guess");
    const char* syntax = "ntriples";
    // we cheat and use c++ for system independent filepath
    std::filesystem::path p = std::filesystem::current_path() / "annotations.rdf";
    std::string fname = p.string();
    printf("Serializing to %s \n", syntax);
    int failed = RDF_toFile(rdf, syntax, fname.c_str()); // 1 if failed else 0
    if (failed) {
        printf("You broke C");
        exit(1);
    }
    printf("RDF graph serialized to \"%s\"", fname.c_str());
    printf("Counted \"%d\" triples", RDF_size(rdf));
    // clean up (more cheating)
    if(std::filesystem::exists(fname)){
        std::filesystem::remove(fname);
    }
    RDF_delete(rdf);
    return 0;
}
Output
Serializing to ntriples 
RDF graph serialized to "D:\libOmexMeta\cmake-build-release\docs\annotations.rdf"Counted "7" triples