-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathrdflib.ts
More file actions
87 lines (75 loc) · 2.23 KB
/
rdflib.ts
File metadata and controls
87 lines (75 loc) · 2.23 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// @@ TODO: Remove currently untyped methods as they are added
// Use require() to load the actual rdflib module, bypassing Jest mock interception
// eslint-disable-next-line @typescript-eslint/no-require-imports
const rdflib = require('rdflib')
export const IndexedFormula = rdflib.IndexedFormula
export const BlankNode = rdflib.BlankNode
export const Collection = rdflib.Collection
export const convert = rdflib.convert
export const DataFactory = rdflib.DataFactory
export const Empty = rdflib.Empty
export const Formula = rdflib.Formula
export const Literal = rdflib.Literal
export const log = rdflib.log
export const NamedNode = rdflib.NamedNode
export const Namespace = rdflib.Namespace
export const Node = rdflib.Node
export const parse = rdflib.parse
export const Query = rdflib.Query
export const Statement = rdflib.Statement
export const term = rdflib.term
export const uri = rdflib.uri
export const Util = rdflib.Util
export const Variable = rdflib.Variable
export const NextId = rdflib.NextId
export const fromNT = rdflib.fromNT
export const graph = rdflib.graph
export const lit = rdflib.lit
export const st = rdflib.st
export const sym = rdflib.namedNode
export const blankNode = rdflib.blankNode
export const defaultGraph = rdflib.defaultGraph
export const literal = rdflib.literal
export const namedNode = rdflib.namedNode
export const quad = rdflib.quad
export const triple = rdflib.triple
export const variable = rdflib.variable
export function fetcher (store: any) {
const fetcher = new Fetcher()
store.fetcher = fetcher
return fetcher
}
export class Fetcher {
requested: any
nonexistent = {}
constructor () {
this.requested = {}
}
load () {
return Promise.resolve()
}
nowOrWhenFetched () {
return Promise.resolve()
}
}
export class UpdateManager {
// mock as needed
updated: boolean = false
reportSuccess: boolean = true
editable (uri: string) {
if (uri === 'http://not.editable/') {
return false
}
return true
}
put () {
return Promise.resolve()
}
update (_deletes, _inserts, onDone: (uri: string, ok: boolean, body: string) => void) {
this.updated = true
onDone('uri', this.reportSuccess, 'body')
return Promise.resolve()
}
addDownstreamChangeListener () {
}
}