@@ -3,9 +3,10 @@ import { JSDOM } from 'jsdom'
33import renderTableViewPane from '../../src/table'
44
55import store from '../../src/store'
6+ import { NamedNode , sym , parse , variable , Namespace , Query } from "rdflib" ;
67const kb = store
78
8- import * as $rdf from 'rdflib'
9+ // import * as $rdf from 'rdflib'
910
1011silenceDebugMessages ( )
1112const window = new JSDOM ( '<!DOCTYPE html><p>Hello world</p>' ) . window
@@ -20,11 +21,11 @@ const tableData = `@prefix : <https://example.com/tests#> .
2021const tableQuery = ` PREFIX : <https://example.com/tests#>
2122SELECT ?who, ?name WHERE { ?who :name ?name . }
2223`
23- const doc = $rdf . sym ( 'https://example.com/tests' )
24- $rdf . parse ( tableData , kb , doc . uri , 'text/turtle' , null ) // should be able to omit tcontent type and callback
24+ const doc = sym ( 'https://example.com/tests' )
25+ parse ( tableData , kb , doc . uri ) // should be able to omit tcontent type and callback
2526// const query = $rdf.SPARQLToQuery(tableQuery) // TypeError: $rdf.SPARQLToQuery is not a function
2627
27- const query = new $rdf . Query ( 'List people' )
28+ const query = new Query ( 'List people' )
2829const vars = [ 'person' , 'name' , 'age' , 'hobby' ]
2930
3031export interface Person {
@@ -36,9 +37,9 @@ export interface Person {
3637
3738var v = < Person > { } // The RDF variable objects for each variable name
3839vars . map ( function ( x ) {
39- query . vars . push ( ( v [ x ] = $rdf . variable ( x ) ) )
40+ query . vars . push ( ( v [ x ] = variable ( x ) ) )
4041} )
41- const EX = $rdf . Namespace ( 'https://example.com/tests#' )
42+ const EX = Namespace ( 'https://example.com/tests#' )
4243query . pat . add ( v . person , EX ( 'name' ) , v . name , doc )
4344query . pat . add ( v . person , EX ( 'age' ) , v . age , doc )
4445query . pat . add ( v . person , EX ( 'hobby' ) , v . hobby , doc )
0 commit comments