How to use the sparql-http-client function in sparql-http-client

To help you get started, we’ve selected a few sparql-http-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zazuko / openlayers-elements / elements / ol-swiss-cantons.ts View on Github external
import {customElement, html, LitElement, property, query} from 'lit-element'
import {until} from 'lit-html/directives/until'
import Sparql from 'sparql-http-client'

import OlMap from './ol-map'
import './ol-map'
import OlWktLayer from './ol-wkt-layer'
import './ol-wkt-layer'
import './ol-layer-openstreetmap'
import './ol-control'
import './ol-select'

Sparql.fetch = (a,b) => {
    return window.fetch(a, b)
}
const endpoint = new Sparql({endpointUrl: 'https://ld.geo.admin.ch/query'})

const sparql = `
PREFIX xsd: 
PREFIX schema: 
PREFIX dct: 
PREFIX rdf: 
PREFIX geo: 

SELECT ?canton ?cantonShape ?cantonShapeLabel WHERE {
    ?canton a  ;
          ;
  	    dct:hasVersion ?version .
 
    ?version schema:validUntil "2018-12-31"^^xsd:date ;
        geo:hasGeometry/geo:asWKT ?cantonShape ;
        schema:name ?cantonShapeLabel .                                        

sparql-http-client

Simplified SPARQL HTTP request client

MIT
Latest version published 3 months ago

Package Health Score

67 / 100
Full package analysis

Popular sparql-http-client functions