yarrrml_template_builder 0.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/Changelog.md +1 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +39 -0
- data/LICENSE.txt +21 -0
- data/README.md +139 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/config/height_yarrrml_template.yaml +190 -0
- data/data/height.csv +2 -0
- data/doc/YARRRMLTemplateBuilder.html +121 -0
- data/doc/YARRRML_Template_Builder.html +6392 -0
- data/doc/YARRRML_Transform.html +1940 -0
- data/doc/_index.html +117 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +497 -0
- data/doc/file.README.html +214 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +214 -0
- data/doc/js/app.js +314 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +459 -0
- data/doc/top-level-namespace.html +112 -0
- data/examples/example_output_timerange.rb +56 -0
- data/examples/example_timed_process.rb +56 -0
- data/examples/example_timeinstant_process.rb +56 -0
- data/examples/example_two_linked_processes.rb +88 -0
- data/exemplar_docker_compose.yml +36 -0
- data/lib/yarrrml-template-builder.rb +2 -0
- data/lib/yarrrml_template_builder/version.rb +5 -0
- data/lib/yarrrml_template_builder/yarrrml_template_builder.rb +1485 -0
- data/lib/yarrrml_template_builder/yarrrml_transform.rb +181 -0
- data/lib/yarrrmltemplatebuilder.rb +5 -0
- data/run_me_to_test.rb +26 -0
- data/yarrrml_template_builder.gemspec +39 -0
- metadata +115 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
require "yarrrml-template-builder"
|
2
|
+
|
3
|
+
#"pid,uniqid,start,data
|
4
|
+
|
5
|
+
|
6
|
+
b = YARRRML_Template_Builder.new({
|
7
|
+
source_tag: "cde_timed_process",
|
8
|
+
sio_verbose: 1,
|
9
|
+
}
|
10
|
+
)
|
11
|
+
|
12
|
+
|
13
|
+
b.person_identifier_role_mappings({
|
14
|
+
personid_column: "pid",
|
15
|
+
uniqueid_column: "uniqid",
|
16
|
+
person_role_tag: "patientRole_status",
|
17
|
+
role_type: 'http://purl.obolibrary.org/obo/OBI_0000093',
|
18
|
+
role_label: "Patient for status recording"
|
19
|
+
})
|
20
|
+
# ===============================================
|
21
|
+
# @param params [Hash] a hash of options
|
22
|
+
# @option params :person_role_tag [String] the tag of the role that is fulfilled in this process (default 'thisRole') - see person_role_tag above, synchronize these tags!
|
23
|
+
# @option params :process_type [String] the URL for the ontological type of the process (defaults to http://semanticscience.org/resource/process)
|
24
|
+
# @option params :process_type_column [String] the column header that contains the URL for the ontological type of the process - overrides process_type
|
25
|
+
# @option params :process_tag [String] some single-word tag for that process; defaults to "thisprocess"
|
26
|
+
# @option params :process_label [String] the label associated with the process type in that row (defaults to "thisprocess")
|
27
|
+
# @option params :process_label_column [String] the column header for the label associated with the process type in that row
|
28
|
+
# @option params :process_start_column [ISO 8601 date (only date)] (optional) the column header for the datestamp when that process started. NOTE: For instantaneous processes, create ONLY the start date column, and an identical end date will be automatically generated
|
29
|
+
# @option params :process_end_column [ISO 8601 date (only date)] (optional) the column header for the datestamp when that process ended
|
30
|
+
# @option params :make_unique_process [boolean] (true) (optional) if you want the core URI to be globally unique, or based only on the patient ID. this can be used to merge nodes over multiple runs of different yarrrml transforms.
|
31
|
+
|
32
|
+
b.role_in_process({
|
33
|
+
person_role_tag: "patientRole_status",
|
34
|
+
process_tag: "patient_status",
|
35
|
+
process_label: "status recording process",
|
36
|
+
process_type: "http://semanticscience.org/resource/SIO_001052", # data collection
|
37
|
+
process_start_column: "start",
|
38
|
+
# process_end_column: "end" # without an end, it shiould become an identical start/end
|
39
|
+
})
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
# ===================================================================================
|
44
|
+
# ========================================Status===========================================
|
45
|
+
# pid,uniqid,date,status_uri,status_label,death_date
|
46
|
+
|
47
|
+
|
48
|
+
b.process_hasoutput_output({
|
49
|
+
process_with_output_tag: "patient_status", # connect to the correct process
|
50
|
+
output_type_label_column: "data",
|
51
|
+
output_value_column: "data",
|
52
|
+
})
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
puts b.generate
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require "yarrrml-template-builder"
|
2
|
+
|
3
|
+
#"pid,uniqid, date, status_label, status_uri, death_date
|
4
|
+
|
5
|
+
|
6
|
+
b = YARRRML_Template_Builder.new({
|
7
|
+
source_tag: "cde_patient_status",
|
8
|
+
sio_verbose: 1,
|
9
|
+
}
|
10
|
+
)
|
11
|
+
|
12
|
+
|
13
|
+
b.person_identifier_role_mappings({
|
14
|
+
personid_column: "pid",
|
15
|
+
uniqueid_column: "uniqid",
|
16
|
+
person_role_tag: "patientRole_status",
|
17
|
+
role_type: 'http://purl.obolibrary.org/obo/OBI_0000093',
|
18
|
+
role_label: "Patient for status recording"
|
19
|
+
})
|
20
|
+
# ===============================================
|
21
|
+
|
22
|
+
b.role_in_process({
|
23
|
+
person_role_tag: "patientRole_status",
|
24
|
+
process_tag: "patient_status",
|
25
|
+
process_label: "status recording process",
|
26
|
+
process_type: "http://semanticscience.org/resource/SIO_001052", # data collection
|
27
|
+
})
|
28
|
+
|
29
|
+
|
30
|
+
b.role_in_process({
|
31
|
+
person_role_tag: "patientRole_status",
|
32
|
+
process_tag: "patient_death_information",
|
33
|
+
process_label: "death information recording process",
|
34
|
+
process_type: "http://semanticscience.org/resource/SIO_001052", # data collection
|
35
|
+
})
|
36
|
+
|
37
|
+
# ===================================================================================
|
38
|
+
# ===================================================================================
|
39
|
+
# ===================================================================================
|
40
|
+
|
41
|
+
b.process_has_part({
|
42
|
+
parent_process_tag: "longitudinal_information_gathering_process_diseaseX",
|
43
|
+
part_process_tag: "patient_status",
|
44
|
+
parent_unique_process: false,
|
45
|
+
})
|
46
|
+
|
47
|
+
# ===================================================================================
|
48
|
+
# ========================================Status===========================================
|
49
|
+
# pid,uniqid,date,status_uri,status_label,death_date
|
50
|
+
|
51
|
+
|
52
|
+
b.process_hasoutput_output({
|
53
|
+
process_with_output_tag: "patient_status", # connect to the correct process
|
54
|
+
output_type_label_column: "status_label",
|
55
|
+
output_value_column: "status_label",
|
56
|
+
})
|
57
|
+
|
58
|
+
#sio:SIO_010059 (dead)
|
59
|
+
#sio:SIO_010058 (alive)
|
60
|
+
#obo:NCIT_C70740 (lost to follow-up)
|
61
|
+
#obo:NCIT_C124784 (refused to participate)
|
62
|
+
b.input_output_refers_to({
|
63
|
+
refers_to_tag: "status_attribute",
|
64
|
+
inout_process_tag: "patient_status", # connect to the correct process
|
65
|
+
inout_refers_to_column: "status_uri",
|
66
|
+
inout_refers_to_label: "Patient status",
|
67
|
+
is_attribute: true
|
68
|
+
})
|
69
|
+
|
70
|
+
b.process_hasoutput_output({
|
71
|
+
process_with_output_tag: "patient_death_information", # connect to the correct process
|
72
|
+
output_type_label: "patient death information",
|
73
|
+
output_value_column: "death_date",
|
74
|
+
output_value_datatype: "xsd:date",
|
75
|
+
output_timeinstant_column: "death_date"
|
76
|
+
})
|
77
|
+
|
78
|
+
b.input_output_refers_to({
|
79
|
+
refers_to_tag: "death_information",
|
80
|
+
inout_process_tag: "patient_death_information", # connect to the correct process
|
81
|
+
inout_refers_to: "http://purl.obolibrary.org/obo/NCIT_C70810",
|
82
|
+
inout_refers_to_label: "Date of death",
|
83
|
+
is_attribute: true
|
84
|
+
})
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
puts b.generate
|
@@ -0,0 +1,36 @@
|
|
1
|
+
version: "2.0"
|
2
|
+
services:
|
3
|
+
|
4
|
+
graphdb:
|
5
|
+
image: graph-db:9.7.0
|
6
|
+
restart: always
|
7
|
+
hostname: graphdb
|
8
|
+
ports:
|
9
|
+
- 7200:7200
|
10
|
+
volumes:
|
11
|
+
- graphdb-data:/opt/graphdb/home
|
12
|
+
|
13
|
+
|
14
|
+
yarrrml_transform:
|
15
|
+
image: markw/yarrrml-parser-ejp:latest
|
16
|
+
container_name: yarrrml_transform
|
17
|
+
ports:
|
18
|
+
- "3000:3000"
|
19
|
+
volumes:
|
20
|
+
- ./data:/data
|
21
|
+
|
22
|
+
|
23
|
+
rdfizer:
|
24
|
+
image: markw/sdmrdfizer_ejp:0.1.0
|
25
|
+
container_name: rdfizer
|
26
|
+
ports:
|
27
|
+
- "4000:4000"
|
28
|
+
volumes:
|
29
|
+
- ./data:/data
|
30
|
+
- ./config:/config
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
volumes:
|
35
|
+
graphdb-data:
|
36
|
+
external: true
|