ruby-rdf / rdf-rdfxml

Ruby RDF/XML reader/writer for RDF.rb.
http://rubygems.org/gems/rdf-rdfxml
The Unlicense
17 stars 7 forks source link

CDATA is not treated like text. #37

Closed gkellogg closed 7 years ago

gkellogg commented 7 years ago

As reported by @azaroth42, the reader does not interpret CDATA sections as text (at least not consistently, as it is not properly handled by Nokogiri.

For example,

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
  <rdf:Property rdf:about="http://www.w3.org/ns/oa#annotationService">
    <rdfs:comment><![CDATA[The object of the relationship is the end point of a service that conforms to the annotation-protocol, and it may be associated with any resource.  The expectation of asserting the relationship is that the object is the preferred service for maintaining annotations about the subject resource, according to the publisher of the relationship.

  This relationship is intended to be used both within Linked Data descriptions and as the  rel  type of a Link, via HTTP Link Headers rfc5988 for binary resources and in HTML <link> elements.  For more information about these, please see the Annotation Protocol specification annotation-protocol.
  ]]></rdfs:comment>
  </rdf:Property>
</rdf:RDF>

Should generate triple with content in rdfs:comment, but generates the empty string instead.