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

knowledgepixels / nanodash / 17380144000

01 Sep 2025 02:12PM UTC coverage: 12.03% (+0.05%) from 11.978%
17380144000

push

github

ashleycaselli
refactor: replace printStackTrace with logger.error for better error handling

330 of 3850 branches covered (8.57%)

Branch coverage included in aggregate %.

958 of 6857 relevant lines covered (13.97%)

0.62 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
import org.slf4j.Logger;
26
import org.slf4j.LoggerFactory;
27

28
import java.io.Serializable;
29
import java.util.*;
30

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

36
    private static final long serialVersionUID = 1L;
37

38
    private TemplateContext context;
39
    private IRI statementId;
40
    private List<IRI> statementPartIds = new ArrayList<>();
×
41
    private List<WebMarkupContainer> viewElements = new ArrayList<>();
×
42
    private List<RepetitionGroup> repetitionGroups = new ArrayList<>();
×
43
    private boolean repetitionGroupsChanged = true;
×
44
    private Set<IRI> iriSet = new HashSet<>();
×
45
    private boolean isMatched = false;
×
46
    private static final Logger logger = LoggerFactory.getLogger(StatementItem.class);
×
47

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

58
        this.statementId = statementId;
×
59
        this.context = context;
×
60
        setOutputMarkupId(true);
×
61

62
        if (isGrouped()) {
×
63
            statementPartIds.addAll(getTemplate().getStatementIris(statementId));
×
64
        } else {
65
            statementPartIds.add(statementId);
×
66
        }
67

68
        addRepetitionGroup();
×
69

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

72
            private static final long serialVersionUID = 1L;
73

74
            @Override
75
            protected void populateItem(ListItem<WebMarkupContainer> item) {
76
                item.add(item.getModelObject());
×
77
            }
×
78

79
        };
80
        v.setOutputMarkupId(true);
×
81
        add(v);
×
82
    }
×
83

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

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

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

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

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

162
    private Template getTemplate() {
163
        return context.getTemplate();
×
164
    }
165

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

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

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

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

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

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

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

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

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

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

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

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

297

298
    public class RepetitionGroup implements Serializable {
299

300
        private static final long serialVersionUID = 1L;
301

302
        private List<StatementPartItem> statementParts;
303
        private List<ValueItem> localItems = new ArrayList<>();
×
304
        private boolean filled = false;
×
305

306
        private List<ValueItem> items = new ArrayList<>();
×
307

308
        Label addRepetitionButton, removeRepetitionButton, optionalMark;
309

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

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

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

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

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

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

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

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

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

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

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

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

453
        private String getRepeatSuffix() {
454
            return getRepeatSuffix(getRepeatIndex());
×
455
        }
456

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

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

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

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

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

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

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

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

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

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

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

642
    }
643

644
    private static final ValueFactory vf = SimpleValueFactory.getInstance();
×
645
    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/"))));
×
646

647
}
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