-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathrdflib.ts
More file actions
102 lines (89 loc) · 2.04 KB
/
rdflib.ts
File metadata and controls
102 lines (89 loc) · 2.04 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// @@ TODO: Remove currently untyped methods as they are added
import { IndexedFormula } from 'rdflib'
export {
BlankNode,
Collection,
convert,
DataFactory,
Empty,
Formula,
// Store, // Not currently supported in @types/rdflib
// jsonParser, // Not currently supported in @types/rdflib
Literal,
log,
// N3Parser, // Not currently supported in @types/rdflib
NamedNode,
Namespace,
Node,
parse,
Query,
// queryToSPARQL, // Not currently supported in @types/rdflib
// RDFaProcessor, // Not currently supported in @types/rdflib
// RDFParser, // Not currently supported in @types/rdflib
// serialize, // Not currently supported in @types/rdflib
// Serializer, // Not currently supported in @types/rdflib
// SPARQLToQuery, // Not currently supported in @types/rdflib
// sparqlUpdateParser, // Not currently supported in @types/rdflib
Statement,
term,
// UpdatesSocket, // Not currently supported in @types/rdflib
// UpdatesVia, // Not currently supported in @types/rdflib
uri,
Util,
Variable,
NextId,
fromNT,
graph,
lit,
st,
namedNode as sym,
blankNode,
defaultGraph,
literal,
namedNode,
quad,
triple,
variable
} from 'rdflib'
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()
}
putBack () {
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 () {
}
}