rdf-translator
Convert between rdf formats
It is a javascript connector for the rdf-translator APIs using Promises.
Install
npm install --save rdf-translator
Usage
- From a string.
var rdfTranslator = ;var str = ` <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/"> <foaf:Person rdf:about="http://dbpedia.org/page/Spider-Man"> <foaf:name>Peter Parker</foaf:name> <foaf:mbox rdf:resource="mailto:peter.parker@dailybugle.com"/> </foaf:Person> </rdf:RDF>` ;
In alternative, with traditional callbacks:
;
- From a URI
var rdfTranslator = ; let uri = 'https://raw.githubusercontent.com/DOREMUS-ANR/doremus-ontology/master/doremus.ttl'; ;
API
rdfTranslator(str, source, target, [callback])
str
Type: string
Input string (i.e. in xml-rdf or turtle format) -or- URI of the file to convert.
source
Type: string
Format of the input string.
target
Type: string
Format of the desired output string.
callback(err, data)
Type: function
Callback function.
License
MIT