• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

knowledgepixels / nanodash / 17302137193

28 Aug 2025 04:35PM UTC coverage: 11.965% (-0.4%) from 12.355%
17302137193

Pull #244

github

web-flow
Merge 4e969b0ee into 3323a35f1
Pull Request #244: Use vocabularies with latest version of `nanopub-java`

331 of 3840 branches covered (8.62%)

Branch coverage included in aggregate %.

943 of 6808 relevant lines covered (13.85%)

0.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
src/main/java/com/knowledgepixels/nanodash/component/StatementItem.java
1
package com.knowledgepixels.nanodash.component;
2

3
import com.knowledgepixels.nanodash.template.ContextType;
4
import com.knowledgepixels.nanodash.template.Template;
5
import com.knowledgepixels.nanodash.template.TemplateContext;
6
import com.knowledgepixels.nanodash.template.UnificationException;
7
import org.apache.wicket.AttributeModifier;
8
import org.apache.wicket.ajax.AjaxEventBehavior;
9
import org.apache.wicket.ajax.AjaxRequestTarget;
10
import org.apache.wicket.behavior.AttributeAppender;
11
import org.apache.wicket.markup.html.WebMarkupContainer;
12
import org.apache.wicket.markup.html.basic.Label;
13
import org.apache.wicket.markup.html.list.ListItem;
14
import org.apache.wicket.markup.html.list.ListView;
15
import org.apache.wicket.markup.html.panel.Panel;
16
import org.apache.wicket.model.IModel;
17
import org.eclipse.rdf4j.model.IRI;
18
import org.eclipse.rdf4j.model.Statement;
19
import org.eclipse.rdf4j.model.Value;
20
import org.eclipse.rdf4j.model.ValueFactory;
21
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
22
import org.nanopub.MalformedNanopubException;
23
import org.nanopub.NanopubCreator;
24
import org.nanopub.vocabulary.NTEMPLATE;
25

26
import java.io.Serializable;
27
import java.util.*;
28

29
/**
30
 * Represents a single item in a statement, which can be a subject, predicate, or object.
31
 */
32
public class StatementItem extends Panel {
33

34
    private static final long serialVersionUID = 1L;
35

36
    private TemplateContext context;
37
    private IRI statementId;
38
    private List<IRI> statementPartIds = new ArrayList<>();
×
39
    private List<WebMarkupContainer> viewElements = new ArrayList<>();
×
40
    private List<RepetitionGroup> repetitionGroups = new ArrayList<>();
×
41
    private boolean repetitionGroupsChanged = true;
×
42
    private Set<IRI> iriSet = new HashSet<>();
×
43
    private boolean isMatched = false;
×
44

45
    /**
46
     * Constructor for creating a StatementItem with a specific ID and statement ID.
47
     *
48
     * @param id          the Wicket component ID
49
     * @param statementId the IRI of the statement this item represents
50
     * @param context     the template context containing information about the template and its items
51
     */
52
    public StatementItem(String id, IRI statementId, TemplateContext context) {
53
        super(id);
×
54

55
        this.statementId = statementId;
×
56
        this.context = context;
×
57
        setOutputMarkupId(true);
×
58

59
        if (isGrouped()) {
×
60
            statementPartIds.addAll(getTemplate().getStatementIris(statementId));
×
61
        } else {
62
            statementPartIds.add(statementId);
×
63
        }
64

65
        addRepetitionGroup();
×
66

67
        ListView<WebMarkupContainer> v = new ListView<WebMarkupContainer>("statement-group", viewElements) {
×
68

69
            private static final long serialVersionUID = 1L;
70

71
            @Override
72
            protected void populateItem(ListItem<WebMarkupContainer> item) {
73
                item.add(item.getModelObject());
×
74
            }
×
75

76
        };
77
        v.setOutputMarkupId(true);
×
78
        add(v);
×
79
    }
×
80

81
    /**
82
     * Adds a new repetition group to this StatementItem with a default RepetitionGroup.
83
     */
84
    public void addRepetitionGroup() {
85
        addRepetitionGroup(new RepetitionGroup());
×
86
    }
×
87

88
    /**
89
     * Adds a new repetition group to this StatementItem.
90
     *
91
     * @param rg the RepetitionGroup to add
92
     */
93
    public void addRepetitionGroup(RepetitionGroup rg) {
94
        repetitionGroups.add(rg);
×
95
        repetitionGroupsChanged = true;
×
96
    }
×
97

98
    /**
99
     * {@inheritDoc}
100
     */
101
    @Override
102
    protected void onBeforeRender() {
103
        if (repetitionGroupsChanged) {
×
104
            updateViewElements();
×
105
            finalizeValues();
×
106
        }
107
        repetitionGroupsChanged = false;
×
108
        super.onBeforeRender();
×
109
    }
×
110

111
    private void updateViewElements() {
112
        viewElements.clear();
×
113
        boolean first = true;
×
114
        for (RepetitionGroup r : repetitionGroups) {
×
115
            if (isGrouped() && !first) {
×
116
                viewElements.add(new HorizontalLine("statement"));
×
117
            }
118
            viewElements.addAll(r.getStatementParts());
×
119
            boolean isOnly = repetitionGroups.size() == 1;
×
120
            boolean isLast = repetitionGroups.get(repetitionGroups.size() - 1) == r;
×
121
            r.addRepetitionButton.setVisible(!context.isReadOnly() && isRepeatable() && isLast);
×
122
            r.removeRepetitionButton.setVisible(!context.isReadOnly() && isRepeatable() && !isOnly);
×
123
            r.optionalMark.setVisible(isOnly);
×
124
            first = false;
×
125
        }
×
126
        String htmlClassString = "";
×
127
        if (!context.isReadOnly() && isOptional()) {
×
128
            htmlClassString += "nanopub-optional ";
×
129
        }
130
        boolean singleItem = context.getStatementItems().size() == 1;
×
131
        boolean repeatableOrRepeated = (!context.isReadOnly() && isRepeatable()) || (context.isReadOnly() && getRepetitionCount() > 1);
×
132
        if ((isGrouped() || repeatableOrRepeated) && !singleItem) {
×
133
            htmlClassString += "nanopub-group ";
×
134
        }
135
        if (!htmlClassString.isEmpty()) {
×
136
            add(new AttributeModifier("class", htmlClassString));
×
137
        }
138
    }
×
139

140
    /**
141
     * Adds the triples of this statement item to the given NanopubCreator.
142
     *
143
     * @param npCreator the NanopubCreator to which the triples will be added
144
     * @throws org.nanopub.MalformedNanopubException if the statement item is not properly set up
145
     */
146
    public void addTriplesTo(NanopubCreator npCreator) throws MalformedNanopubException {
147
        if (hasEmptyElements()) {
×
148
            if (isOptional()) {
×
149
                return;
×
150
            } else {
151
                throw new MalformedNanopubException("Field of statement not set.");
×
152
            }
153
        }
154
        for (RepetitionGroup rg : repetitionGroups) {
×
155
            rg.addTriplesTo(npCreator);
×
156
        }
×
157
    }
×
158

159
    private Template getTemplate() {
160
        return context.getTemplate();
×
161
    }
162

163
    /**
164
     * Returns the number of the repetition groups for this statement item.
165
     *
166
     * @return the number of repetition groups
167
     */
168
    public int getRepetitionCount() {
169
        return repetitionGroups.size();
×
170
    }
171

172
    /**
173
     * Returns the IRI of the statement this item represents.
174
     *
175
     * @return the statement ID
176
     */
177
    public boolean isOptional() {
178
        return repetitionGroups.size() == 1 && getTemplate().isOptionalStatement(statementId);
×
179
    }
180

181
    /**
182
     * Checks if this statement item is grouped.
183
     *
184
     * @return true if the statement item is grouped, false otherwise
185
     */
186
    public boolean isGrouped() {
187
        return getTemplate().isGroupedStatement(statementId);
×
188
    }
189

190
    /**
191
     * Checks if this statement item is repeatable.
192
     *
193
     * @return true if the statement item is repeatable, false otherwise
194
     */
195
    public boolean isRepeatable() {
196
        return getTemplate().isRepeatableStatement(statementId);
×
197
    }
198

199
    /**
200
     * Checks if this statement item has empty elements.
201
     *
202
     * @return true if any of the repetition groups has empty elements, false otherwise
203
     */
204
    public boolean hasEmptyElements() {
205
        return repetitionGroups.get(0).hasEmptyElements();
×
206
    }
207

208
    /**
209
     * Returns the set of IRIs associated with this statement item.
210
     *
211
     * @return a set of IRIs
212
     */
213
    public Set<IRI> getIriSet() {
214
        return iriSet;
×
215
    }
216

217
    /**
218
     * Checks if this statement item will match any triple.
219
     *
220
     * @return true if it will match any triple, false otherwise
221
     */
222
    public boolean willMatchAnyTriple() {
223
        return repetitionGroups.get(0).matches(dummyStatementList);
×
224
    }
225

226
    /**
227
     * Fills this statement item with the provided list of statements, matching them against the repetition groups.
228
     *
229
     * @param statements the list of statements to match against
230
     * @throws com.knowledgepixels.nanodash.template.UnificationException if the statements cannot be unified with this statement item
231
     */
232
    public void fill(List<Statement> statements) throws UnificationException {
233
        if (isMatched) return;
×
234
        if (repetitionGroups.size() == 1) {
×
235
            RepetitionGroup rg = repetitionGroups.get(0);
×
236
            if (rg.matches(statements)) {
×
237
                rg.fill(statements);
×
238
            } else {
239
                return;
×
240
            }
241
        } else {
×
242
            return;
×
243
        }
244
        isMatched = true;
×
245
        if (!isRepeatable()) return;
×
246
        while (true) {
247
            RepetitionGroup newGroup = new RepetitionGroup();
×
248
            if (newGroup.matches(statements)) {
×
249
                newGroup.fill(statements);
×
250
                addRepetitionGroup(newGroup);
×
251
            } else {
252
                newGroup.disconnect();
×
253
                return;
×
254
            }
255
        }
×
256
    }
257

258
    /**
259
     * Marks the filling of this statement item as finished, indicating that all values have been filled.
260
     */
261
    public void fillFinished() {
262
        for (RepetitionGroup rg : repetitionGroups) {
×
263
            rg.fillFinished();
×
264
        }
×
265
    }
×
266

267
    /**
268
     * Finalizes the values of all ValueItems in this statement item.
269
     */
270
    public void finalizeValues() {
271
        for (RepetitionGroup rg : repetitionGroups) {
×
272
            rg.finalizeValues();
×
273
        }
×
274
    }
×
275

276
    /**
277
     * Returns true if the statement item has been matched with a set of statements.
278
     *
279
     * @return true if matched, false otherwise
280
     */
281
    public boolean isMatched() {
282
        return isMatched;
×
283
    }
284

285
    /**
286
     * Checks if this statement item is empty, meaning it has no filled repetition groups.
287
     *
288
     * @return true if the statement item is empty, false otherwise
289
     */
290
    public boolean isEmpty() {
291
        return repetitionGroups.size() == 1 && repetitionGroups.get(0).isEmpty();
×
292
    }
293

294

295
    public class RepetitionGroup implements Serializable {
296

297
        private static final long serialVersionUID = 1L;
298

299
        private List<StatementPartItem> statementParts;
300
        private List<ValueItem> localItems = new ArrayList<>();
×
301
        private boolean filled = false;
×
302

303
        private List<ValueItem> items = new ArrayList<>();
×
304

305
        Label addRepetitionButton, removeRepetitionButton, optionalMark;
306

307
        public RepetitionGroup() {
×
308
            statementParts = new ArrayList<>();
×
309
            for (IRI s : statementPartIds) {
×
310
                StatementPartItem statement = new StatementPartItem("statement",
×
311
                        makeValueItem("subj", getTemplate().getSubject(s), s),
×
312
                        makeValueItem("pred", getTemplate().getPredicate(s), s),
×
313
                        makeValueItem("obj", getTemplate().getObject(s), s)
×
314
                );
315
                statementParts.add(statement);
×
316

317
                // Some of the methods of StatementItem and RepetitionGroup don't work properly before this
318
                // object is fully instantiated:
319
                boolean isFirstGroup = repetitionGroups.size() == 0;
×
320
                boolean isFirstLine = statementParts.size() == 1;
×
321
                boolean isLastLine = statementParts.size() == statementPartIds.size();
×
322
                boolean isOptional = getTemplate().isOptionalStatement(statementId);
×
323

324
                if (statementParts.size() == 1 && !isFirstGroup) {
×
325
                    statement.add(new AttributeAppender("class", " separate-statement"));
×
326
                }
327
                if (!context.isReadOnly() && isOptional && isLastLine) {
×
328
                    optionalMark = new Label("label", "(optional)");
×
329
                } else {
330
                    optionalMark = new Label("label", "");
×
331
                    optionalMark.setVisible(false);
×
332
                }
333
                statement.add(optionalMark);
×
334
                if (isLastLine) {
×
335
                    addRepetitionButton = new Label("add-repetition", "+");
×
336
                    statement.add(addRepetitionButton);
×
337
                    addRepetitionButton.add(new AjaxEventBehavior("click") {
×
338
                        private static final long serialVersionUID = 1L;
339

340
                        @Override
341
                        protected void onEvent(AjaxRequestTarget target) {
342
                            addRepetitionGroup(new RepetitionGroup());
×
343
                            target.add(StatementItem.this);
×
344
                            target.appendJavaScript("updateElements();");
×
345
                        }
×
346
                    });
347
                } else {
348
                    statement.add(new Label("add-repetition", "").setVisible(false));
×
349
                }
350
                if (isFirstLine) {
×
351
                    removeRepetitionButton = new Label("remove-repetition", "-");
×
352
                    statement.add(removeRepetitionButton);
×
353
                    removeRepetitionButton.add(new AjaxEventBehavior("click") {
×
354
                        private static final long serialVersionUID = 1L;
355

356
                        @Override
357
                        protected void onEvent(AjaxRequestTarget target) {
358
                            RepetitionGroup.this.remove();
×
359
                            target.appendJavaScript("updateElements();");
×
360
                            target.add(StatementItem.this);
×
361
                        }
×
362
                    });
363
                } else {
364
                    statement.add(new Label("remove-repetition", "").setVisible(false));
×
365
                }
366
            }
×
367
        }
×
368

369
        private ValueItem makeValueItem(String id, Value value, IRI statementPartId) {
370
            if (isFirst() && value instanceof IRI) {
×
371
                iriSet.add((IRI) value);
×
372
            }
373
            ValueItem vi = new ValueItem(id, transform(value), statementPartId, this);
×
374
            localItems.add(vi);
×
375
            items.add(vi);
×
376
            return vi;
×
377
        }
378

379
        private void disconnect() {
380
            for (ValueItem vi : new ArrayList<>(localItems)) {
×
381
                // TODO These remove operations on list are slow. Improve:
382
                localItems.remove(vi);
×
383
                items.remove(vi);
×
384
                vi.removeFromContext();
×
385
            }
×
386
        }
×
387

388
        /**
389
         * Returns the statement parts.
390
         *
391
         * @return a list of StatementPartItem objects representing the statement parts
392
         */
393
        public List<StatementPartItem> getStatementParts() {
394
            return statementParts;
×
395
        }
396

397
        /**
398
         * Returns the index of this repetition group in the list of repetition groups.
399
         *
400
         * @return the index of this repetition group
401
         */
402
        public int getRepeatIndex() {
403
            if (!repetitionGroups.contains(this)) return repetitionGroups.size();
×
404
            return repetitionGroups.indexOf(this);
×
405
        }
406

407
        /**
408
         * Returns true if the repeat index if the first one.
409
         *
410
         * @return true if the repeat index is 0, false otherwise
411
         */
412
        public boolean isFirst() {
413
            return getRepeatIndex() == 0;
×
414
        }
415

416
        /**
417
         * Returns true if the repeat index is the last one.
418
         *
419
         * @return true if the repeat index is the last one, false otherwise
420
         */
421
        public boolean isLast() {
422
            return getRepeatIndex() == repetitionGroups.size() - 1;
×
423
        }
424

425
        private void remove() {
426
            String thisSuffix = getRepeatSuffix();
×
427
            for (IRI iriBase : iriSet) {
×
428
                IRI thisIri = vf.createIRI(iriBase + thisSuffix);
×
429
                if (context.getComponentModels().containsKey(thisIri)) {
×
430
                    IModel<String> swapModel1 = context.getComponentModels().get(thisIri);
×
431
                    for (int i = getRepeatIndex() + 1; i < repetitionGroups.size(); i++) {
×
432
                        IModel<String> swapModel2 = context.getComponentModels().get(vf.createIRI(iriBase + getRepeatSuffix(i)));
×
433
                        if (swapModel1 != null && swapModel2 != null) {
×
434
                            swapModel1.setObject(swapModel2.getObject());
×
435
                        }
436
                        swapModel1 = swapModel2;
×
437
                    }
438
                    // Clear last object:
439
                    if (swapModel1 != null) swapModel1.setObject("");
×
440
                }
441
            }
×
442
            RepetitionGroup lastGroup = repetitionGroups.get(repetitionGroups.size() - 1);
×
443
            repetitionGroups.remove(lastGroup);
×
444
            for (ValueItem vi : lastGroup.items) {
×
445
                vi.removeFromContext();
×
446
            }
×
447
            repetitionGroupsChanged = true;
×
448
        }
×
449

450
        private String getRepeatSuffix() {
451
            return getRepeatSuffix(getRepeatIndex());
×
452
        }
453

454
        private String getRepeatSuffix(int i) {
455
            if (i == 0) return "";
×
456
            // TODO: Check that this double-underscore pattern isn't used otherwise:
457
            return "__" + i;
×
458
        }
459

460
        /**
461
         * Returns the template context associated.
462
         *
463
         * @return the TemplateContext
464
         */
465
        public TemplateContext getContext() {
466
            return context;
×
467
        }
468

469
        /**
470
         * Checks if this repetition group is optional.
471
         *
472
         * @return true if the repetition group is optional, false otherwise
473
         */
474
        public boolean isOptional() {
475
            if (!getTemplate().isOptionalStatement(statementId)) return false;
×
476
            if (repetitionGroups.size() == 0) return true;
×
477
            if (repetitionGroups.size() == 1 && repetitionGroups.get(0) == this) return true;
×
478
            return false;
×
479
        }
480

481
        private Value transform(Value value) {
482
            if (!(value instanceof IRI)) {
×
483
                return value;
×
484
            }
485
            IRI iri = (IRI) value;
×
486
            // Only add "__N" to URI from second repetition group on; for the first group, information about
487
            // narrow scopes is not yet complete.
488
            if (getRepeatIndex() > 0 && context.hasNarrowScope(iri)) {
×
489
                if (context.getTemplate().isPlaceholder(iri) || context.getTemplate().isLocalResource(iri)) {
×
490
                    return vf.createIRI(iri.stringValue() + getRepeatSuffix());
×
491
                }
492
            }
493
            return iri;
×
494
        }
495

496
        /**
497
         * Adds the triples of this repetition group to the given NanopubCreator.
498
         *
499
         * @param npCreator the NanopubCreator to which the triples will be added
500
         */
501
        public void addTriplesTo(NanopubCreator npCreator) {
502
            Template t = getTemplate();
×
503
            for (IRI s : statementPartIds) {
×
504
                IRI subj = context.processIri((IRI) transform(t.getSubject(s)));
×
505
                IRI pred = context.processIri((IRI) transform(t.getPredicate(s)));
×
506
                Value obj = context.processValue(transform(t.getObject(s)));
×
507
                if (context.getType() == ContextType.ASSERTION) {
×
508
                    npCreator.addAssertionStatement(subj, pred, obj);
×
509
                } else if (context.getType() == ContextType.PROVENANCE) {
×
510
                    npCreator.addProvenanceStatement(subj, pred, obj);
×
511
                } else if (context.getType() == ContextType.PUBINFO) {
×
512
                    npCreator.addPubinfoStatement(subj, pred, obj);
×
513
                }
514
            }
×
515
            for (ValueItem vi : items) {
×
516
                if (vi.getComponent() instanceof GuidedChoiceItem) {
×
517
                    String value = ((GuidedChoiceItem) vi.getComponent()).getModel().getObject();
×
518
                    if (value != null && GuidedChoiceItem.getLabel(value) != null) {
×
519
                        String label = GuidedChoiceItem.getLabel(value);
×
520
                        if (label.length() > 1000) label = label.substring(0, 997) + "...";
×
521
                        try {
522
                            npCreator.addPubinfoStatement(vf.createIRI(value), NTEMPLATE.HAS_LABEL_FROM_API, vf.createLiteral(label));
×
523
                        } catch (IllegalArgumentException ex) {
×
524
                            ex.printStackTrace();
×
525
                        }
×
526
                    }
527
                }
528
            }
×
529
        }
×
530

531
        private boolean hasEmptyElements() {
532
            for (IRI s : statementPartIds) {
×
533
                if (context.processIri((IRI) transform(getTemplate().getSubject(s))) == null) return true;
×
534
                if (context.processIri((IRI) transform(getTemplate().getPredicate(s))) == null) return true;
×
535
                if (context.processValue(transform(getTemplate().getObject(s))) == null) return true;
×
536
            }
×
537
            return false;
×
538
        }
539

540
        /**
541
         * Checks if this repetition group is empty, meaning it has no filled items.
542
         *
543
         * @return true if the repetition group is empty, false otherwise
544
         */
545
        public boolean isEmpty() {
546
            for (IRI s : statementPartIds) {
×
547
                Template t = getTemplate();
×
548
                IRI subj = t.getSubject(s);
×
549
                if (t.isPlaceholder(subj) && context.hasNarrowScope(subj) && context.processIri((IRI) transform(subj)) != null)
×
550
                    return false;
×
551
                IRI pred = t.getPredicate(s);
×
552
                if (t.isPlaceholder(pred) && context.hasNarrowScope(pred) && context.processIri((IRI) transform(pred)) != null)
×
553
                    return false;
×
554
                Value obj = t.getObject(s);
×
555
                if (obj instanceof IRI && t.isPlaceholder((IRI) obj) && context.hasNarrowScope((IRI) obj) && context.processValue(transform(obj)) != null)
×
556
                    return false;
×
557
            }
×
558
            return true;
×
559
        }
560

561
        /**
562
         * Checks if this repetition group matches the provided list of statements.
563
         *
564
         * @param statements the list of statements to match against
565
         * @return true if the repetition group matches, false otherwise
566
         */
567
        public boolean matches(List<Statement> statements) {
568
            if (filled) return false;
×
569
            List<Statement> st = new ArrayList<>(statements);
×
570
            for (StatementPartItem p : statementParts) {
×
571
                Statement matchedStatement = null;
×
572
                for (Statement s : st) {
×
573
                    if (
×
574
                            p.getPredicate().isUnifiableWith(s.getPredicate()) &&  // checking predicate first optimizes performance
×
575
                            p.getSubject().isUnifiableWith(s.getSubject()) &&
×
576
                            p.getObject().isUnifiableWith(s.getObject())) {
×
577
                        matchedStatement = s;
×
578
                        break;
×
579
                    }
580
                }
×
581
                if (matchedStatement == null) {
×
582
                    return false;
×
583
                } else {
584
                    st.remove(matchedStatement);
×
585
                }
586
            }
×
587
            return true;
×
588
        }
589

590
        /**
591
         * Fills this repetition group with the provided list of statements, unifying them with the statement parts.
592
         *
593
         * @param statements the list of statements to match against
594
         * @throws UnificationException if the statements cannot be unified with this repetition group
595
         */
596
        public void fill(List<Statement> statements) throws UnificationException {
597
            if (filled) throw new UnificationException("Already filled");
×
598
            for (StatementPartItem p : statementParts) {
×
599
                Statement matchedStatement = null;
×
600
                for (Statement s : statements) {
×
601
                    if (
×
602
                            p.getPredicate().isUnifiableWith(s.getPredicate()) &&  // checking predicate first optimizes performance
×
603
                            p.getSubject().isUnifiableWith(s.getSubject()) &&
×
604
                            p.getObject().isUnifiableWith(s.getObject())) {
×
605
                        p.getPredicate().unifyWith(s.getPredicate());
×
606
                        p.getSubject().unifyWith(s.getSubject());
×
607
                        p.getObject().unifyWith(s.getObject());
×
608
                        matchedStatement = s;
×
609
                        break;
×
610
                    }
611
                }
×
612
                if (matchedStatement == null) {
×
613
                    throw new UnificationException("Unification seemed to work but then didn't");
×
614
                } else {
615
                    statements.remove(matchedStatement);
×
616
                }
617
                filled = true;
×
618
            }
×
619
        }
×
620

621
        /**
622
         * Marks the filling of this repetition group as finished, indicating that all values have been filled.
623
         */
624
        public void fillFinished() {
625
            for (ValueItem vi : items) {
×
626
                vi.fillFinished();
×
627
            }
×
628
        }
×
629

630
        /**
631
         * Finalizes the values of all ValueItems in this repetition group.
632
         */
633
        public void finalizeValues() {
634
            for (ValueItem vi : items) {
×
635
                vi.finalizeValues();
×
636
            }
×
637
        }
×
638

639
    }
640

641
    private static final ValueFactory vf = SimpleValueFactory.getInstance();
×
642
    private static final List<Statement> dummyStatementList = new ArrayList<Statement>(Arrays.asList(vf.createStatement(vf.createIRI("http://dummy.com/"), vf.createIRI("http://dummy.com/"), vf.createIRI("http://dummy.com/"))));
×
643

644
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc