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

knowledgepixels / nanodash / 17424747928

03 Sep 2025 06:13AM UTC coverage: 12.048% (-0.02%) from 12.066%
17424747928

push

github

tkuhn
Update dependencies and adapt to new exceptions in nanopub-java

331 of 3866 branches covered (8.56%)

Branch coverage included in aggregate %.

967 of 6908 relevant lines covered (14.0%)

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.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 static final long serialVersionUID = 1L;
38

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

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

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

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

69
        addRepetitionGroup();
×
70

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

73
            private static final long serialVersionUID = 1L;
74

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

298

299
    public class RepetitionGroup implements Serializable {
300

301
        private static final long serialVersionUID = 1L;
302

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

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

309
        Label addRepetitionButton, removeRepetitionButton, optionalMark;
310

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

643
    }
644

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

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