sbmlteam / jsbml

JSBML is a community-driven project to create a free, open-source, pure Java™ library for reading, writing, and manipulating SBML files (the Systems Biology Markup Language) and data streams. It is an alternative to the mixed Java/native code-based interface provided in libSBML.
https://sbml.org/software/jsbml/
GNU Lesser General Public License v2.1
37 stars 24 forks source link

order of authors is not correct #219

Open piotr-gawron opened 4 years ago

piotr-gawron commented 4 years ago

I'm parsing a file where there are three authors (authors.xml.zip). The annotation tag looks as follow:

<annotation>
      <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
        <rdf:Description rdf:about="#metaid_0">
          <dc:creator>
            <rdf:Bag>
              <rdf:li rdf:parseType="Resource">
                <vCard:N rdf:parseType="Resource">
                  <vCard:Family>Author 1</vCard:Family>
                </vCard:N>
              </rdf:li>
              <rdf:li rdf:parseType="Resource">
                <vCard:N rdf:parseType="Resource">
                  <vCard:Family>Author 2</vCard:Family>
                </vCard:N>
              </rdf:li>
              <rdf:li rdf:parseType="Resource">
                <vCard:N rdf:parseType="Resource">
                  <vCard:Family>Author 3</vCard:Family>
                </vCard:N>
              </rdf:li>
            </rdf:Bag>
          </dc:creator>
        </rdf:Description>
      </rdf:RDF>
    </annotation>

However, when I try to access annotation from jsbml the order of authors is wrong:

SBMLDocument sbmlDocument = SBMLReader.read(new FileInputStream("authors.xml"));
Model sbmlModel = sbmlDocument.getModel();
Annotation annotation = sbmlModel.getAnnotation();
System.out.println(annotation.getFullAnnotationString());
<annotation>
      <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
    <rdf:Description rdf:about="#metaid_0">
    <dc:creator>
    <rdf:Bag>
    <rdf:li rdf:parseType="Resource">
    <vCard:N rdf:parseType="Resource">
    <vCard:Family>Author 1</vCard:Family>
    </vCard:N>
    </rdf:li>

    <rdf:li rdf:parseType="Resource">
    <vCard:N rdf:parseType="Resource">
    <vCard:Family>Author 3</vCard:Family>
    </vCard:N>
    </rdf:li>
    <rdf:li rdf:parseType="Resource">
    <vCard:N rdf:parseType="Resource">
    <vCard:Family>Author 2</vCard:Family>
    </vCard:N>
    </rdf:li>
    </rdf:Bag>
    </dc:creator>
    </rdf:Description>

      </rdf:RDF>
    </annotation>

In most places I agree that order of xml tags is not important. However, in scientific community the order of authors sometimes is a very delicate thing. Could you please fix the order of authors?

I tested it on jsbml version 1.4 and 1.5

niko-rodrigue commented 4 years ago

Thanks for the report, I will have a look at it.