-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_driver.ts
33 lines (28 loc) · 947 Bytes
/
test_driver.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import * as N3 from "npm:[email protected]"
//import * as fs from 'node:fs';
import { process_statement } from "./process_statements.ts";
import type { Introspector } from "./introspector.ts";
import type { RdfObject } from "./rdf.ts";
//import type { rdf_type } from "./rdf_type.ts";
type Error=string;
export function test_driver(callback:Introspector) {
// callback.enter_test_driver();
const parser = new N3.Parser();
// function chunk(chunk) {
// console.log(chunk.toString());
// };
// function end() {
// console.log("END");
// }
function wrapper(x:string,y:RdfObject //,prefixes:any
){
//callback.wrapper_rdf();
//console.log("wrapper1",x,y,prefixes);
process_statement(x,y,callback);
}
const bytes = Deno.readFileSync("introspector.ttl");
const decoder = new TextDecoder().decode(bytes);
const ret = parser.parse(decoder, wrapper);
console.log("finished",ret);
// rdfStream.close();
}