SynBioDex / libSBOLj

Java Library for Synthetic Biology Open Language (SBOL)
Apache License 2.0
38 stars 24 forks source link

Parsing of RDF files depends on XML structure #551

Open jamesamcl opened 6 years ago

jamesamcl commented 6 years ago

While testing some things with GenericTopLevels I found that this file validates:

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:cheese="http://wiki.synbiohub.org/Terms/cheese#"
   xmlns:dcterms="http://purl.org/dc/terms/"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:sbol="http://sbols.org/v2#">
  <cheese:Cheese rdf:about="http://cheese/camembert/1">
    <dcterms:description>Camembert is a moist, soft, creamy, surface-ripened cow's milk cheese. It was first made in the late 18th century at Camembert, Normandy, in northern France.</dcterms:description>
    <dcterms:title>Camembert</dcterms:title>
    <sbol:displayId>camembert</sbol:displayId>
    <sbol:persistentIdentity rdf:resource="http://cheese/camembert"/>
    <sbol:version>1</sbol:version>
  </cheese:Cheese>
</rdf:RDF>

While this file throws an error:

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:cheese="http://wiki.synbiohub.org/Terms/cheese#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sbol="http://sbols.org/v2#">
  <rdf:Description rdf:about="http://cheese/camembert/1">
    <rdf:type rdf:resource="http://wiki.synbiohub.org/Terms/cheese#Cheese"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://cheese/camembert/1">
    <sbol:persistentIdentity rdf:resource="http://cheese/camembert"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://cheese/camembert/1">
    <sbol:displayId>camembert</sbol:displayId>
  </rdf:Description>
  <rdf:Description rdf:about="http://cheese/camembert/1">
    <sbol:version>1</sbol:version>
  </rdf:Description>
  <rdf:Description rdf:about="http://cheese/camembert/1">
    <dcterms:title>Camembert</dcterms:title>
  </rdf:Description>
  <rdf:Description rdf:about="http://cheese/camembert/1">
    <dcterms:description>Camembert is a moist, soft, creamy, surface-ripened cow's milk cheese. It was first made in the late 18th century at Camembert, Normandy, in northern France.</dcterms:description>
  </rdf:Description>
</rdf:RDF>

The error is:

[/tmp/UnGkrJiMDSKL2wpsu-NWZkfY.xml] sbol-12302: The rdfType property of a GenericTopLevel object is REQUIRED and MUST contain a QName.
Reference: SBOL Version 2.2.0 Section 7.14.2 on page 55
: http://cheese/camembert/1

sbol-12302: The rdfType property of a GenericTopLevel object is REQUIRED and MUST contain a QName.
Reference: SBOL Version 2.2.0 Section 7.14.2 on page 55
: http://cheese/camembert/1

sbol-12302: The rdfType property of a GenericTopLevel object is REQUIRED and MUST contain a QName.
Reference: SBOL Version 2.2.0 Section 7.14.2 on page 55
: http://cheese/camembert/1

sbol-12302: The rdfType property of a GenericTopLevel object is REQUIRED and MUST contain a QName.
Reference: SBOL Version 2.2.0 Section 7.14.2 on page 55
: http://cheese/camembert/1

sbol-12302: The rdfType property of a GenericTopLevel object is REQUIRED and MUST contain a QName.
Reference: SBOL Version 2.2.0 Section 7.14.2 on page 55
: http://cheese/camembert/1

Validation failed.

The two files are different representations of exactly the same RDF.

cjmyers commented 6 years ago

This would be a fairly substantial rewrite to support individual triples. It also would be rather inefficient I think.

On Jun 19, 2018, at 4:23 PM, James Alastair McLaughlin notifications@github.com wrote:

While testing some things with GenericTopLevels I found that this file validates:

<?xml version="1.0" encoding="utf-8"?> <rdf:RDF xmlns:cheese="http://wiki.synbiohub.org/Terms/cheese#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sbol="http://sbols.org/v2#">

Camembert is a moist, soft, creamy, surface-ripened cow's milk cheese. It was first made in the late 18th century at Camembert, Normandy, in northern France. Camembert camembert 1 While this file throws an error: camembert 1 Camembert Camembert is a moist, soft, creamy, surface-ripened cow's milk cheese. It was first made in the late 18th century at Camembert, Normandy, in northern France. The error is: [/tmp/UnGkrJiMDSKL2wpsu-NWZkfY.xml] sbol-12302: The rdfType property of a GenericTopLevel object is REQUIRED and MUST contain a QName. Reference: SBOL Version 2.2.0 Section 7.14.2 on page 55 : http://cheese/camembert/1 sbol-12302: The rdfType property of a GenericTopLevel object is REQUIRED and MUST contain a QName. Reference: SBOL Version 2.2.0 Section 7.14.2 on page 55 : http://cheese/camembert/1 sbol-12302: The rdfType property of a GenericTopLevel object is REQUIRED and MUST contain a QName. Reference: SBOL Version 2.2.0 Section 7.14.2 on page 55 : http://cheese/camembert/1 sbol-12302: The rdfType property of a GenericTopLevel object is REQUIRED and MUST contain a QName. Reference: SBOL Version 2.2.0 Section 7.14.2 on page 55 : http://cheese/camembert/1 sbol-12302: The rdfType property of a GenericTopLevel object is REQUIRED and MUST contain a QName. Reference: SBOL Version 2.2.0 Section 7.14.2 on page 55 : http://cheese/camembert/1 Validation failed. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .