We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
graph-rdfa-processor works fine but currently, jsonld-rdfa-parser only get the textContent see:
graph-rdfa-processor
import util from 'util'; import { jsdom } from 'jsdom'; import getRdfaGraph from 'graph-rdfa-processor'; import jsonld from 'jsonld'; import jsonldRdfaParser from 'jsonld-rdfa-parser'; jsonld.registerRDFParser('text/html', jsonldRdfaParser); const html = '<span resource="http://example.com"><span property="schema:name" datatype="rdf:HTML"><em>MonkeyPatcher</em></span></span>'; let { document } = jsdom(html).defaultView.window; let graph = getRdfaGraph(document, {baseURI: 'http://localhost'}); console.log(graph.toString()); // <http://example.com> <http://schema.org/name> """<em>MonkeyPatcher</em>"""^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML> . jsonld.fromRDF(html, {format: 'text/html'}, function(err, data) { console.log(util.inspect(data, {depth: null})); //[ { '@id': 'http://example.com', // 'http://schema.org/name': // [ { '@value': NodeList { '0': HTMLElement { item: null } }, // '@type': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML' } ] } ] });
we should take the outerHTML
The text was updated successfully, but these errors were encountered:
No branches or pull requests
graph-rdfa-processor
works fine but currently, jsonld-rdfa-parser only get the textContent see:we should take the outerHTML
The text was updated successfully, but these errors were encountered: