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

knowledgepixels / nanodash / 17837235071

18 Sep 2025 05:58PM UTC coverage: 13.87%. Remained the same
17837235071

push

github

tkuhn
chore: Remove serialVersionUIDs

443 of 4022 branches covered (11.01%)

Branch coverage included in aggregate %.

1133 of 7341 relevant lines covered (15.43%)

0.68 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.NanopubAlreadyFinalizedException;
24
import org.nanopub.NanopubCreator;
25
import org.nanopub.vocabulary.NTEMPLATE;
26
import org.slf4j.Logger;
27
import org.slf4j.LoggerFactory;
28

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

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

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

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

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

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

67
        addRepetitionGroup();
×
68

69
        ListView<WebMarkupContainer> v = new ListView<WebMarkupContainer>("statement-group", viewElements) {
×
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, NanopubAlreadyFinalizedException {
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 List<StatementPartItem> statementParts;
298
        private List<ValueItem> localItems = new ArrayList<>();
×
299
        private boolean filled = false;
×
300

301
        private List<ValueItem> items = new ArrayList<>();
×
302

303
        Label addRepetitionButton, removeRepetitionButton, optionalMark;
304

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

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

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

337
                        @Override
338
                        protected void onEvent(AjaxRequestTarget target) {
339
                            addRepetitionGroup(new RepetitionGroup());
×
340
                            target.add(StatementItem.this);
×
341
                            target.appendJavaScript("updateElements();");
×
342
                        }
×
343

344
                    });
345
                } else {
346
                    statement.add(new Label("add-repetition", "").setVisible(false));
×
347
                }
348
                if (isFirstLine) {
×
349
                    removeRepetitionButton = new Label("remove-repetition", "-");
×
350
                    statement.add(removeRepetitionButton);
×
351
                    removeRepetitionButton.add(new AjaxEventBehavior("click") {
×
352

353
                        @Override
354
                        protected void onEvent(AjaxRequestTarget target) {
355
                            RepetitionGroup.this.remove();
×
356
                            target.appendJavaScript("updateElements();");
×
357
                            target.add(StatementItem.this);
×
358
                        }
×
359

360
                    });
361
                } else {
362
                    statement.add(new Label("remove-repetition", "").setVisible(false));
×
363
                }
364
            }
×
365
        }
×
366

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

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

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

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

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

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

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

448
        private String getRepeatSuffix() {
449
            return getRepeatSuffix(getRepeatIndex());
×
450
        }
451

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

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

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

479
        private Value transform(Value value) {
480
            if (!(value instanceof IRI)) {
×
481
                return value;
×
482
            }
483
            IRI iri = (IRI) value;
×
484
            String iriString = iri.stringValue();
×
485
            iriString = iriString.replaceAll("~~ARTIFACTCODE~~", "~~~ARTIFACTCODE~~~");
×
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
                    iriString += getRepeatSuffix();
×
491
                }
492
            }
493
            return vf.createIRI(iriString);
×
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) throws NanopubAlreadyFinalizedException {
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
                            logger.error("Could not create IRI from value: {}", value, ex);
×
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