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

knowledgepixels / nanodash / 23528008920

25 Mar 2026 06:26AM UTC coverage: 16.386% (+0.004%) from 16.382%
23528008920

push

github

tkuhn
fix: read 'label' URL parameter on ResourcePartPage

The label param was ignored — the page always derived the label from
the resource ID. Now it uses the URL parameter when provided, falling
back to the ID-derived label otherwise.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

751 of 5639 branches covered (13.32%)

Branch coverage included in aggregate %.

1900 of 10539 relevant lines covered (18.03%)

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

3
import com.knowledgepixels.nanodash.ApiCache;
4
import org.apache.wicket.Component;
5
import org.apache.wicket.markup.html.basic.Label;
6
import org.eclipse.rdf4j.model.Model;
7
import org.nanopub.extra.services.QueryRef;
8
import org.slf4j.Logger;
9
import org.slf4j.LoggerFactory;
10

11
/**
12
 * A component that asynchronously loads and displays the RDF result of a CONSTRUCT query.
13
 */
14
public abstract class RdfResultComponent extends ResultComponent {
15

16
    private final QueryRef queryRef;
17
    private Model model = null;
×
18
    private static final Logger logger = LoggerFactory.getLogger(RdfResultComponent.class);
×
19

20
    /**
21
     * Constructor.
22
     *
23
     * @param id       the component id
24
     * @param queryRef the QueryRef for the CONSTRUCT query
25
     */
26
    public RdfResultComponent(String id, QueryRef queryRef) {
27
        super(id);
×
28
        this.queryRef = queryRef;
×
29
    }
×
30

31
    private static final long LAZY_LOAD_TIMEOUT_MS = 60_000;
32

33
    @Override
34
    public Component getLazyLoadComponent(String markupId) {
35
        long deadline = System.currentTimeMillis() + LAZY_LOAD_TIMEOUT_MS;
×
36
        while (System.currentTimeMillis() < deadline) {
×
37
            if (!ApiCache.isRunning(queryRef)) {
×
38
                try {
39
                    model = ApiCache.retrieveRdfModelAsync(queryRef);
×
40
                    if (model != null) break;
×
41
                } catch (Exception ex) {
×
42
                    return new Label(markupId, "<span class=\"negative\">API call failed.</span>").setEscapeModelStrings(false);
×
43
                }
×
44
            }
45
            try {
46
                Thread.sleep(100);
×
47
            } catch (InterruptedException ex) {
×
48
                Thread.currentThread().interrupt();
×
49
                logger.error("Interrupted while waiting for RDF response", ex);
×
50
                break;
×
51
            }
×
52
        }
53
        if (model == null) {
×
54
            logger.error("Timed out waiting for RDF response for {}", queryRef);
×
55
            return new Label(markupId, "<span class=\"negative\">Loading timed out. Please reload the page.</span>").setEscapeModelStrings(false);
×
56
        }
57
        return getRdfResultComponent(markupId, model);
×
58
    }
59

60
    @Override
61
    protected boolean isContentReady() {
62
        return model != null || !ApiCache.isRunning(queryRef);
×
63
    }
64

65
    /**
66
     * Implement to return the component that displays the RDF result.
67
     *
68
     * @param markupId the markup ID for the component
69
     * @param model    the RDF model from the CONSTRUCT query
70
     * @return a Component that displays the RDF model
71
     */
72
    public abstract Component getRdfResultComponent(String markupId, Model model);
73

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