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

knowledgepixels / nanodash / 18008293554

25 Sep 2025 01:00PM UTC coverage: 13.469% (+0.1%) from 13.373%
18008293554

push

github

tkuhn
feat(Spaces): Use new role model

436 of 4084 branches covered (10.68%)

Branch coverage included in aggregate %.

1125 of 7506 relevant lines covered (14.99%)

0.66 hits per line

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

0.0
src/main/java/com/knowledgepixels/nanodash/SpaceMemberRole.java
1
package com.knowledgepixels.nanodash;
2

3
import java.io.Serializable;
4
import java.util.stream.Stream;
5

6
import org.eclipse.rdf4j.model.IRI;
7
import org.nanopub.extra.services.ApiResponseEntry;
8

9
import com.google.common.collect.Multimap;
10

11
public class SpaceMemberRole implements Serializable {
12

13
    private IRI id;
14
    private String label, name, title;
15
    private IRI[] regularProperties, inverseProperties;
16

17
    public SpaceMemberRole(ApiResponseEntry e) {
×
18
        this.id = Utils.vf.createIRI(e.get("role"));
×
19
        this.label = e.get("roleLabel");
×
20
        this.name = e.get("roleName");
×
21
        this.title = e.get("roleTitle");
×
22
        regularProperties = stringToIriArray(e.get("regularProperties"));
×
23
        inverseProperties = stringToIriArray(e.get("inverseProperties"));
×
24
    }
×
25

26
    private SpaceMemberRole(IRI id, String label, String name, String title, IRI[] regularProperties, IRI[] inverseProperties) {
×
27
        this.id = id;
×
28
        this.label = label;
×
29
        this.name = name;
×
30
        this.title = title;
×
31
        this.regularProperties = regularProperties;
×
32
        this.inverseProperties = inverseProperties;
×
33
    }
×
34

35
    public IRI getId() {
36
        return id;
×
37
    }
38

39
    public String getLabel() {
40
        return label;
×
41
    }
42

43
    public String getName() {
44
        return name;
×
45
    }
46

47
    public String getTitle() {
48
        return title;
×
49
    }
50

51
    public IRI[] getRegularProperties() {
52
        return regularProperties;
×
53
    }
54

55
    public IRI[] getInverseProperties() {
56
        return inverseProperties;
×
57
    }
58

59
    public void addRoleParams(Multimap<String, String> params) {
60
        for (IRI p : regularProperties) params.put("role", p.stringValue());
×
61
        for (IRI p : inverseProperties) params.put("invrole", p.stringValue());
×
62
    }
×
63

64
    public static final IRI HAS_ADMIN_PREDICATE = Utils.vf.createIRI("https://w3id.org/kpxl/gen/terms/hasAdmin");
×
65
    private static final IRI ADMIN_ROLE_IRI = Utils.vf.createIRI("https://w3id.org/np/RAHlMUH4GnbkUmGTK_eecBk3OBFn55VyQHC0BDlpOcCPg/adminRole");
×
66
    public static final SpaceMemberRole ADMIN_ROLE = new SpaceMemberRole(ADMIN_ROLE_IRI, "Admin role", "admin", "Admins", new IRI[] {HAS_ADMIN_PREDICATE}, new IRI[] {});
×
67

68
    private static IRI[] stringToIriArray(String string) {
69
        if (string == null || string.isBlank()) return new IRI[] {};
×
70
        return Stream.of(string.split(" ")).map(s -> Utils.vf.createIRI(s)).toArray(IRI[]::new);
×
71
    }
72

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