I'm trying to parse an HTML document as RDFa that contains the following script tag (as well as some valid JSON-LD):
<script type="text/plain" cookie-consent="tracking">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
...
</script>
the text/plain content type causes ruby-rdf to load the NTriples reader, which fails with the exception:
RDF::ReaderError: Expected subject (found: "window.dataLayer = window.dataLayer || [];")
Is there a way that the RDFa reader could tolerate (and log) bad RDF in a script tag and continue reading the rest of the document?
Or, is there a good way to not load the NTriples reader for text/plain content?
I'm trying to parse an HTML document as RDFa that contains the following script tag (as well as some valid JSON-LD):
the
text/plain
content type causes ruby-rdf to load the NTriples reader, which fails with the exception:RDF::ReaderError: Expected subject (found: "window.dataLayer = window.dataLayer || [];")
Is there a way that the RDFa reader could tolerate (and log) bad RDF in a script tag and continue reading the rest of the document?
Or, is there a good way to not load the NTriples reader for
text/plain
content?Thanks!