Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add code style

  • Loading branch information...
commit 2e870c3b680b3d6b6248bbc7b1d861e8c70f20f1 1 parent 5c8bbbe
@baxtree authored
Showing with 24 additions and 26 deletions.
  1. 0  LICENSE.txt → LICENSE
  2. +24 −26 README.md
View
0  LICENSE.txt → LICENSE
File renamed without changes
View
50 README.md
@@ -6,25 +6,25 @@ node-rdf2json can help users in transforming RDF/XML (resource centric) into JSO
Add node-rdf2json module to your require path:
-var rdf2json = require("rdf2json");
+ var rdf2json = require("rdf2json");
Generate JSON based on a URL:
-rdf2json.rdf2json.convertURLIntoRDFJSON(url, format, function(err, json){
- ...
-});
+ rdf2json.rdf2json.convertURLIntoRDFJSON(url, format, function(err, json){
+ ...
+ });
Generate JSON from an RDF file:
-rdf2json.convertFileIntoRDFJSON(filepath, format, function(err, json){
- ...
-});
+ rdf2json.convertFileIntoRDFJSON(filepath, format, function(err, json){
+ ...
+ });
Generate JSON from a RDF string:
-exports.convertStringIntoRDFJSON(str, format, function(err, json){
- ...
-});
+ rdf2json.convertStringIntoRDFJSON(str, format, function(err, json){
+ ...
+ });
#Supported RDF/JSON formats
@@ -32,36 +32,34 @@ As the time of the last release, there is no "standard" mapping between RDF and
[1] "flat": Flat RDF/JSON format.
- example:
+example:
- var rdf2json = require("../lib/rdf2json");
rdf2json.convertFileIntoRDFJSON("../wine.rdf", "flat", function(err, rdfjson){
// do something with rdfjson
});
[2] "sparql": SPARQL RDF/JSON format.
- example:
+example:
- var rdf2json = require("../lib/rdf2json");
- rdf2json.convertFileIntoRDFJSON("http://www.w3.org/TR/owl-guide/wine.rdf", "sparql", function(err, rdfjson){
+ rdf2json.convertURLIntoRDFJSON("http://www.w3.org/TR/owl-guide/wine.rdf", "sparql", function(err, rdfjson){
// do something with rdfjson
});
[3] "talis": Talis RDF/JSON format.
- exmaple:
+exmaple:
rdf2json.convertStringIntoRDFJSON("" +
- "<?xml version=\"1.0\"?>" +
- " <!DOCTYPE rdf:RDF [" +
- " <!ENTITY vin \"http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#\" >" +
- " <!ENTITY food \"http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#\" >" +
- " <!ENTITY owl \"http://www.w3.org/2002/07/owl#\" >" +
- " <!ENTITY xsd \"http://www.w3.org/2001/XMLSchema#\" >" +
- "]>" +
- "..." +
- "</rdf:RDF>", "talis", function(err, rdfjson){
- // do something with rdfjson
+ "<?xml version=\"1.0\"?>" +
+ " <!DOCTYPE rdf:RDF [" +
+ " <!ENTITY vin \"http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#\" >" +
+ " <!ENTITY food \"http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#\" >" +
+ " <!ENTITY owl \"http://www.w3.org/2002/07/owl#\" >" +
+ " <!ENTITY xsd \"http://www.w3.org/2001/XMLSchema#\" >" +
+ "]>" +
+ "..." +
+ "</rdf:RDF>", "talis", function(err, rdfjson){
+ // do something with rdfjson
});
Please sign in to comment.
Something went wrong with that request. Please try again.