Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
sparql-http-client
Advanced tools
SPARQL client for easier handling of SPARQL Queries and Graph Store requests. The SPARQL Protocol is used for SPARQL Queries and SPARQL Updates. The SPARQL Graph Store Protocol is used to manage Named Graphs.
It provides client implementations in different flavors. The default client comes with an interface for streams, the simple client is closer to fetch, and the parsing client wraps the results directly into RDF/JS DatasetCore objects or arrays.
The example below shows how to use the client to run a SELECT
query against the Wikidata endpoint.
Check the documentation for more details.
import SparqlClient from 'sparql-http-client'
const endpointUrl = 'https://query.wikidata.org/sparql'
const query = `
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
SELECT ?value WHERE {
wd:Q243 p:P2048 ?height.
?height pq:P518 wd:Q24192182;
ps:P2048 ?value .
}`
const client = new SparqlClient({ endpointUrl })
const stream = client.query.select(query)
stream.on('data', row => {
for (const [key, value] of Object.entries(row)) {
console.log(`${key}: ${value.value} (${value.termType})`)
}
})
stream.on('error', err => {
console.error(err)
})
FAQs
Simplified SPARQL HTTP request client
The npm package sparql-http-client receives a total of 5,467 weekly downloads. As such, sparql-http-client popularity was classified as popular.
We found that sparql-http-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.