-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New
git
ontology component with new GitTracked
mixin
This aims to be the foundation for data models of Git-tracked content. The availability of a globally unique identifier in this context allows for great flexibility in model specification. At the same time, introducing a `identifier:true` property in a class hierarchy can be problematic, because turning an existing base-class property into an identifier in a derived class does not seem to be possible (#30). This approach uses a dedicated mixin class for this purpose. The identifier itself uses the `meta_id` slot, and is intentionally distinct from the `gitsha` property. The identifier is composed from the `gitsha` by adding a corresponding namespace prefix. This keeps the identifier property uniform across unrelated classes, while also preserving the semantics of the identifier type.
- Loading branch information
Showing
2 changed files
with
43 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
id: https://concepts.datalad.org/git | ||
name: git | ||
title: Git concepts | ||
description: > | ||
TODO | ||
prefixes: | ||
gitsha: https://concepts.datalad.org/namespace/gitsha/ | ||
dlco: https://concepts.datalad.org/ontology/ | ||
imports: | ||
- meta_utils | ||
- types | ||
default_prefix: dlco | ||
|
||
|
||
slots: | ||
gitsha: | ||
description: >- | ||
SHA1 identifier of a Git object. | ||
range: SHA1 | ||
|
||
|
||
classes: | ||
GitTracked: | ||
mixin: true | ||
description: >- | ||
Mixin class for any ressource tracked by Git, thereby having a unique | ||
`gitsha` identifier. | ||
slots: | ||
- gitsha | ||
- meta_id | ||
slot_usage: | ||
meta_id: | ||
description: >- | ||
SHA1 based identifier in the form of a CURIE with an explicit | ||
`gitsha:` namespace prefix. | ||
equals_expression: "gitsha:{gitsha}" | ||
pattern: "^gitsha:[0-9a-f]{40}$" | ||
comments: | ||
- Because there can only be a single main `identifier`, this mixin | ||
cannot be used on classes that already have or inherited another | ||
property declared as `identifier:true`. |