gchq / gchq/MagmaCore

Kinds as rdfs:subClassOf

Open
#196 1 comment 0 reactions 1 assignee Claimed by @twalmsley View on GitHub
Dominant language
Java
Stars
30
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Instances of `kind_of_X` are new entity types, so as well as being `rdf:type kind_of_X` they should also be `rdfs:subClassOf X`.

E.g. for an instance of `kind_of_organization` the triples should be:

```
ex:1 rdf:type hqdm:kind_of_organization.
ex:1 rdfs:subClassOf hqdm:organization.
ex:1 hqdm:data_EntityName "National Government". # optional entity name
```

The `ClassServices.createKindOfX()` methods should add the `rdfs:subClassOf X` predicate.
Also, any entity that is a `member_of_kind` of, for example, `ex:1` above, should also be `rdf:type ex:1`†

E.g.:

```
ex:2 hqdm:member_of_kind ex:1.
ex:2 rdf:type ex:1.
```

This allows standard RDFS entailments to infer that:

1. `ex:1` is an `rdfs:class`
2. `ex:1` is of type `hqdm:kind_of_organization` and all its supertypes.
3. `ex:2` is of type `organization` and all of its supertypes.
4. When read from a triple store by MagmaCore, `ex:2` will implement the `Organization` interface and all of its super interfaces so `instanceof Organization` will be `true` and it can be cast to that type rather than simply being a `Thing`.

† I'm not sure how we enforce this, so some additional changes might need to be included to enforce this constraint, if it is even possible to do that.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.