-
Notifications
You must be signed in to change notification settings - Fork 0
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 #2 from Knowledge-Graph-Hub/schema_and_test_tweaks
minor changes to schema and test merge.yaml to get a passing test
- Loading branch information
Showing
4 changed files
with
78 additions
and
5 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
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,53 @@ | ||
configuration: | ||
output_directory: data/merged | ||
checkpoint: false | ||
curie_map: | ||
# define non-canonical CURIE to IRI mappings (for RDF) | ||
node_properties: | ||
# define predicates that are to be treated as direct node properties (for RDF) | ||
predicate_mappings: | ||
# map non-canonical predicates to a property name (for RDF) | ||
property_types: | ||
# define the type for non-canonical properties for RDF export | ||
|
||
merged_graph: | ||
name: kg-microbe graph | ||
source: | ||
- name: "NCBITaxon" | ||
input: | ||
format: tsv | ||
filename: | ||
- data/transformed/ontologies/ncbitaxon_nodes.tsv | ||
- data/transformed/ontologies/ncbitaxon_edges.tsv | ||
- name: "CHEBI" | ||
input: | ||
format: tsv | ||
filename: | ||
- data/transformed/ontologies/chebi_nodes.tsv | ||
- data/transformed/ontologies/chebi_edges.tsv | ||
- name: "ENVO" | ||
input: | ||
format: tsv | ||
filename: | ||
- data/transformed/ontologies/envo_nodes.tsv | ||
- data/transformed/ontologies/envo_edges.tsv | ||
- name: "GO" | ||
input: | ||
format: tsv | ||
filename: | ||
- data/transformed/ontologies/go_nodes.tsv | ||
- data/transformed/ontologies/go_edges.tsv | ||
operations: | ||
- name: kgx.graph_operations.summarize_graph.generate_graph_stats | ||
args: | ||
graph_name: kg-microbe graph | ||
filename: merged_graph_stats.yaml | ||
node_facet_properties: | ||
- provided_by | ||
edge_facet_properties: | ||
- provided_by | ||
- source | ||
destination: | ||
- format: tsv | ||
compression: tar.gz | ||
filename: merged-kg |
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 @@ | ||
"""Data test.""" | ||
import os | ||
import glob | ||
import unittest | ||
|
||
from linkml_runtime.loaders import yaml_loader | ||
from kg_microbe_merge.schema.merge_datamodel import MergeKG | ||
|
||
ROOT = os.path.join(os.path.dirname(__file__), '..') | ||
DATA_DIR = os.path.join(ROOT, "tests", "data") | ||
|
||
EXAMPLE_FILES = glob.glob(os.path.join(DATA_DIR, 'test_merge_schema.yaml')) | ||
|
||
|
||
class TestData(unittest.TestCase): | ||
"""Test data and datamodel.""" | ||
|
||
def test_data(self): | ||
"""Data test.""" | ||
for path in EXAMPLE_FILES: | ||
obj = yaml_loader.load(path, target_class=MergeKG) | ||
assert obj |