🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

sparqljson-parse

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sparqljson-parse - npm Package Compare versions

Comparing version

to
2.1.0

3

lib/SparqlJsonParser.js

@@ -53,2 +53,5 @@ "use strict";

}
else if (jsonParser.key === "metadata" && jsonParser.stack.length === 1) {
resultStream.emit('metadata', value);
}
};

@@ -55,0 +58,0 @@ const resultStream = sparqlResponseStream

2

package.json
{
"name": "sparqljson-parse",
"version": "2.0.1",
"version": "2.1.0",
"description": "Parses SPARQL JSON query results",

@@ -5,0 +5,0 @@ "keywords": [

@@ -120,2 +120,27 @@ # SPARQL-Results+JSON Parse

### Advanced: metadata entries
This library can recognise metadata on the result stream in the following form:
```json
{
"head": { "vars": [ "book", "library" ] },
"results": {
"bindings": [
{ "book": { "type": "uri", "value": "http://example.org/book/book1" }, "library": { "type": "uri", "value": "http://example.org/book/library1" } }
]
},
"metadata": { "httpRequests": 0 }
}
```
This metadata can be captured by listening to the `"metadata"` event:
```
sparqlJsonParser.parseJsonResultsStream(myStream)
.on('metadata', (metadata: any) => console.log(metadata))
.on('data', (bindings: IBindings) => console.log(bindings));
```
Note that this is part of the SPARQL/JSON specification.
## License

@@ -122,0 +147,0 @@ This software is written by [Ruben Taelman](http://rubensworks.net/).