Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* global log */
'use strict'
var httpError = require('http-errors')
var SparqlHttpClient = require('sparql-http-client')
SparqlHttpClient.fetch = require('node-fetch')
function SparqlHandler (options) {
this.existsQuery = options.existsQuery
this.graphQuery = options.graphQuery
this.client = new SparqlHttpClient({endpointUrl: options.endpointUrl})
}
SparqlHandler.prototype.buildExistsQuery = function (iri) {
return this.existsQuery.split('${iri}').join(iri) // eslint-disable-line no-template-curly-in-string
}
SparqlHandler.prototype.buildGraphQuery = function (iri) {
return this.graphQuery.split('${iri}').join(iri) // eslint-disable-line no-template-curly-in-string
}
SparqlHandler.prototype.exists = function (iri) {
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 .
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 .