{"action":"created","issue":{"url":"https://api.github.com/repos/owlcs/owlapi/issues/509","repository_url":"https://api.github.com/repos/owlcs/owlapi","labels_url":"https://api.github.com/repos/owlcs/owlapi/issues/509/labels{/name}","comments_url":"https://api.github.com/repos/owlcs/owlapi/issues/509/comments","events_url":"https://api.github.com/repos/owlcs/owlapi/issues/509/events","html_url":"https://github.com/owlcs/owlapi/issues/509","id":144376581,"number":509,"title":"XML literal is not self contained","user":{"login":"rwynne","id":6089714,"avatar_url":"https://avatars.githubusercontent.com/u/6089714?v=3","gravatar_id":"","url":"https://api.github.com/users/rwynne","html_url":"https://github.com/rwynne","followers_url":"https://api.github.com/users/rwynne/followers","following_url":"https://api.github.com/users/rwynne/following{/other_user}","gists_url":"https://api.github.com/users/rwynne/gists{/gist_id}","starred_url":"https://api.github.com/users/rwynne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwynne/subscriptions","organizations_url":"https://api.github.com/users/rwynne/orgs","repos_url":"https://api.github.com/users/rwynne/repos","events_url":"https://api.github.com/users/rwynne/events{/privacy}","received_events_url":"https://api.github.com/users/rwynne/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-03-29T20:22:01Z","updated_at":"2016-03-30T23:12:48Z","closed_at":null,"body":"Hi,\r\n\r\nThis may be related to https://github.com/owlcs/owlapi/issues/495.\r\n\r\nI'm testing 4.2.3 with a roundtrip (load and save) of our NCI Thesaurus raw export.  It reads the raw file fine.  During save, however, the writing stops before a class containing an ampersand in its FULL_SYN (XML Literal annotation).  The exceptions are below, and here is the offending class snippet on the way in:\r\n\r\n`  <owl:Class rdf:about=\"http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#A_and_D_Ointment\">\r\n    <rdfs:subClassOf rdf:resource=\"http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#Topical_Preparation\"/>\r\n    <code rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\"\r\n    >C28794</code>\r\n    <rdfs:label rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\"\r\n    >A and D Ointment</rdfs:label>\r\n    <FULL_SYN rdf:parseType=\"Literal\"><ncicp:ComplexTerm xmlns:ncicp=\"http://ncicb.nci.nih.gov/xml/owl/EVS/ComplexProperties.xsd#\"><ncicp:term-name>A&amp;D Ointment</ncicp:term-name><ncicp:term-group>SY</ncicp:term-group><ncicp:term-source>NCI</ncicp:term-source></ncicp:ComplexTerm></FULL_SYN>\r\n</owl:Class>\r\n`\r\n\r\n\r\n` \r\norg.semanticweb.owlapi.model.OWLOntologyStorageException: java.io.IOException: XML literal is not self contained: \"<ncicp:ComplexTerm xmlns:ncicp=\"http://ncicb.nci.nih.gov/xml/owl/EVS/ComplexProperties.xsd#\"><ncicp:term-name>A&D Ointment</ncicp:term-name><ncicp:term-group>SY</ncicp:term-group><ncicp:term-source>NCI</ncicp:term-source></ncicp:ComplexTerm>\"\r\n       at org.semanticweb.owlapi.rdf.rdfxml.renderer.RDFXMLStorer.storeOntology(RDFXMLStorer.java:61)\r\n       at org.semanticweb.owlapi.util.AbstractOWLStorer.store(AbstractOWLStorer.java:99)\r\n       at org.semanticweb.owlapi.util.AbstractOWLStorer.storeOntology(AbstractOWLStorer.java:64)\r\n       at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.saveOntology(OWLOntologyManagerImpl.java:1264)\r\n       at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.saveOntology(OWLOntologyManagerImpl.java:1249)\r\n       at gov.nih.nci.evs.owl.data.SaveTest.run(SaveTest.java:42)\r\n       at gov.nih.nci.evs.owl.data.SaveTest.main(SaveTest.java:35)\r\nCaused by: java.io.IOException: XML literal is not self contained: \"<ncicp:ComplexTerm xmlns:ncicp=\"http://ncicb.nci.nih.gov/xml/owl/EVS/ComplexProperties.xsd#\"><ncicp:term-name>A&D Ointment</ncicp:term-name><ncicp:term-group>SY</ncicp:term-group><ncicp:term-source>NCI</ncicp:term-source></ncicp:ComplexTerm>\"\r\n       at org.semanticweb.owlapi.rdf.rdfxml.renderer.XMLWriterImpl$XMLElement.checkProperXMLLiteral(XMLWriterImpl.java:446)\r\n       at org.semanticweb.owlapi.rdf.rdfxml.renderer.XMLWriterImpl$XMLElement.writeTextContent(XMLWriterImpl.java:428)\r\n       at org.semanticweb.owlapi.rdf.rdfxml.renderer.XMLWriterImpl$XMLElement.writeElementStart(XMLWriterImpl.java:339)\r\n       at org.semanticweb.owlapi.rdf.rdfxml.renderer.XMLWriterImpl$XMLElement.writeElementEnd(XMLWriterImpl.java:384)\r\n       at org.semanticweb.owlapi.rdf.rdfxml.renderer.XMLWriterImpl.writeEndElement(XMLWriterImpl.java:165)\r\n       at org.semanticweb.owlapi.rdf.rdfxml.renderer.RDFXMLWriter.writeEndElement(RDFXMLWriter.java:116)\r\n       at org.semanticweb.owlapi.rdf.rdfxml.renderer.RDFXMLRenderer.render(RDFXMLRenderer.java:247)\r\n       at org.semanticweb.owlapi.rdf.RDFRendererBase.renderEntity(RDFRendererBase.java:265)\r\n       at org.semanticweb.owlapi.rdf.RDFRendererBase.renderEntities(RDFRendererBase.java:257)\r\n       at org.semanticweb.owlapi.rdf.RDFRendererBase.renderInOntologySignatureEntities(RDFRendererBase.java:226)\r\n       at org.semanticweb.owlapi.rdf.RDFRendererBase.renderOntologyComponents(RDFRendererBase.java:208)\r\n       at org.semanticweb.owlapi.rdf.RDFRendererBase.render(RDFRendererBase.java:203)\r\n       at org.semanticweb.owlapi.rdf.rdfxml.renderer.RDFXMLStorer.storeOntology(RDFXMLStorer.java:59)\r\n       ... 6 more\r\nCaused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 114; The reference to entity \"D\" must end with the ';' delimiter.\r\n       at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)\r\n       at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)\r\n       at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)\r\n       at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)\r\n       at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)\r\n       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(XMLDocumentFragmentScannerImpl.java:1850)\r\n       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3067)\r\n       at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)\r\n       at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)\r\n       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)\r\n       at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)\r\n       at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)\r\n       at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)\r\n       at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)\r\n       at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)\r\n       at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)\r\n       at org.semanticweb.owlapi.rdf.rdfxml.renderer.XMLWriterImpl$XMLElement.checkProperXMLLiteral(XMLWriterImpl.java:443)\r\n       ... 18 more\r\n`"},"comment":{"url":"https://api.github.com/repos/owlcs/owlapi/issues/comments/203677548","html_url":"https://github.com/owlcs/owlapi/issues/509#issuecomment-203677548","issue_url":"https://api.github.com/repos/owlcs/owlapi/issues/509","id":203677548,"user":{"login":"sesuncedu","id":411675,"avatar_url":"https://avatars.githubusercontent.com/u/411675?v=3","gravatar_id":"","url":"https://api.github.com/users/sesuncedu","html_url":"https://github.com/sesuncedu","followers_url":"https://api.github.com/users/sesuncedu/followers","following_url":"https://api.github.com/users/sesuncedu/following{/other_user}","gists_url":"https://api.github.com/users/sesuncedu/gists{/gist_id}","starred_url":"https://api.github.com/users/sesuncedu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sesuncedu/subscriptions","organizations_url":"https://api.github.com/users/sesuncedu/orgs","repos_url":"https://api.github.com/users/sesuncedu/repos","events_url":"https://api.github.com/users/sesuncedu/events{/privacy}","received_events_url":"https://api.github.com/users/sesuncedu/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T23:12:47Z","updated_at":"2016-03-30T23:12:47Z","body":"> If it is CDATA on the way in will that keep it from being mangled?\n\nThat would have been a much better design for RDF/XML :-(\nBut it is what it is (and what should never be).\n"}}