Skip to content

A custom RDFa parser (based on green-turtle) to be registered with jsonld.js registerRDFParser method

License

Notifications You must be signed in to change notification settings

dduran1967/jsonld-rdfa-parser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsonld-rdfa-parser

A custom RDFa parser (based on graph-rdfa-processor) to be registered with jsonld.js registerRDFParser method.

The custom RDFa parser must be register with jsonld.js. Once registered, jsonld.fromRDF can be used and take for input either a file path, a URL, a HTML string or a DOM element.

import jsonldRdfaParser from 'jsonld-rdfa-parser';
import jsonld from 'jsonld';

// register the parser for content type text/html
jsonld.registerRDFParser('text/html', jsonldRdfaParser);

// use it
jsonld.fromRDF('test.html', {format: 'text/html'}, function(err, data) {

});

See tests for more examples.

Note the interesting code of this library is mostly taken from the jsonld.js library but updated to the latest graph-rdfa-processor API. Credits are due to the original authors.

About

A custom RDFa parser (based on green-turtle) to be registered with jsonld.js registerRDFParser method

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%