issue-pane 2.4.10-67b294b5 → 2.4.10-b8e76bf2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +0 -1
- package/.nvmrc +1 -1
- package/issuePane.js +68 -67
- package/newTracker.js +12 -11
- package/package.json +1 -1
package/.github/workflows/ci.yml
CHANGED
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
v16.14.0
|
package/issuePane.js
CHANGED
|
@@ -15,6 +15,7 @@ import { trackerSettingsFormText } from './trackerSettingsForm.js'
|
|
|
15
15
|
// import { trackerInstancesFormText } from './trackerInstancesForm.js'
|
|
16
16
|
|
|
17
17
|
const $rdf = rdf
|
|
18
|
+
const kb = store
|
|
18
19
|
|
|
19
20
|
// const MY_TRACKERS_ICON = UI.icons.iconBase + 'noun_Document_998605.svg'
|
|
20
21
|
// const TRACKER_ICON = UI.icons.iconBase + 'noun_list_638112'
|
|
@@ -34,10 +35,10 @@ export default {
|
|
|
34
35
|
|
|
35
36
|
// Does the subject deserve an issue pane?
|
|
36
37
|
label: function (subject, _context) {
|
|
37
|
-
const t =
|
|
38
|
+
const t = kb.findTypeURIs(subject)
|
|
38
39
|
if (
|
|
39
40
|
t['http://www.w3.org/2005/01/wf/flow#Task'] ||
|
|
40
|
-
|
|
41
|
+
kb.holds(subject, ns.wf('tracker'))
|
|
41
42
|
) { return 'issue' } // in case ontology not available
|
|
42
43
|
if (t['http://www.w3.org/2005/01/wf/flow#Tracker']) return 'tracker'
|
|
43
44
|
// Later: Person. For a list of things assigned to them,
|
|
@@ -54,40 +55,40 @@ export default {
|
|
|
54
55
|
const docs = deletions.concat(insertions).map(st => st.why)
|
|
55
56
|
const uniqueDocs = Array.from(new Set(docs))
|
|
56
57
|
const updates = uniqueDocs.map(doc =>
|
|
57
|
-
|
|
58
|
+
kb.updater.update(deletions.filter(st => st.why.sameTerm(doc)),
|
|
58
59
|
insertions.filter(st => st.why.sameTerm(doc))))
|
|
59
60
|
return Promise.all(updates)
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
const
|
|
63
|
+
const kb = context.session.store
|
|
63
64
|
let stateStore
|
|
64
65
|
if (options.newInstance) {
|
|
65
|
-
stateStore =
|
|
66
|
+
stateStore = kb.sym(options.newInstance.doc().uri + '_state.ttl')
|
|
66
67
|
} else {
|
|
67
|
-
options.newInstance =
|
|
68
|
-
stateStore =
|
|
68
|
+
options.newInstance = kb.sym(options.newBase + 'index.ttl#this')
|
|
69
|
+
stateStore = kb.sym(options.newBase + 'state.ttl')
|
|
69
70
|
}
|
|
70
71
|
const tracker = options.newInstance
|
|
71
72
|
const appDoc = tracker.doc()
|
|
72
73
|
|
|
73
74
|
const me = authn.currentUser()
|
|
74
75
|
if (me) {
|
|
75
|
-
|
|
76
|
+
kb.add(tracker, ns.dc('author'), me, appDoc)
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
kb.add(tracker, ns.rdf('type'), ns.wf('Tracker'), appDoc)
|
|
80
|
+
kb.add(tracker, ns.dc('created'), new Date(), appDoc)
|
|
80
81
|
|
|
81
82
|
// @@ to do --- adk user what sort of tracker they want
|
|
82
83
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
kb.add(tracker, ns.wf('issueClass'), ns.wf('Task'), appDoc) // @@ ask user
|
|
85
|
+
kb.add(tracker, ns.wf('initialState'), ns.wf('Open'), appDoc)
|
|
86
|
+
kb.add(tracker, ns.wf('stateStore'), stateStore, appDoc)
|
|
87
|
+
kb.add(tracker, ns.wf('assigneeClass'), ns.foaf('Person'), appDoc) // @@ set to people in the meeting?
|
|
87
88
|
|
|
88
|
-
|
|
89
|
+
kb.add(tracker, ns.wf('stateStore'), stateStore, stateStore) // Back Link
|
|
89
90
|
|
|
90
|
-
const ins =
|
|
91
|
+
const ins = kb.statementsMatching(undefined, undefined, undefined, appDoc).concat(kb.statementsMatching(undefined, undefined, undefined, stateStore))
|
|
91
92
|
try {
|
|
92
93
|
await updateMany([], ins)
|
|
93
94
|
} catch (err) {
|
|
@@ -95,7 +96,7 @@ export default {
|
|
|
95
96
|
}
|
|
96
97
|
/*
|
|
97
98
|
try {
|
|
98
|
-
await
|
|
99
|
+
await kb.updater.updateMany([], kb.statementsMatching(undefined, undefined, undefined, stateStore))
|
|
99
100
|
} catch (err) {
|
|
100
101
|
return widgets.complain(context, 'Error writing tracker state file: ' + err)
|
|
101
102
|
}
|
|
@@ -137,24 +138,24 @@ export default {
|
|
|
137
138
|
** This is would not be needed if our quey language
|
|
138
139
|
** allowed is to query ardf Collection membership.
|
|
139
140
|
*/
|
|
140
|
-
async function fixSubClasses (
|
|
141
|
+
async function fixSubClasses (kb, tracker) { // 20220228
|
|
141
142
|
async function checkOneSuperclass (klass) {
|
|
142
|
-
const collection =
|
|
143
|
+
const collection = kb.any(klass, ns.owl('disjointUnionOf'), null, doc)
|
|
143
144
|
if (!collection) throw new Error(`Classification ${klass} has no disjointUnionOf`)
|
|
144
145
|
if (!collection.elements) throw new Error(`Classification ${klass} has no array`)
|
|
145
146
|
const needed = new Set(collection.elements.map(x => x.uri))
|
|
146
|
-
const existing = new Set(
|
|
147
|
+
const existing = new Set(kb.each(null, ns.rdfs('subClassOf'), klass, doc).map(x => x.uri))
|
|
147
148
|
|
|
148
149
|
const superfluous = [...existing].filter(sub => !needed.has(sub))
|
|
149
|
-
const deleteActions = superfluous.map(sub => { return { action: 'delete', st: $rdf.st(
|
|
150
|
+
const deleteActions = superfluous.map(sub => { return { action: 'delete', st: $rdf.st(kb.sym(sub), ns.rdfs('subClassOf'), klass, doc) } })
|
|
150
151
|
|
|
151
152
|
const missing = [...needed].filter(sub => !existing.has(sub))
|
|
152
|
-
const insertActions = missing.map(sub => { return { action: 'insert', st: $rdf.st(
|
|
153
|
+
const insertActions = missing.map(sub => { return { action: 'insert', st: $rdf.st(kb.sym(sub), ns.rdfs('subClassOf'), klass, doc) } })
|
|
153
154
|
return deleteActions.concat(insertActions)
|
|
154
155
|
}
|
|
155
156
|
const doc = tracker.doc()
|
|
156
|
-
const states =
|
|
157
|
-
const cats =
|
|
157
|
+
const states = kb.any(tracker, ns.wf('issueClass'))
|
|
158
|
+
const cats = kb.each(tracker, ns.wf('issueCategory')).concat([states])
|
|
158
159
|
let damage = [] // to make totally functionaly need to deal with map over async.
|
|
159
160
|
for (const klass of cats) {
|
|
160
161
|
damage = damage.concat(await checkOneSuperclass(klass))
|
|
@@ -165,7 +166,7 @@ export default {
|
|
|
165
166
|
// alert(`Internal error: s${damage} subclasses inconsistences!`)
|
|
166
167
|
console.log('Damage:', damage)
|
|
167
168
|
if (confirm(`Fix ${damage} inconsistent subclasses in tracker config?`)) {
|
|
168
|
-
await
|
|
169
|
+
await kb.updater.update(deletables, insertables)
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
172
|
}
|
|
@@ -173,32 +174,32 @@ export default {
|
|
|
173
174
|
/** /////////////////////////// Board
|
|
174
175
|
*/
|
|
175
176
|
function renderBoard (tracker, klass) {
|
|
176
|
-
const states =
|
|
177
|
+
const states = kb.any(tracker, ns.wf('issueClass'))
|
|
177
178
|
klass = klass || states // default to states
|
|
178
179
|
const doingStates = klass.sameTerm(states)
|
|
179
180
|
|
|
180
181
|
// These are states we will show by default: the open issues.
|
|
181
|
-
const stateArray =
|
|
182
|
+
const stateArray = kb.any(klass, ns.owl('disjointUnionOf'))
|
|
182
183
|
if (!stateArray) {
|
|
183
184
|
return complain(`Configuration error: state ${states} does not have substates`)
|
|
184
185
|
}
|
|
185
186
|
let columnValues = stateArray.elements
|
|
186
187
|
if (doingStates && columnValues.length > 2 // and there are more than two
|
|
187
188
|
) { // strip out closed states
|
|
188
|
-
columnValues = columnValues.filter(state =>
|
|
189
|
+
columnValues = columnValues.filter(state => kb.holds(state, ns.rdfs('subClassOf'), ns.wf('Open')) || state.sameTerm(ns.wf('Open')))
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
async function columnDropHandler (issue, newState) {
|
|
192
193
|
const currentState = getState(issue, klass)
|
|
193
|
-
const tracker =
|
|
194
|
-
const stateStore =
|
|
194
|
+
const tracker = kb.the(issue, ns.wf('tracker'), null, issue.doc())
|
|
195
|
+
const stateStore = kb.any(tracker, ns.wf('stateStore'))
|
|
195
196
|
|
|
196
197
|
if (newState.sameTerm(currentState)) {
|
|
197
198
|
// alert('Same state ' + utils.label(currentState)) // @@ remove
|
|
198
199
|
return
|
|
199
200
|
}
|
|
200
201
|
try {
|
|
201
|
-
await
|
|
202
|
+
await kb.updater.update(
|
|
202
203
|
[$rdf.st(issue, ns.rdf('type'), currentState, stateStore)],
|
|
203
204
|
[$rdf.st(issue, ns.rdf('type'), newState, stateStore)])
|
|
204
205
|
} catch (err) {
|
|
@@ -208,7 +209,7 @@ export default {
|
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
function isOpen (issue) {
|
|
211
|
-
const types =
|
|
212
|
+
const types = kb.findTypeURIs(issue)
|
|
212
213
|
return !!types[ns.wf('Open').uri]
|
|
213
214
|
}
|
|
214
215
|
|
|
@@ -229,7 +230,7 @@ export default {
|
|
|
229
230
|
const refreshButton = widgets.button(dom, icons.iconBase + 'noun_479395.svg',
|
|
230
231
|
'refresh table', async _event => {
|
|
231
232
|
try {
|
|
232
|
-
await
|
|
233
|
+
await kb.fetcher.load(stateStore, { force: true, clearPreviousData: true })
|
|
233
234
|
} catch (err) {
|
|
234
235
|
alert(err)
|
|
235
236
|
return
|
|
@@ -245,8 +246,8 @@ export default {
|
|
|
245
246
|
query.pat.optional.push(clause)
|
|
246
247
|
return clause
|
|
247
248
|
}
|
|
248
|
-
const states =
|
|
249
|
-
const cats =
|
|
249
|
+
const states = kb.any(subject, ns.wf('issueClass'))
|
|
250
|
+
const cats = kb.each(tracker, ns.wf('issueCategory')) // zero or more
|
|
250
251
|
const vars = ['issue', 'state', 'created']
|
|
251
252
|
const query = new $rdf.Query(utils.label(subject))
|
|
252
253
|
for (let i = 0; i < cats.length; i++) {
|
|
@@ -270,7 +271,7 @@ export default {
|
|
|
270
271
|
clause.add(v['_cat_' + i], ns.rdfs('subClassOf'), cats[i])
|
|
271
272
|
}
|
|
272
273
|
|
|
273
|
-
const propertyList =
|
|
274
|
+
const propertyList = kb.any(tracker, ns.wf('propertyList')) // List of extra properties
|
|
274
275
|
if (propertyList) {
|
|
275
276
|
const properties = propertyList.elements
|
|
276
277
|
for (let p = 0; p < properties.length; p++) {
|
|
@@ -286,10 +287,10 @@ export default {
|
|
|
286
287
|
}
|
|
287
288
|
|
|
288
289
|
const selectedStates = {}
|
|
289
|
-
const possible =
|
|
290
|
+
const possible = kb.each(undefined, ns.rdfs('subClassOf'), states)
|
|
290
291
|
possible.forEach(function (s) {
|
|
291
292
|
if (
|
|
292
|
-
|
|
293
|
+
kb.holds(s, ns.rdfs('subClassOf'), ns.wf('Open')) ||
|
|
293
294
|
s.sameTerm(ns.wf('Open'))
|
|
294
295
|
) {
|
|
295
296
|
selectedStates[s.uri] = true
|
|
@@ -313,7 +314,7 @@ export default {
|
|
|
313
314
|
'?state': { initialSelection: selectedStates, label: 'Status' }
|
|
314
315
|
}
|
|
315
316
|
})
|
|
316
|
-
const stateStore =
|
|
317
|
+
const stateStore = kb.any(subject, ns.wf('stateStore'))
|
|
317
318
|
tableDiv.appendChild(tableRefreshButton(stateStore, tableDiv))
|
|
318
319
|
return tableDiv
|
|
319
320
|
}
|
|
@@ -345,7 +346,7 @@ export default {
|
|
|
345
346
|
/* // keep this code in case we need a form
|
|
346
347
|
const InstancesForm = ns.wf('TrackerInstancesForm')
|
|
347
348
|
const text = trackerInstancesFormText
|
|
348
|
-
$rdf.parse(text,
|
|
349
|
+
$rdf.parse(text, kb, InstancesForm.doc().uri, 'text/turtle')
|
|
349
350
|
widgets.appendForm(dom, instancesDiv, {}, tracker, InstancesForm,
|
|
350
351
|
tracker.doc(), complainIfBad)
|
|
351
352
|
*/
|
|
@@ -354,12 +355,12 @@ export default {
|
|
|
354
355
|
}
|
|
355
356
|
function renderSettings (tracker) {
|
|
356
357
|
const settingsDiv = dom.createElement('div')
|
|
357
|
-
const states =
|
|
358
|
+
const states = kb.any(tracker, ns.wf('issueClass'))
|
|
358
359
|
const views = [tableView, states] // Possible default views
|
|
359
|
-
.concat(
|
|
360
|
+
.concat(kb.each(tracker, ns.wf('issueCategory')))
|
|
360
361
|
const box = settingsDiv.appendChild(dom.createElement('div'))
|
|
361
|
-
const lhs = widgets.renderNameValuePair(dom,
|
|
362
|
-
lhs.appendChild(widgets.makeSelectForOptions(dom,
|
|
362
|
+
const lhs = widgets.renderNameValuePair(dom, kb, box, null, 'Default view') // @@ use a predicate?
|
|
363
|
+
lhs.appendChild(widgets.makeSelectForOptions(dom, kb, tracker,
|
|
363
364
|
ns.wf('defaultView'),
|
|
364
365
|
views, {}, tracker.doc()))
|
|
365
366
|
|
|
@@ -368,7 +369,7 @@ export default {
|
|
|
368
369
|
login.registrationControl(context, tracker, ns.wf('Tracker')).then(_context2 => {
|
|
369
370
|
const settingsForm = ns.wf('TrackerSettingsForm')
|
|
370
371
|
const text = trackerSettingsFormText
|
|
371
|
-
$rdf.parse(text,
|
|
372
|
+
$rdf.parse(text, kb, settingsForm.doc().uri, 'text/turtle')
|
|
372
373
|
widgets.appendForm(dom, settingsDiv, {}, tracker, settingsForm,
|
|
373
374
|
tracker.doc(), complainIfBad)
|
|
374
375
|
})
|
|
@@ -386,32 +387,32 @@ export default {
|
|
|
386
387
|
ele.appendChild(renderSettings(tracker))
|
|
387
388
|
} else if (object.sameTerm(instancesView)) {
|
|
388
389
|
ele.appendChild(renderInstances(ns.wf('Tracker')))
|
|
389
|
-
} else if ((
|
|
390
|
-
(
|
|
390
|
+
} else if ((kb.holds(tracker, ns.wf('issueCategory'), object)) ||
|
|
391
|
+
(kb.holds(tracker, ns.wf('issueClass'), object))) {
|
|
391
392
|
ele.appendChild(renderBoard(tracker, object))
|
|
392
393
|
} else {
|
|
393
394
|
throw new Error('Unexpected tab type: ' + object)
|
|
394
395
|
}
|
|
395
396
|
}
|
|
396
|
-
const states =
|
|
397
|
+
const states = kb.any(tracker, ns.wf('issueClass'))
|
|
397
398
|
const items = [instancesView, tableView, states]
|
|
398
|
-
.concat(
|
|
399
|
+
.concat(kb.each(tracker, ns.wf('issueCategory')))
|
|
399
400
|
items.push(settingsView)
|
|
400
|
-
const selectedTab =
|
|
401
|
+
const selectedTab = kb.any(tracker, ns.wf('defaultView'), null, tracker.doc()) || tableView
|
|
401
402
|
const options = { renderMain, items, selectedTab }
|
|
402
403
|
|
|
403
404
|
// Add stuff to the ontologies which we believe but they don't say
|
|
404
405
|
const doc = instancesView.doc()
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
406
|
+
kb.add(instancesView, ns.rdfs('label'), 'My Trackers', doc) // @@ squatting on wf ns
|
|
407
|
+
kb.add(settingsView, ns.rdfs('label'), 'Settings', doc) // @@ squatting on wf ns
|
|
408
|
+
kb.add(states, ns.rdfs('label'), 'By State', doc) // @@ squatting on wf ns
|
|
408
409
|
|
|
409
410
|
const myTabs = tabs.tabWidget(options)
|
|
410
411
|
return myTabs
|
|
411
412
|
}
|
|
412
413
|
|
|
413
414
|
async function renderSingleIssue () {
|
|
414
|
-
tracker =
|
|
415
|
+
tracker = kb.any(subject, ns.wf('tracker'))
|
|
415
416
|
if (!tracker) throw new Error('This issue ' + subject + 'has no tracker')
|
|
416
417
|
|
|
417
418
|
// Much data is in the tracker instance, so wait for the data from it
|
|
@@ -422,7 +423,7 @@ export default {
|
|
|
422
423
|
return complain(msg)
|
|
423
424
|
}
|
|
424
425
|
|
|
425
|
-
const stateStore =
|
|
426
|
+
const stateStore = kb.any(tracker, ns.wf('stateStore'))
|
|
426
427
|
if (!stateStore) {
|
|
427
428
|
return complain('Tracker has no state store: ' + tracker)
|
|
428
429
|
}
|
|
@@ -446,14 +447,14 @@ export default {
|
|
|
446
447
|
tracker = subject
|
|
447
448
|
|
|
448
449
|
try {
|
|
449
|
-
await fixSubClasses(
|
|
450
|
+
await fixSubClasses(kb, tracker)
|
|
450
451
|
} catch (err) {
|
|
451
452
|
console.log('@@@ Error fixing subclasses in config: ' + err)
|
|
452
453
|
}
|
|
453
454
|
|
|
454
|
-
const states =
|
|
455
|
+
const states = kb.any(subject, ns.wf('issueClass'))
|
|
455
456
|
if (!states) throw new Error('This tracker has no issueClass')
|
|
456
|
-
const stateStore =
|
|
457
|
+
const stateStore = kb.any(subject, ns.wf('stateStore'))
|
|
457
458
|
if (!stateStore) throw new Error('This tracker has no stateStore')
|
|
458
459
|
|
|
459
460
|
// const me = await authn.currentUser()
|
|
@@ -482,7 +483,7 @@ export default {
|
|
|
482
483
|
'click',
|
|
483
484
|
function (_event) {
|
|
484
485
|
newIssueButton.disabled = true
|
|
485
|
-
container.appendChild(newIssueForm(dom,
|
|
486
|
+
container.appendChild(newIssueForm(dom, kb, tracker, null, showNewIssue))
|
|
486
487
|
},
|
|
487
488
|
false
|
|
488
489
|
)
|
|
@@ -518,26 +519,26 @@ export default {
|
|
|
518
519
|
const settingsView = ns.wf('SettingsView')
|
|
519
520
|
const instancesView = ns.wf('InstancesView')
|
|
520
521
|
|
|
521
|
-
const updater =
|
|
522
|
-
const t =
|
|
522
|
+
const updater = kb.updater
|
|
523
|
+
const t = kb.findTypeURIs(subject)
|
|
523
524
|
let tracker
|
|
524
525
|
|
|
525
526
|
// Whatever we are rendering, lets load the ontology
|
|
526
527
|
const flowOntology = ns.wf('').doc()
|
|
527
|
-
if (!
|
|
528
|
+
if (!kb.holds(undefined, undefined, undefined, flowOntology)) {
|
|
528
529
|
// If not loaded already
|
|
529
|
-
$rdf.parse(require('./wf.js'),
|
|
530
|
+
$rdf.parse(require('./wf.js'), kb, flowOntology.uri, 'text/turtle') // Load ontology directly
|
|
530
531
|
}
|
|
531
532
|
const userInterfaceOntology = ns.ui('').doc()
|
|
532
|
-
if (!
|
|
533
|
+
if (!kb.holds(undefined, undefined, undefined, userInterfaceOntology)) {
|
|
533
534
|
// If not loaded already
|
|
534
|
-
$rdf.parse(require('./ui.js'),
|
|
535
|
+
$rdf.parse(require('./ui.js'), kb, userInterfaceOntology.uri, 'text/turtle') // Load ontology directly
|
|
535
536
|
}
|
|
536
537
|
|
|
537
538
|
// Render a single issue
|
|
538
539
|
if (
|
|
539
540
|
t['http://www.w3.org/2005/01/wf/flow#Task'] ||
|
|
540
|
-
|
|
541
|
+
kb.holds(subject, ns.wf('tracker'))
|
|
541
542
|
) {
|
|
542
543
|
renderSingleIssue().then(() => console.log('Single issue rendered'))
|
|
543
544
|
} else if (t['http://www.w3.org/2005/01/wf/flow#Tracker']) {
|
|
@@ -567,7 +568,7 @@ export default {
|
|
|
567
568
|
|
|
568
569
|
loginOutButton = authn.loginStatusBox(dom, webIdUri => {
|
|
569
570
|
if (webIdUri) {
|
|
570
|
-
context.me =
|
|
571
|
+
context.me = kb.sym(webIdUri)
|
|
571
572
|
console.log('Web ID set from login button: ' + webIdUri)
|
|
572
573
|
paneDiv.removeChild(loginOutButton)
|
|
573
574
|
// enable things
|
package/newTracker.js
CHANGED
|
@@ -3,6 +3,7 @@ import { store } from 'solid-logic'
|
|
|
3
3
|
|
|
4
4
|
const $rdf = UI.rdf
|
|
5
5
|
const ns = UI.ns
|
|
6
|
+
const kb = store
|
|
6
7
|
const updater = store.updater
|
|
7
8
|
|
|
8
9
|
/* Button for making a whole new tracker
|
|
@@ -29,16 +30,16 @@ export function newTrackerButton (thisTracker, context) {
|
|
|
29
30
|
if (u.slice(0, oldBase.length) === oldBase) {
|
|
30
31
|
u = base + u.slice(oldBase.length)
|
|
31
32
|
}
|
|
32
|
-
return
|
|
33
|
+
return kb.sym(u)
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
const appPathSegment = 'issuetracker.w3.org' // how to allocate this string and connect to
|
|
36
37
|
// console.log("Ready to make new instance at "+ws)
|
|
37
38
|
const sp = UI.ns.space
|
|
38
|
-
const
|
|
39
|
+
const kb = context.session.store
|
|
39
40
|
|
|
40
41
|
if (!base) {
|
|
41
|
-
base =
|
|
42
|
+
base = kb.any(ws, sp('uriPrefix')).value
|
|
42
43
|
if (base.slice(-1) !== '/') {
|
|
43
44
|
$rdf.log.error(
|
|
44
45
|
appPathSegment + ': No / at end of uriPrefix ' + base
|
|
@@ -51,8 +52,8 @@ export function newTrackerButton (thisTracker, context) {
|
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
const stateStore =
|
|
55
|
-
const newStore =
|
|
55
|
+
const stateStore = kb.any(thisTracker, ns.wf('stateStore'))
|
|
56
|
+
const newStore = kb.sym(base + 'store.ttl')
|
|
56
57
|
|
|
57
58
|
const here = thisTracker.doc()
|
|
58
59
|
|
|
@@ -61,7 +62,7 @@ export function newTrackerButton (thisTracker, context) {
|
|
|
61
62
|
const there = morph(here)
|
|
62
63
|
const newTracker = morph(thisTracker)
|
|
63
64
|
|
|
64
|
-
const myConfig =
|
|
65
|
+
const myConfig = kb.statementsMatching(
|
|
65
66
|
undefined,
|
|
66
67
|
undefined,
|
|
67
68
|
undefined,
|
|
@@ -69,7 +70,7 @@ export function newTrackerButton (thisTracker, context) {
|
|
|
69
70
|
)
|
|
70
71
|
for (let i = 0; i < myConfig.length; i++) {
|
|
71
72
|
const st = myConfig[i]
|
|
72
|
-
|
|
73
|
+
kb.add(
|
|
73
74
|
morph(st.subject),
|
|
74
75
|
morph(st.predicate),
|
|
75
76
|
morph(st.object),
|
|
@@ -79,15 +80,15 @@ export function newTrackerButton (thisTracker, context) {
|
|
|
79
80
|
|
|
80
81
|
// Keep a paper trail @@ Revisit when we have non-public ones @@ Privacy
|
|
81
82
|
//
|
|
82
|
-
|
|
83
|
+
kb.add(newTracker, UI.ns.space('inspiration'), thisTracker, stateStore)
|
|
83
84
|
|
|
84
|
-
|
|
85
|
+
kb.add(newTracker, UI.ns.space('inspiration'), thisTracker, there)
|
|
85
86
|
|
|
86
|
-
// $rdf.log.debug("\n Ready to put " +
|
|
87
|
+
// $rdf.log.debug("\n Ready to put " + kb.statementsMatching(undefined, undefined, undefined, there)); //@@
|
|
87
88
|
|
|
88
89
|
updater.put(
|
|
89
90
|
there,
|
|
90
|
-
|
|
91
|
+
kb.statementsMatching(undefined, undefined, undefined, there),
|
|
91
92
|
'text/turtle',
|
|
92
93
|
function (uri2, ok, message) {
|
|
93
94
|
if (ok) {
|