diff options
Diffstat (limited to 'examples/ontology.scm')
| -rwxr-xr-x | examples/ontology.scm | 241 |
1 files changed, 241 insertions, 0 deletions
diff --git a/examples/ontology.scm b/examples/ontology.scm new file mode 100755 index 0000000..56d2779 --- /dev/null +++ b/examples/ontology.scm @@ -0,0 +1,241 @@ +#! /usr/bin/env guile +!# + +(use-modules (ice-9 getopt-long) + (transform triples) + (transform schema) + (transform special-forms)) + +(let* ((option-spec + '((settings (single-char #\s) (value #t)) + (output (single-char #\o) (value #t)) + (documentation (single-char #\d) (value #t)))) + (options (getopt-long (command-line) option-spec)) + (settings (option-ref options 'settings #f)) + (output (option-ref options 'output #f)) + (documentation (option-ref options 'documentation #f)) + (%connection-settings (call-with-input-file settings read))) + (with-output-to-file output + (lambda () + ;; Define all GN ontology in one place. + (prefix "dcat:" "<http://www.w3.org/ns/dcat#>") + (prefix "dct:" "<http://purl.org/dc/terms/>") + (prefix "gn:" "<http://rdf.genenetwork.org/v1/id/>") + (prefix "owl:" "<http://www.w3.org/2002/07/owl#>") + (prefix "gnc:" "<http://rdf.genenetwork.org/v1/category/>") + (prefix "gnt:" "<http://rdf.genenetwork.org/v1/term/>") + (prefix "obo:" "<http://purl.obolibrary.org/obo/>") + (prefix "sdmx-measure:" "<http://purl.org/linked-data/sdmx/2009/measure#>") + (prefix "skos:" "<http://www.w3.org/2004/02/skos/core#>") + (prefix "rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") + (prefix "rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") + (prefix "xsd:" "<http://www.w3.org/2001/XMLSchema#>") + (prefix "qb:" "<http://purl.org/linked-data/cube#>") + (prefix "xkos:" "<http://rdf-vocabulary.ddialliance.org/xkos#>") + (prefix "pubmed:" "<http://rdf.ncbi.nlm.nih.gov/pubmed/>") + (prefix "schema:" "<https://schema.org/>") + (newline) + (triple 'gnc:population_category 'a 'xkos:ClassificationLevel) + (triple 'gnc:population_category 'rdfs:label "Population Category") + (triple 'gnc:population_category 'skos:inScheme 'gnc:resource_classification_scheme) + (triple 'gnc:population_category 'skos:prefLabel "Species") + (triple 'gnc:population_category 'xkos:depth "3") + (triple 'gnc:population_category 'xkos:nextLevel 'gnc:set) + (triple 'gnc:population_category 'xkos:previousLevel 'gnc:species) + (triple 'gnc:reference_population 'a 'skos:Concept) + (triple 'gnc:reference_population 'skos:definition "A genetic population") + (triple 'gnc:reference_population 'skos:inScheme 'gnc:population_category) + (triple 'gnc:reference_population 'skos:prefLabel "Reference population") + (triple 'gnc:resource_classification_scheme 'a 'skos:ConceptScheme) + (triple 'gnc:resource_classification_scheme 'skos:definition "A hierarchical classification scheme for organizing GeneNetwork resources by dataset type, resource set (inbredset group), or species.") + (triple 'gnc:resource_classification_scheme 'skos:prefLabel "GeneNetwork Resource Classification Scheme") + (triple 'gnc:resource_classification_scheme 'xkos:levels 'gnc:population_category) + (triple 'gnc:resource_classification_scheme 'xkos:levels 'gnc:set) + (triple 'gnc:resource_classification_scheme 'xkos:levels 'gnc:species) + (triple 'gnc:resource_classification_scheme 'xkos:levels 'gnc:taxonomic_family) + (triple 'gnc:resource_classification_scheme 'xkos:numberOfLevels "4") + (triple 'gnc:set 'a 'xkos:ClassificationLevel) + (triple 'gnc:set 'skos:definition "A category representing groups of genetically related strains or individuals (inbred sets, recombinant inbred lines, etc.).") + (triple 'gnc:set 'skos:inScheme 'gnc:resource_classification_scheme) + (triple 'gnc:set 'skos:prefLabel "InbredSet Group") + (triple 'gnc:set 'xkos:depth "4") + (triple 'gnc:set 'xkos:previousLevel 'gnc:population_category) + (triple 'gnc:species 'a 'xkos:ClassificationLevel) + (triple 'gnc:species 'skos:definition "A classification level that that associates a given resource to a species in GeneNetwork.") + (triple 'gnc:species 'skos:inScheme 'gnc:resource_classification_scheme) + (triple 'gnc:species 'skos:prefLabel "Species") + (triple 'gnc:species 'xkos:depth "2") + (triple 'gnc:species 'xkos:nextLevel 'gnc:population_category) + (triple 'gnc:species 'xkos:previousLevel 'gnc:taxonomic_family) + (triple 'gnc:taxonomic_family 'a 'xkos:ClassificationLevel) + (triple 'gnc:taxonomic_family 'skos:definition "An organizational classification level used in GeneNetwork to group resources into families.") + (triple 'gnc:taxonomic_family 'skos:inScheme 'gnc:resource_classification_scheme) + (triple 'gnc:taxonomic_family 'skos:prefLabel "Family") + (triple 'gnc:taxonomic_family 'xkos:depth "1") + (triple 'gnc:taxonomic_family 'xkos:nextLevel 'gnc:species) + (triple 'gnt:assigned_species 'a 'owl:ObjectProperty) + (triple 'gnt:assigned_species 'rdfs:domain 'gnc:set) + (triple 'gnt:assigned_species 'rdfs:label "These families have been assigned to these species") + (triple 'gnt:genetic_type 'a 'owl:DatatypeProperty) + (triple 'gnt:genetic_type 'rdfs:domain 'gnc:set) + (triple 'gnt:genetic_type 'rdfs:label "has genetic type") + (triple 'gnt:genetic_type 'rdfs:range 'xsd:string) + (triple 'gnt:genetic_type 'skos:definition "Describes the genetic architecture of a resource set (e.g., intercross, riset).") + (triple 'gnt:has_family_order_id 'a 'owl:DatatypeProperty) + (triple 'gnt:has_family_order_id 'a 'owl:DatatypeProperty) + (triple 'gnt:has_family_order_id 'rdfs:range 'xsd:integer) + (triple 'gnt:has_set_code 'a 'owl:DatatypeProperty) + (triple 'gnt:has_set_code 'rdfs:domain 'gnc:set) + (triple 'gnt:has_set_code 'rdfs:label "has set code") + (triple 'gnt:has_set_code 'rdfs:range 'xsd:string) + (triple 'gnt:has_set_code 'skos:definition "Provides a unique identifier code for a resource set.") + (triple 'gnt:has_species 'a 'owl:ObjectProperty) + (triple 'gnt:has_species 'rdf:comment "This resource belongs to this species") + (triple 'gnt:has_species 'rdfs:label "belongs to species") + (triple 'gnt:has_species 'rdfs:range 'gnc:species) + (triple 'gnt:has_strain 'a 'owl:ObjectProperty) + (triple 'gnt:has_strain 'rdf:comment "Indicates the group the resources belongs to") + (triple 'gnt:has_strain 'rdfs:domain 'gnc:species) + (triple 'gnt:has_strain 'rdfs:label "this resource belongs to this strain.") + (triple 'gnt:has_strain 'rdfs:range 'gnc:set) + (triple 'gnt:has_strain 'schema:domainIncludes 'dcat:Dataset) + (triple 'gnt:has_strain 'schema:domainIncludes 'gnc:species) + (triple 'gnt:has_strain 'skos:definition "Lists all strains that belong to this resource.") + (triple 'gnt:has_taxonomic_family 'a 'owl:ObjectProperty) + (triple 'gnt:has_taxonomic_family 'rdfs:label "has family") + (triple 'gnt:has_taxonomic_family 'schema:domainIncludes 'gnc:set) + (triple 'gnt:has_taxonomic_family 'schema:domainIncludes 'gnc:species) + (triple 'gnt:has_taxonomic_family 'skos:definition "Links a species to its taxonomic family") + (triple 'gnt:has_uniprot_taxon_id 'a 'owl:ObjectProperty) + (triple 'gnt:has_uniprot_taxon_id 'rdfs:label "has uniprot taxonomic id") + (triple 'gnt:population_category 'skos:definition "Classification of genetic populations by breeding design and data aggregation.") + (triple 'gnt:short_name 'a 'owl:DatatypeProperty) + (triple 'gnt:short_name 'rdfs:domain 'gnc:species) + (triple 'gnt:short_name 'rdfs:label "has short name") + (triple 'gnt:short_name 'skos:definition "The short name of a given resource") + (triple 'gnt:uses_mapping_method 'a 'owl:ObjectProperty) + (triple 'gnt:uses_mapping_method 'rdfs:comment "The method used to map genetic or experimental data for this resource.") + (triple 'gnt:uses_mapping_method 'rdfs:domain 'gnc:set) + (triple 'gnt:uses_mapping_method 'rdfs:label "mapping method") + (triple 'gnt:uses_mapping_method 'rdfs:range 'gnc:mapping_method) + + ;; Describing Datasets + (triple 'gnc:molecular_trait 'a 'owl:Class) + (triple 'gnc:molecular_trait 'a 'skos:Concept) + (triple 'gnc:molecular_trait 'rdfs:label "Molecular Trait. This describes a melecular trait of a given species. We combine the species name and the tissue name in order to differentiate the traits across different inbredset groups.") + (triple 'gnc:molecular_trait 'rdfs:subClassOf 'obo:UBERON_0000479) + (triple 'gnt:has_case_info 'a 'owl:ObjectProperty) + (triple 'gnt:has_case_info 'rdfs:comment "Information about the cases used in this platform") + (triple 'gnt:has_case_info 'rdfs:domain 'dcat:Dataset) + (triple 'gnt:has_case_info 'rdfs:label "About Case") + (triple 'gnt:has_citation 'a 'owl:ObjectProperty) + (triple 'gnt:has_citation 'rdfs:comment "Citation for this dataset") + (triple 'gnt:has_citation 'rdfs:domain 'dcat:Dataset) + (triple 'gnt:has_citation 'rdfs:label "Citation") + (triple 'gnt:has_contributors 'a 'owl:ObjectProperty) + (triple 'gnt:has_contributors 'rdfs:comment "Contributors of this resource") + (triple 'gnt:has_contributors 'rdfs:comment "Contributors of this resource") + (triple 'gnt:has_contributors 'rdfs:domain 'dcat:Dataset) + (triple 'gnt:has_contributors 'rdfs:label "Contributors") + (triple 'gnt:has_data_processing_info 'a 'owl:ObjectProperty) + (triple 'gnt:has_data_processing_info 'rdfs:comment "Information about how this dataset was processed") + (triple 'gnt:has_data_processing_info 'rdfs:domain 'dcat:Dataset) + (triple 'gnt:has_data_processing_info 'rdfs:label "About Data Processing") + (triple 'gnt:has_experiment_design 'a 'owl:ObjectProperty) + (triple 'gnt:has_experiment_design 'rdfs:comment "Experiment Design for this resource") + (triple 'gnt:has_experiment_design 'rdfs:domain 'dcat:Dataset) + (triple 'gnt:has_experiment_design 'rdfs:label "Experiment Design") + (triple 'gnt:has_experiment_design_info 'a 'owl:ObjectProperty) + (triple 'gnt:has_experiment_design_info 'rdfs:comment "Information about how the experiment was designed") + (triple 'gnt:has_experiment_design_info 'rdfs:domain 'dcat:Dataset) + (triple 'gnt:has_experiment_design_info 'rdfs:label "Experiment Design") + (triple 'gnt:has_experiment_type 'a 'owl:ObjectProperty) + (triple 'gnt:has_experiment_type 'rdfs:comment "Information about the experiment type") + (triple 'gnt:has_experiment_type 'rdfs:domain 'dcat:Dataset) + (triple 'gnt:has_experiment_type 'rdfs:label "Experiment Type Metadata") + (triple 'gnt:has_molecular_trait 'rdf:type 'owl:ObjectProperty) + (triple 'gnt:has_molecular_trait 'rdfs:domain 'gnc:set) + (triple 'gnt:has_molecular_trait 'rdfs:label "has molecular trait") + (triple 'gnt:has_molecular_trait 'rdfs:range 'gnc:molecular_trait) + (triple 'gnt:has_phenotype_data 'rdf:type 'owl:ObjectProperty) + (triple 'gnt:has_phenotype_data 'rdfs:comment "Associates a resource with its phenotype data.") + (triple 'gnt:has_phenotype_data 'rdfs:domain 'gnc:set) + (triple 'gnt:has_phenotype_data 'rdfs:label "this resources has this phenotype data.") + (triple 'gnt:has_phenotype_data 'rdfs:range 'dcat:Dataset) + (triple 'gnt:has_phenotype_data 'rdfs:subPropertyOf 'dct:relation) + (triple 'gnt:has_platform_info 'a 'owl:ObjectProperty) + (triple 'gnt:has_platform_info 'rdfs:comment "Information about the platform that was used with this dataset") + (triple 'gnt:has_platform_info 'rdfs:domain 'dcat:Dataset) + (triple 'gnt:has_platform_info 'rdfs:label "About Platform") + (triple 'gnt:has_probeset_data 'rdf:type 'owl:ObjectProperty) + (triple 'gnt:has_probeset_data 'rdfs:comment "Associates a resource with this probeset data.") + (triple 'gnt:has_probeset_data 'rdfs:domain 'gnc:set) + (triple 'gnt:has_probeset_data 'rdfs:label "this resources has this probeset data.") + (triple 'gnt:has_probeset_data 'rdfs:range 'gnc:molecular_trait) + (triple 'gnt:has_probeset_data 'rdfs:subPropertyOf 'dct:relation) + (triple 'gnt:has_samples 'a 'owl:ObjectProperty) + (triple 'gnt:has_samples 'rdfs:domain 'dcat:Dataset) + (triple 'gnt:has_samples 'rdfs:label "Samples") + (triple 'gnt:has_specifics 'a 'owl:ObjectProperty) + (triple 'gnt:has_specifics 'rdfs:comment "Has specifics") + (triple 'gnt:has_specifics 'rdfs:domain 'dcat:Dataset) + (triple 'gnt:has_specifics 'rdfs:label "Specifics") + (triple 'gnt:has_summary 'a 'owl:ObjectProperty) + (triple 'gnt:has_summary 'rdfs:comment "Summary information about dataset") + (triple 'gnt:has_summary 'rdfs:domain 'dcat:Dataset) + (triple 'gnt:has_summary 'rdfs:label "Summary") + (triple 'gnt:has_tissue_info 'a 'owl:ObjectProperty) + (triple 'gnt:has_tissue_info 'rdfs:domain 'dcat:Dataset) + (triple 'gnt:has_tissue_info 'rdfs:label "Metadata about Tissue for this resource") + (triple 'gnt:uses_genechip 'a 'owl:ObjectProperty) + (triple 'gnt:uses_genechip 'rdfs:domain 'dcat:Dataset) + (triple 'gnt:uses_genechip 'skos:definition "The Platform this resource uses..") + (triple 'gnt:uses_normalization_method 'rdfs:comment "The normalization method used for the molecular traits in this dataset") + (triple 'gnt:uses_normalization_method 'rdfs:domain 'dcat:Dataset) + (triple 'gnt:uses_normalization_method 'rdfs:label "Averaging method used for the molecular traits in this dataset.") + (triple 'gnt:uses_normalization_method 'rdfs:range 'gnc:avg_method) + + ;; Describing phenotypes + (triple 'gnc:phenotype 'a 'owl:Class) + (triple 'gnc:phenotype 'a 'skos:Concept) + (triple 'gnc:phenotype 'rdfs:label "A phenotype.") + (triple 'gnc:phenotype 'a 'owl:Class) + (triple 'gnc:phenotype 'a 'skos:Concept) + (triple 'gnc:phenotype 'rdfs:label "A phenotype.") + (triple 'gnt:lab_code 'a 'owl:ObjectProperty) + (triple 'gnt:lab_code 'rdfs:domain 'gnc:phenotype) + (triple 'gnt:submitter 'a 'owl:ObjectProperty) + (triple 'gnt:submitter 'rdfs:domain 'gnc:phenotype) + (triple 'gnt:submitter 'skos:definition "A person who submitted this resource to GN") + (triple 'gnt:trait_id 'a 'owl:ObjectProperty) + (triple 'gnt:trait_id 'rdfs:domain 'gnc:phenotype) + (triple 'gnt:trait_id 'skos:definition "This is the unique trait id assigned from GeneNetwork") + (triple 'gnt:abbreviation 'a 'owl:ObjectProperty) + (triple 'gnt:abbreviation 'rdfs:domain 'gnc:phenotype) + (triple 'gnt:abbreviation 'skos:definition "The abbreviation used for this resource") + (triple 'gnt:lab_code 'a 'owl:ObjectProperty) + (triple 'gnt:lab_code 'rdfs:domain 'gnc:phenotype) + (triple 'gnt:submitter 'a 'owl:ObjectProperty) + (triple 'gnt:submitter 'rdfs:domain 'gnc:phenotype) + (triple 'gnt:submitter 'skos:definition "A person who submitted this resource to GN") + (triple 'gnt:mean 'a 'rdf:Property) + (triple 'gnt:mean 'a 'qb:MeasureProperty) + (triple 'gnt:mean 'rdfs:subPropertyOf 'sdmx-measure:obsValue) + (triple 'gnt:mean 'rdfs:domain 'gnc:phenotype) + (triple 'gnt:mean 'rdfs:range 'xsd:double) + (triple 'gnt:lod_score 'a 'rdf:Property) + (triple 'gnt:lod_score 'a 'qb:MeasureProperty) + (triple 'gnt:lod_score 'rdfs:subPropertyOf 'sdmx-measure:obsValue) + (triple 'gnt:lod_score 'rdfs:domain 'gnc:phenotype) + (triple 'gnt:lod_score 'rdfs:range 'xsd:double) + (triple 'gnt:lod_score 'rdfs:label "Peak -logP") + (triple 'gnt:lod_score 'skos:definition "Statistical measurement assessing the likelihood of genetic linkage between traits or genetic markers.") + (triple 'gnt:locus 'a 'rdf:Property) + (triple 'gnt:locus 'a 'qb:MeasureProperty) + (triple 'gnt:locus 'rdfs:subPropertyOf 'sdmx-measure:obsValue) + (triple 'gnt:locus 'rdfs:domain 'gnc:phenotype) + (triple 'gnt:locus 'rdfs:range 'rdfs:Literal) + (triple 'gnt:additive 'rdfs:domain 'gnc:phenotype) + (triple 'gnt:additive 'rdfs:range 'xsd:double) + (triple 'gnt:sequence 'rdfs:domain 'gnc:phenotype) + (triple 'gnt:sequence 'rdfs:range 'xsd:integer)))) |
