• 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/SequenceElementItem.java
1
package com.knowledgepixels.nanodash.component;
2

3
import com.knowledgepixels.nanodash.Utils;
4
import com.knowledgepixels.nanodash.template.TemplateContext;
5
import com.knowledgepixels.nanodash.template.UnificationException;
6
import org.apache.wicket.markup.html.basic.Label;
7
import org.apache.wicket.markup.html.link.ExternalLink;
8
import org.apache.wicket.markup.html.panel.Panel;
9
import org.apache.wicket.model.Model;
10
import org.eclipse.rdf4j.model.IRI;
11
import org.eclipse.rdf4j.model.Literal;
12
import org.eclipse.rdf4j.model.Value;
13

14
/**
15
 * Represents a sequence element item.
16
 */
17
public class SequenceElementItem extends Panel implements ContextComponent {
18

19
    /**
20
     * Prefix for sequence element properties in RDF.
21
     */
22
    public static final String SEQUENCE_ELEMENT_PROPERTY_PREFIX = "http://www.w3.org/1999/02/22-rdf-syntax-ns#_";
23

24
    private final int number;
25

26
    /**
27
     * Constructor for creating a sequence element item.
28
     *
29
     * @param id      the component ID
30
     * @param iri     the IRI of the sequence element
31
     * @param number  the position of the element in the sequence
32
     * @param context the template context
33
     */
34
    public SequenceElementItem(String id, final IRI iri, int number, TemplateContext context) {
35
        super(id);
×
36
        this.number = number;
×
37
        context.getComponentModels().put(iri, Model.of(SEQUENCE_ELEMENT_PROPERTY_PREFIX + number));
×
38

39
        String labelString = "has element number ${number}";
×
40
        if (context.getTemplate().getLabel(iri) != null) {
×
41
            labelString = context.getTemplate().getLabel(iri);
×
42
        }
43
        String description = "This relation links a sequence/list to its element at position " + number + ".";
×
44
        if (labelString.contains(" - ")) description = labelString.replaceFirst("^.* - ", "");
×
45
        String label = labelString.replaceFirst(" - .*$", "");
×
46
        label = label.replaceAll("\\$\\{number\\}", number + "");
×
47

48
        add(new Label("description", description));
×
49
        add(Utils.getUriLink("uri", SEQUENCE_ELEMENT_PROPERTY_PREFIX + number));
×
50

51
        add(new ExternalLink("text", "", label));
×
52
    }
×
53

54
    /**
55
     * {@inheritDoc}
56
     */
57
    @Override
58
    public void removeFromContext() {
59
    }
×
60

61
    /**
62
     * {@inheritDoc}
63
     */
64
    @Override
65
    public boolean isUnifiableWith(Value v) {
66
        if (v == null) return true;
×
67
        if (v instanceof Literal) return false;
×
68
        return v.stringValue().equals(SEQUENCE_ELEMENT_PROPERTY_PREFIX + number);
×
69
    }
70

71
    /**
72
     * {@inheritDoc}
73
     */
74
    @Override
75
    public void unifyWith(Value v) throws UnificationException {
76
        if (v == null) return;
×
77
        if (!isUnifiableWith(v)) throw new UnificationException(v.stringValue());
×
78
    }
×
79

80
    /**
81
     * {@inheritDoc}
82
     */
83
    @Override
84
    public void fillFinished() {
85
    }
×
86

87
    /**
88
     * {@inheritDoc}
89
     */
90
    @Override
91
    public void finalizeValues() {
92
    }
×
93

94
    /**
95
     * <p>toString.</p>
96
     *
97
     * @return a {@link java.lang.String} object
98
     */
99
    public String toString() {
100
        return "[Sequence element]";
×
101
    }
102

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