-
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.
Merge pull request #47 from psychoinformatics-de/commit-model
Model `DataladDataset` as a Git `Commit`
- Loading branch information
Showing
50 changed files
with
343 additions
and
416 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
build/ | ||
*-stamp | ||
.*.swp | ||
*.rdf |
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,34 @@ | ||
See https://github.com/linkml/linkml/issues/1806 for | ||
problem and rationale re this patch | ||
--- jsonschemavalidator.py 2024-02-23 16:19:45.946867800 +0100 | ||
+++ jsonschemavalidator.py 2024-02-23 16:18:26.363624044 +0100 | ||
@@ -187,7 +187,27 @@ | ||
inargs["fmt"] = input_format | ||
|
||
try: | ||
- data_as_dict = loader.load_as_dict(source=input, **inargs) | ||
+ if input_format == 'yaml': | ||
+ from io import StringIO | ||
+ from hbreader import FileInfo | ||
+ import os | ||
+ import yaml | ||
+ metadata = FileInfo() | ||
+ data = loader._read_source( | ||
+ input, | ||
+ metadata=metadata, | ||
+ accept_header="text/yaml, application/yaml;q=0.9", | ||
+ ) | ||
+ if isinstance(data, str): | ||
+ data = StringIO(data) | ||
+ if metadata and metadata.source_file: | ||
+ data.name = os.path.relpath(metadata.source_file, | ||
+ metadata.base_path) | ||
+ data_as_dict = yaml.load(data, yaml.BaseLoader) | ||
+ else: | ||
+ data_as_dict = data | ||
+ else: | ||
+ data_as_dict = loader.load_as_dict(source=input, **inargs) | ||
except NotImplementedError: | ||
obj = loader.load(source=input, target_class=py_target_class, **inargs) | ||
data_as_dict = as_simple_dict(obj) | ||
|
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,22 @@ | ||
Make linkml-convert produce deterministic RDF output. | ||
See https://github.com/linkml/linkml/issues/1943 for details | ||
and caveats | ||
--- rdflib_dumper.py 2024-02-24 07:36:07.532183567 +0100 | ||
+++ rdflib_dumper.py 2024-02-24 07:36:26.279874637 +0100 | ||
@@ -6,6 +6,7 @@ | ||
|
||
from curies import Converter | ||
from rdflib import Graph, URIRef, XSD | ||
+from rdflib.compare import to_canonical_graph | ||
from rdflib.term import Node, BNode, Literal | ||
from rdflib.namespace import RDF | ||
|
||
@@ -66,7 +67,7 @@ | ||
if schemaview.namespaces()._base: | ||
g.base = schemaview.namespaces()._base | ||
self.inject_triples(element, schemaview, g) | ||
- return g | ||
+ return to_canonical_graph(g) | ||
|
||
def inject_triples(self, element: Any, schemaview: SchemaView, graph: Graph, target_type: ElementName = None) -> Node: | ||
""" |
13 changes: 0 additions & 13 deletions
13
src/examples/datalad-dataset-components/ContainerSE-DataladDataset-minimal.rdf
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -8,7 +8,14 @@ | |
{ | ||
"meta_id": "gitsha:558275f650574389dcbbf7cd8ab5046482473fc8", | ||
"meta_type": "dlccs:DataladDatasetVersionSE", | ||
"is_version_of": "datalad:0b76362c-aa27-11ee-be29-b3b123281259" | ||
"gitsha": "558275f650574389dcbbf7cd8ab5046482473fc8", | ||
"is_version_of": "datalad:0b76362c-aa27-11ee-be29-b3b123281259", | ||
"was_generated_by": { | ||
"was_associated_with": { | ||
"name": "Jane Doe", | ||
"email": "[email protected]" | ||
} | ||
} | ||
} | ||
], | ||
"@type": "ContainerSE" | ||
|
19 changes: 0 additions & 19 deletions
19
src/examples/datalad-dataset-components/ContainerSE-DataladDatasetVersion-linkage.rdf
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -4,4 +4,9 @@ components: | |
uuid: 0b76362c-aa27-11ee-be29-b3b123281259 | ||
- meta_id: gitsha:558275f650574389dcbbf7cd8ab5046482473fc8 | ||
meta_type: dlccs:DataladDatasetVersionSE | ||
gitsha: 558275f650574389dcbbf7cd8ab5046482473fc8 | ||
is_version_of: datalad:0b76362c-aa27-11ee-be29-b3b123281259 | ||
was_generated_by: | ||
was_associated_with: | ||
name: Jane Doe | ||
email: [email protected] |
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
{ | ||
"meta_id": "gitsha:558275f650574389dcbbf7cd8ab5046482473fc8", | ||
"meta_type": "dlccs:DataladDatasetVersionSE", | ||
"gitsha": "558275f650574389dcbbf7cd8ab5046482473fc8", | ||
"has_annex_remote": [ | ||
"annex:7e0bf3e7-7d46-4093-813e-b4009826c3bf" | ||
], | ||
|
@@ -25,7 +26,13 @@ | |
"relation": "gitsha:b94ef1797f7bfc1ac979be122e1b538bbb0d1d58", | ||
"at_location": "subdir/data.bin" | ||
} | ||
] | ||
], | ||
"was_generated_by": { | ||
"was_associated_with": { | ||
"name": "Jane Doe", | ||
"email": "[email protected]" | ||
} | ||
} | ||
}, | ||
{ | ||
"meta_id": "gitsha:56094a33cf330fef5b375aa813fc4dc07147729f", | ||
|
48 changes: 0 additions & 48 deletions
48
src/examples/datalad-dataset-components/ContainerSE-DatasetWFiles.rdf
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -6,6 +6,11 @@ components: | |
# dataset version | ||
- meta_id: gitsha:558275f650574389dcbbf7cd8ab5046482473fc8 | ||
meta_type: dlccs:DataladDatasetVersionSE | ||
gitsha: 558275f650574389dcbbf7cd8ab5046482473fc8 | ||
was_generated_by: | ||
was_associated_with: | ||
name: Jane Doe | ||
email: [email protected] | ||
is_version_of: datalad:0b76362c-aa27-11ee-be29-b3b123281259 | ||
has_annex_remote: | ||
- annex:7e0bf3e7-7d46-4093-813e-b4009826c3bf | ||
|
8 changes: 0 additions & 8 deletions
8
src/examples/datalad-dataset-components/DataladDatasetSE-minimal.rdf
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
src/examples/datalad-dataset-components/DataladDatasetVersionSE-commitprops.json
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,22 @@ | ||
{ | ||
"meta_id": "gitsha:558275f650574389dcbbf7cd8ab5046482473fc8", | ||
"meta_type": "dlccs:DataladDatasetVersionSE", | ||
"gitsha": "558275f650574389dcbbf7cd8ab5046482473fc8", | ||
"was_derived_from": [ | ||
"gitsha:a52963ce19a3e3628e9976555ffc8c422b29f054" | ||
], | ||
"was_generated_by": { | ||
"was_associated_with": { | ||
"name": "Jane Doe", | ||
"email": "[email protected]" | ||
}, | ||
"was_informed_by": { | ||
"was_associated_with": { | ||
"name": "Jane Doe", | ||
"email": "[email protected]" | ||
} | ||
} | ||
}, | ||
"description": "This message describes the changes done for this particular Dataset version.\n", | ||
"@type": "DataladDatasetVersionSE" | ||
} |
22 changes: 22 additions & 0 deletions
22
src/examples/datalad-dataset-components/DataladDatasetVersionSE-commitprops.yaml
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,22 @@ | ||
meta_id: gitsha:558275f650574389dcbbf7cd8ab5046482473fc8 | ||
meta_type: dlccs:DataladDatasetVersionSE | ||
gitsha: 558275f650574389dcbbf7cd8ab5046482473fc8 | ||
description: > | ||
This message describes the changes done for this particular | ||
Dataset version. | ||
was_derived_from: | ||
- gitsha:a52963ce19a3e3628e9976555ffc8c422b29f054 | ||
was_generated_by: | ||
# we cannot declare a datetime here, without causing validation | ||
# issues: https://github.com/linkml/linkml/issues/1806 | ||
#ended_at: 2002-05-30T09:30:10+06:00 | ||
was_associated_with: | ||
name: Jane Doe | ||
email: [email protected] | ||
was_informed_by: | ||
# we cannot declare a datetime here, without causing validation | ||
# issues: https://github.com/linkml/linkml/issues/1806 | ||
#ended_at: 2001-02-28T18:27:04+02:00 | ||
was_associated_with: | ||
name: Jane Doe | ||
email: [email protected] |
9 changes: 0 additions & 9 deletions
9
src/examples/datalad-dataset-version/AnnexRemoteSE-dataserviceprops.rdf
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
src/examples/datalad-dataset-version/AnnexRemoteSE-minimal.rdf
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
"is_version_of": { | ||
"uuid": "0b76362c-aa27-11ee-be29-b3b123281259" | ||
}, | ||
"gitsha": "558275f650574389dcbbf7cd8ab5046482473fc8", | ||
"has_annex_remote": { | ||
"annex:7e0bf3e7-7d46-4093-813e-b4009826c3bf": { | ||
"meta_id": "annex:7e0bf3e7-7d46-4093-813e-b4009826c3bf", | ||
|
@@ -32,5 +33,11 @@ | |
"at_location": "README.txt" | ||
} | ||
], | ||
"was_generated_by": { | ||
"was_associated_with": { | ||
"name": "Jane Doe", | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"@type": "DataladDatasetVersionSE" | ||
} |
33 changes: 0 additions & 33 deletions
33
src/examples/datalad-dataset-version/DataladDatasetVersionSE-full.rdf
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
src/examples/datalad-dataset-version/DataladDatasetVersionSE-full.yaml
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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
gitsha: 558275f650574389dcbbf7cd8ab5046482473fc8 | ||
was_generated_by: | ||
was_associated_with: | ||
name: Jane Doe | ||
email: [email protected] | ||
is_version_of: | ||
uuid: 0b76362c-aa27-11ee-be29-b3b123281259 | ||
has_annex_remote: | ||
|
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 |
---|---|---|
|
@@ -2,5 +2,12 @@ | |
"is_version_of": { | ||
"uuid": "0b76362c-aa27-11ee-be29-b3b123281259" | ||
}, | ||
"gitsha": "558275f650574389dcbbf7cd8ab5046482473fc8", | ||
"was_generated_by": { | ||
"was_associated_with": { | ||
"name": "Jane Doe", | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"@type": "DataladDatasetVersionSE" | ||
} |
8 changes: 0 additions & 8 deletions
8
src/examples/datalad-dataset-version/DataladDatasetVersionSE-minimal.rdf
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.