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

knowledgepixels / nanodash / 18889822546

28 Oct 2025 09:31PM UTC coverage: 14.519% (-0.4%) from 14.869%
18889822546

push

github

tkuhn
docs: Add comment line to code

510 of 4486 branches covered (11.37%)

Branch coverage included in aggregate %.

1358 of 8380 relevant lines covered (16.21%)

0.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

36.66
src/main/java/com/knowledgepixels/nanodash/Space.java
1
package com.knowledgepixels.nanodash;
2

3
import static com.knowledgepixels.nanodash.Utils.vf;
4

5
import java.io.Serializable;
6
import java.util.ArrayList;
7
import java.util.Calendar;
8
import java.util.Collections;
9
import java.util.HashMap;
10
import java.util.HashSet;
11
import java.util.List;
12
import java.util.Map;
13
import java.util.Set;
14

15
import org.eclipse.rdf4j.model.IRI;
16
import org.eclipse.rdf4j.model.Literal;
17
import org.eclipse.rdf4j.model.Statement;
18
import org.eclipse.rdf4j.model.vocabulary.DCTERMS;
19
import org.eclipse.rdf4j.model.vocabulary.OWL;
20
import org.nanopub.Nanopub;
21
import org.nanopub.extra.services.ApiResponse;
22
import org.nanopub.extra.services.ApiResponseEntry;
23
import org.nanopub.extra.services.QueryRef;
24
import org.nanopub.vocabulary.NTEMPLATE;
25
import org.slf4j.Logger;
26
import org.slf4j.LoggerFactory;
27

28
import com.github.jsonldjava.shaded.com.google.common.collect.Ordering;
29
import com.google.common.collect.ArrayListMultimap;
30
import com.google.common.collect.Multimap;
31
import com.knowledgepixels.nanodash.template.Template;
32
import com.knowledgepixels.nanodash.template.TemplateData;
33

34
import jakarta.xml.bind.DatatypeConverter;
35

36
/**
37
 * Class representing a "Space", which can be any kind of collaborative unit, like a project, group, or event.
38
 */
39
public class Space implements Serializable {
40

41
    private static final Logger logger = LoggerFactory.getLogger(Space.class);
3✔
42

43
    /**
44
     * The predicate to assign the admins of the space.
45
     */
46
    public static final IRI HAS_ADMIN = vf.createIRI("https://w3id.org/kpxl/gen/terms/hasAdmin");
4✔
47

48
    /**
49
     * The predicate for pinned templates in the space.
50
     */
51
    public static final IRI HAS_PINNED_TEMPLATE = vf.createIRI("https://w3id.org/kpxl/gen/terms/hasPinnedTemplate");
4✔
52

53
    /**
54
     * The predicate for pinned queries in the space.
55
     */
56
    public static final IRI HAS_PINNED_QUERY = vf.createIRI("https://w3id.org/kpxl/gen/terms/hasPinnedQuery");
4✔
57

58
    private static List<Space> spaceList;
59
    private static Map<String, List<Space>> spaceListByType;
60
    private static Map<String, Space> spacesByCoreInfo = new HashMap<>();
4✔
61
    private static Map<String, Space> spacesById;
62
    private static Map<Space, Set<Space>> subspaceMap;
63
    private static Map<Space, Set<Space>> superspaceMap;
64
    private static boolean loaded = false;
3✔
65

66
    /**
67
     * Refresh the list of spaces from the API response.
68
     *
69
     * @param resp The API response containing space data.
70
     */
71
    public static synchronized void refresh(ApiResponse resp) {
72
        spaceList = new ArrayList<>();
4✔
73
        spaceListByType = new HashMap<>();
4✔
74
        Map<String, Space> prevSpacesByCoreInfoPrev = spacesByCoreInfo;
2✔
75
        spacesByCoreInfo = new HashMap<>();
4✔
76
        spacesById = new HashMap<>();
4✔
77
        subspaceMap = new HashMap<>();
4✔
78
        superspaceMap = new HashMap<>();
4✔
79
        for (ApiResponseEntry entry : resp.getData()) {
11✔
80
            Space space = new Space(entry);
5✔
81
            Space prevSpace = prevSpacesByCoreInfoPrev.get(space.getCoreInfoString());
6✔
82
            if (prevSpace != null) space = prevSpace;
4✔
83
            spaceList.add(space);
4✔
84
            spaceListByType.computeIfAbsent(space.getType(), k -> new ArrayList<>()).add(space);
13✔
85
            spacesByCoreInfo.put(space.getCoreInfoString(), space);
6✔
86
            spacesById.put(space.getId(), space);
6✔
87
        }
1✔
88
        for (Space space : spaceList) {
10✔
89
            Space superSpace = space.getIdSuperspace();
3✔
90
            if (superSpace == null) continue;
3✔
91
            subspaceMap.computeIfAbsent(superSpace, k -> new HashSet<>()).add(space);
12✔
92
            superspaceMap.computeIfAbsent(space, k -> new HashSet<>()).add(superSpace);
12✔
93
        }
1✔
94
        loaded = true;
2✔
95
    }
1✔
96

97
    /**
98
     * Check if the spaces have been loaded.
99
     *
100
     * @return true if loaded, false otherwise.
101
     */
102
    public static boolean isLoaded() {
103
        return loaded;
×
104
    }
105

106
    public static boolean areAllSpacesInitialized() {
107
        for (Space space : spaceList) {
×
108
            if (!space.isDataInitialized()) return false;
×
109
        }
×
110
        return true;
×
111
    }
112

113
    public static void triggerAllDataUpdates() {
114
        for (Space space : spaceList) {
×
115
            space.triggerDataUpdate();
×
116
        }
×
117
    }
×
118

119
    /**
120
     * Ensure that the spaces are loaded, fetching them from the API if necessary.
121
     */
122
    public static void ensureLoaded() {
123
        if (spaceList == null) {
2✔
124
            refresh(QueryApiAccess.forcedGet(new QueryRef("get-spaces")));
6✔
125
        }
126
    }
1✔
127

128
    /**
129
     * Get the list of all spaces.
130
     *
131
     * @return List of spaces.
132
     */
133
    public static List<Space> getSpaceList() {
134
        ensureLoaded();
×
135
        return spaceList;
×
136
    }
137

138
    /**
139
     * Get the list of spaces of a specific type.
140
     *
141
     * @param type The type of spaces to retrieve.
142
        System.err.println("REFRESH...");
143
     * @return List of spaces of the specified type.
144
     */
145
    public static List<Space> getSpaceList(String type) {
146
        ensureLoaded();
×
147
        return spaceListByType.computeIfAbsent(type, k -> new ArrayList<>());
×
148
    }
149

150
    /**
151
     * Get a space by its id.
152
     *
153
     * @param id The id of the space.
154
     * @return The corresponding Space object, or null if not found.
155
     */
156
    public static Space get(String id) {
157
        ensureLoaded();
1✔
158
        return spacesById.get(id);
5✔
159
    }
160

161
    /**
162
     * Mark all spaces as needing a data update.
163
     */
164
    public static void refresh() {
165
        refresh(QueryApiAccess.forcedGet(new QueryRef("get-spaces")));
6✔
166
        for (Space space : spaceList) {
10✔
167
            space.dataNeedsUpdate = true;
3✔
168
        }
1✔
169
    }
1✔
170

171
    private String id, label, rootNanopubId, type;
172
    private Nanopub rootNanopub = null;
3✔
173
    private SpaceData data = new SpaceData();
5✔
174

175
    private static class SpaceData implements Serializable {
2✔
176

177
        List<String> altIds = new ArrayList<>();
5✔
178

179
        String description = null;
3✔
180
        Calendar startDate, endDate;
181
        IRI defaultProvenance = null;
3✔
182

183
        List<IRI> admins = new ArrayList<>();
5✔
184
        Map<IRI, Set<SpaceMemberRole>> users = new HashMap<>();
5✔
185
        List<SpaceMemberRole> roles = new ArrayList<>();
5✔
186
        Map<IRI, SpaceMemberRole> roleMap = new HashMap<>();
5✔
187

188
        Map<String, IRI> adminPubkeyMap = new HashMap<>();
5✔
189
        Set<Serializable> pinnedResources = new HashSet<>();
5✔
190
        List<ResourceView> views = new ArrayList<>();
5✔
191
        Set<String> pinGroupTags = new HashSet<>();
5✔
192
        Map<String, Set<Serializable>> pinnedResourceMap = new HashMap<>();
6✔
193

194
        void addAdmin(IRI admin) {
195
            // TODO This isn't efficient for long owner lists:
196
            if (admins.contains(admin)) return;
5!
197
            admins.add(admin);
5✔
198
            UserData ud = User.getUserData();
2✔
199
            for (String pubkeyhash : ud.getPubkeyhashes(admin, true)) {
14✔
200
                adminPubkeyMap.put(pubkeyhash, admin);
6✔
201
            }
1✔
202
        }
1✔
203

204
    }
205

206
    private boolean dataInitialized = false;
3✔
207
    private boolean dataNeedsUpdate = true;
3✔
208

209
    private Space(ApiResponseEntry resp) {
2✔
210
        this.id = resp.get("space");
5✔
211
        this.label = resp.get("label");
5✔
212
        this.type = resp.get("type");
5✔
213
        this.rootNanopubId = resp.get("np");
5✔
214
        this.rootNanopub = Utils.getAsNanopub(rootNanopubId);
5✔
215
        setCoreData(data);
4✔
216
    }
1✔
217

218
    /**
219
     * Get the ID of the space.
220
     *
221
     * @return The space ID.
222
     */
223
    public String getId() {
224
        return id;
3✔
225
    }
226

227
    /**
228
     * Get the root nanopublication ID of the space.
229
     *
230
     * @return The root nanopub ID.
231
     */
232
    public String getRootNanopubId() {
233
        return rootNanopubId;
×
234
    }
235

236
    /**
237
     * Get a string combining the space ID and root nanopub ID for core identification.
238
     *
239
     * @return The core info string.
240
     */
241
    public String getCoreInfoString() {
242
        return id + " " + rootNanopubId;
6✔
243
    }
244

245
    /**
246
     * Get the root nanopublication of the space.
247
     *
248
     * @return The root Nanopub object.
249
     */
250
    public Nanopub getRootNanopub() {
251
        return rootNanopub;
×
252
    }
253

254
    /**
255
     * Get the label of the space.
256
     *
257
     * @return The space label.
258
     */
259
    public String getLabel() {
260
        return label;
×
261
    }
262

263
    /**
264
     * Get the type of the space.
265
     *
266
     * @return The space type.
267
     */
268
    public String getType() {
269
        return type;
3✔
270
    }
271

272
    /**
273
     * Get the start date of the space.
274
     *
275
     * @return The start date as a Calendar object, or null if not set.
276
     */
277
    public Calendar getStartDate() {
278
        return data.startDate;
×
279
    }
280

281
    /**
282
     * Get the end date of the space.
283
     *
284
     * @return The end date as a Calendar object, or null if not set.
285
     */
286
    public Calendar getEndDate() {
287
        return data.endDate;
×
288
    }
289

290
    /**
291
     * Get a simplified label for the type of space by removing any namespace prefix.
292
     *
293
     * @return The simplified type label.
294
     */
295
    public String getTypeLabel() {
296
        return type.replaceFirst("^.*/", "");
×
297
    }
298

299
    /**
300
     * Get the description of the space.
301
     *
302
     * @return The description string.
303
     */
304
    public String getDescription() {
305
        return data.description;
×
306
    }
307

308
    /**
309
     * Check if the space data has been initialized.
310
     *
311
     * @return true if initialized, false otherwise.
312
     */
313
    public boolean isDataInitialized() {
314
        triggerDataUpdate();
×
315
        return dataInitialized;
×
316
    }
317

318
    /**
319
     * Get the list of admins in this space.
320
     *
321
     * @return List of admin IRIs.
322
     */
323
    public List<IRI> getAdmins() {
324
        ensureInitialized();
×
325
        return data.admins;
×
326
    }
327

328
    /**
329
     * Get the list of members in this space.
330
     *
331
     * @return List of member IRIs.
332
     */
333
    public List<IRI> getUsers() {
334
        ensureInitialized();
×
335
        List<IRI> users = new ArrayList<IRI>(data.users.keySet());
×
336
        users.sort(User.getUserData().userComparator);
×
337
        return users;
×
338
    }
339

340
    /**
341
     * Get the roles of a specific member in this space.
342
     *
343
     * @param userId The IRI of the member.
344
     * @return Set of roles assigned to the member, or null if the member is not part of this space.
345
     */
346
    public Set<SpaceMemberRole> getMemberRoles(IRI userId) {
347
        ensureInitialized();
×
348
        return data.users.get(userId);
×
349
    }
350

351
    /**
352
     * Check if a user is a member of this space.
353
     *
354
     * @param userId The IRI of the user to check.
355
     * @return true if the user is a member, false otherwise.
356
     */
357
    public boolean isMember(IRI userId) {
358
        ensureInitialized();
×
359
        return data.users.containsKey(userId);
×
360
    }
361

362
    public boolean isAdminPubkey(String pubkey) {
363
        ensureInitialized();
×
364
        return data.adminPubkeyMap.containsKey(pubkey);
×
365
    }
366

367
    /**
368
     * Get the list of pinned resources in this space.
369
     *
370
     * @return List of pinned resources.
371
     */
372
    public Set<Serializable> getPinnedResources() {
373
        ensureInitialized();
×
374
        return data.pinnedResources;
×
375
    }
376

377
    /**
378
     * Get the set of tags used for grouping pinned resources.
379
     *
380
     * @return Set of tags.
381
     */
382
    public Set<String> getPinGroupTags() {
383
        ensureInitialized();
×
384
        return data.pinGroupTags;
×
385
    }
386

387
    /**
388
     * Get a map of pinned resources grouped by their tags.
389
     *
390
     * @return Map where keys are tags and values are lists of pinned resources (Templates or GrlcQueries).
391
     */
392
    public Map<String, Set<Serializable>> getPinnedResourceMap() {
393
        ensureInitialized();
×
394
        return data.pinnedResourceMap;
×
395
    }
396

397
    /**
398
     * Get the list of views (GrlcQueries) associated with this space.
399
     *
400
     * @return List of GrlcQuery views.
401
     */
402
    public List<ResourceView> getViews() {
403
        return data.views;
×
404
    }
405

406
    /**
407
     * Get the default provenance IRI for this space.
408
     *
409
     * @return The default provenance IRI, or null if not set.
410
     */
411
    public IRI getDefaultProvenance() {
412
        return data.defaultProvenance;
×
413
    }
414

415
    /**
416
     * Get the roles defined in this space.
417
     *
418
     * @return List of roles.
419
     */
420
    public List<SpaceMemberRole> getRoles() {
421
        return data.roles;
×
422
    }
423

424
    /**
425
     * Get the super ID of the space.
426
     *
427
     * @return Always returns null. Use getIdSuperspace() instead.
428
     */
429
    public String getSuperId() {
430
        return null;
×
431
    }
432

433
    /**
434
     * Get the superspace ID.
435
     *
436
     * @return The superspace, or null if not applicable.
437
     */
438
    public Space getIdSuperspace() {
439
        if (!id.matches("https?://[^/]+/.*/[^/]*/?")) return null;
5!
440
        String superId = id.replaceFirst("(https?://[^/]+/.*)/[^/]*/?", "$1");
6✔
441
        if (spacesById.containsKey(superId)) {
4✔
442
            return spacesById.get(superId);
5✔
443
        }
444
        return null;
2✔
445
    }
446

447
    /**
448
     * Get superspaces of this space.
449
     *
450
     * @return List of superspaces.
451
     */
452
    public List<Space> getSuperspaces() {
453
        if (superspaceMap.containsKey(this)) {
×
454
            List<Space> superspaces = new ArrayList<>(superspaceMap.get(this));
×
455
            Collections.sort(superspaces, Ordering.usingToString());
×
456
            return superspaces;
×
457
        }
458
        return new ArrayList<>();
×
459
    }
460

461
    /**
462
     * Get subspaces of this space.
463
     *
464
     * @return List of subspaces.
465
     */
466
    public List<Space> getSubspaces() {
467
        if (subspaceMap.containsKey(this)) {
×
468
            List<Space> subspaces = new ArrayList<>(subspaceMap.get(this));
×
469
            Collections.sort(subspaces, Ordering.usingToString());
×
470
            return subspaces;
×
471
        }
472
        return new ArrayList<>();
×
473
    }
474

475
    /**
476
     * Get subspaces of a specific type.
477
     *
478
     * @param type The type of subspaces to retrieve.
479
     * @return List of subspaces of the specified type.
480
     */
481
    public List<Space> getSubspaces(String type) {
482
        List<Space> l = new ArrayList<>();
×
483
        for (Space s : getSubspaces()) {
×
484
            if (s.getType().equals(type)) l.add(s);
×
485
        }
×
486
        return l;
×
487
    }
488

489
    /**
490
     * Get alternative IDs for the space.
491
     *
492
     * @return List of alternative IDs.
493
     */
494
    public List<String> getAltIDs() {
495
        return data.altIds;
×
496
    }
497

498
    private synchronized void ensureInitialized() {
499
        Thread thread = triggerDataUpdate();
×
500
        if (!dataInitialized && thread != null) {
×
501
            try {
502
                thread.join();
×
503
            } catch (InterruptedException ex) {
×
504
                logger.error("failed to join thread", ex);
×
505
            }
×
506
        }
507
    }
×
508

509
    private synchronized Thread triggerDataUpdate() {
510
        if (dataNeedsUpdate) {
×
511
            Thread thread = new Thread(() -> {
×
512
                try {
513
                    SpaceData newData = new SpaceData();
×
514
                    setCoreData(newData);
×
515

516
                    newData.roles.add(SpaceMemberRole.ADMIN_ROLE);
×
517
                    newData.roleMap.put(SpaceMemberRole.HAS_ADMIN_PREDICATE, SpaceMemberRole.ADMIN_ROLE);
×
518

519
                    // TODO Improve this:
520
                    Multimap<String, String> spaceIds = ArrayListMultimap.create();
×
521
                    Multimap<String, String> resourceIds = ArrayListMultimap.create();
×
522
                    spaceIds.put("space", id);
×
523
                    resourceIds.put("resource", id);
×
524
                    for (String id : newData.altIds) {
×
525
                        spaceIds.put("space", id);
×
526
                        resourceIds.put("resource", id);
×
527
                    }
×
528

529
                    // TODO Is this correct? Shouldn't this be run several times until no new admins are found?
530
                    for (ApiResponseEntry r : QueryApiAccess.get(new QueryRef("get-admins", spaceIds)).getData()) {
×
531
                        String pubkeyhash = r.get("pubkey");
×
532
                        if (newData.adminPubkeyMap.containsKey(pubkeyhash)) {
×
533
                            IRI adminId = Utils.vf.createIRI(r.get("admin"));
×
534
                            newData.addAdmin(adminId);
×
535
                            newData.users.computeIfAbsent(adminId, (k) -> new HashSet<>()).add(SpaceMemberRole.ADMIN_ROLE);
×
536
                        }
537
                    }
×
538
                    newData.admins.sort(User.getUserData().userComparator);
×
539

540
                    Multimap<String, String> getSpaceMemberParams = ArrayListMultimap.create(spaceIds);
×
541

542
                    for (ApiResponseEntry r : QueryApiAccess.get(new QueryRef("get-space-member-roles", spaceIds)).getData()) {
×
543
                        if (!newData.adminPubkeyMap.containsKey(r.get("pubkey"))) continue;
×
544
                        SpaceMemberRole role = new SpaceMemberRole(r);
×
545
                        newData.roles.add(role);
×
546

547
                        // TODO Handle cases of overlapping properties:
548
                        for (IRI p : role.getRegularProperties()) newData.roleMap.put(p, role);
×
549
                        for (IRI p : role.getInverseProperties()) newData.roleMap.put(p, role);
×
550

551
                        role.addRoleParams(getSpaceMemberParams);
×
552
                    }
×
553

554
                    for (ApiResponseEntry r : QueryApiAccess.get(new QueryRef("get-space-members", getSpaceMemberParams)).getData()) {
×
555
                        IRI memberId = Utils.vf.createIRI(r.get("member"));
×
556
                        SpaceMemberRole role = newData.roleMap.get(Utils.vf.createIRI(r.get("role")));
×
557
                        newData.users.computeIfAbsent(memberId, (k) -> new HashSet<>()).add(role);
×
558
                    }
×
559

560
                    for (ApiResponseEntry r : QueryApiAccess.get(new QueryRef("get-pinned-templates", spaceIds)).getData()) {
×
561
                        if (!newData.adminPubkeyMap.containsKey(r.get("pubkey"))) continue;
×
562
                        Template t = TemplateData.get().getTemplate(r.get("template"));
×
563
                        if (t == null) continue;
×
564
                        newData.pinnedResources.add(t);
×
565
                        String tag = r.get("tag");
×
566
                        if (tag != null && !tag.isEmpty()) {
×
567
                            newData.pinGroupTags.add(r.get("tag"));
×
568
                            newData.pinnedResourceMap.computeIfAbsent(tag, k -> new HashSet<>()).add(TemplateData.get().getTemplate(r.get("template")));
×
569
                        }
570
                    }
×
571
                    for (ApiResponseEntry r : QueryApiAccess.get(new QueryRef("get-pinned-queries", spaceIds)).getData()) {
×
572
                        if (!newData.adminPubkeyMap.containsKey(r.get("pubkey"))) continue;
×
573
                        GrlcQuery query = GrlcQuery.get(r.get("query"));
×
574
                        if (query == null) continue;
×
575
                        newData.pinnedResources.add(query);
×
576
                        String tag = r.get("tag");
×
577
                        if (tag != null && !tag.isEmpty()) {
×
578
                            newData.pinGroupTags.add(r.get("tag"));
×
579
                            newData.pinnedResourceMap.computeIfAbsent(tag, k -> new HashSet<>()).add(query);
×
580
                        }
581
                    }
×
582
                    for (ApiResponseEntry r : QueryApiAccess.get(new QueryRef("get-view-displays", resourceIds)).getData()) {
×
583
                        if (!newData.adminPubkeyMap.containsKey(r.get("pubkey"))) continue;
×
584
                        ResourceView view = ResourceView.get(r.get("view"));
×
585
                        if (view == null) continue;
×
586
                        newData.views.add(view);
×
587
                    }
×
588
                    data = newData;
×
589
                    dataInitialized = true;
×
590
                } catch (Exception ex) {
×
591
                    logger.error("Error while trying to update space data: {}", ex);
×
592
                }
×
593
            });
×
594
            thread.start();
×
595
            dataNeedsUpdate = false;
×
596
            return thread;
×
597
        }
598
        return null;
×
599
    }
600

601
    private void setCoreData(SpaceData data) {
602
        for (Statement st : rootNanopub.getAssertion()) {
12✔
603
            if (st.getSubject().stringValue().equals(getId())) {
7!
604
                if (st.getPredicate().equals(OWL.SAMEAS) && st.getObject() instanceof IRI objIri) {
14!
605
                    data.altIds.add(objIri.stringValue());
7✔
606
                } else if (st.getPredicate().equals(DCTERMS.DESCRIPTION)) {
5✔
607
                    data.description = st.getObject().stringValue();
6✔
608
                } else if (st.getPredicate().stringValue().equals("http://schema.org/startDate")) {
6✔
609
                    try {
610
                        data.startDate = DatatypeConverter.parseDateTime(st.getObject().stringValue());
6✔
611
                    } catch (IllegalArgumentException ex) {
×
612
                        logger.error("Failed to parse date {}", st.getObject().stringValue());
×
613
                    }
1✔
614
                } else if (st.getPredicate().stringValue().equals("http://schema.org/endDate")) {
6✔
615
                    try {
616
                        data.endDate = DatatypeConverter.parseDateTime(st.getObject().stringValue());
6✔
617
                    } catch (IllegalArgumentException ex) {
×
618
                        logger.error("Failed to parse date {}", st.getObject().stringValue());
×
619
                    }
1✔
620
                } else if (st.getPredicate().equals(HAS_ADMIN) && st.getObject() instanceof IRI obj) {
14!
621
                    data.addAdmin(obj);
4✔
622
                } else if (st.getPredicate().equals(HAS_PINNED_TEMPLATE) && st.getObject() instanceof IRI obj) {
5!
623
                    data.pinnedResources.add(TemplateData.get().getTemplate(obj.stringValue()));
×
624
                } else if (st.getPredicate().equals(HAS_PINNED_QUERY) && st.getObject() instanceof IRI obj) {
5!
625
                    data.pinnedResources.add(GrlcQuery.get(obj.stringValue()));
×
626
                } else if (st.getPredicate().equals(NTEMPLATE.HAS_DEFAULT_PROVENANCE) && st.getObject() instanceof IRI obj) {
5!
627
                    data.defaultProvenance = obj;
1✔
628
                }
629
            } else if (st.getPredicate().equals(NTEMPLATE.HAS_TAG) && st.getObject() instanceof Literal l) {
×
630
                data.pinGroupTags.add(l.stringValue());
×
631
                Set<Serializable> list = data.pinnedResourceMap.get(l.stringValue());
×
632
                if (list == null) {
×
633
                    list = new HashSet<>();
×
634
                    data.pinnedResourceMap.put(l.stringValue(), list);
×
635
                }
636
                list.add(TemplateData.get().getTemplate(st.getSubject().stringValue()));
×
637
            }
638
        }
1✔
639
    }
1✔
640

641
    @Override
642
    public String toString() {
643
        return id;
×
644
    }
645

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