{"id":25843065,"url":"https://github.com/incatools/dosdp-tools","last_synced_at":"2025-09-03T21:44:24.516Z","repository":{"id":10777910,"uuid":"66950882","full_name":"INCATools/dosdp-tools","owner":"INCATools","description":"Utility for working with DOSDP design patterns and OWL ontologies","archived":false,"fork":false,"pushed_at":"2024-07-22T14:20:27.000Z","size":544,"stargazers_count":27,"open_issues_count":51,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-03T21:12:07.949Z","etag":null,"topics":["design-patterns","dosdp-pattern","monarchinitiative","obofoundry","odp","ontology","owl"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/INCATools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-30T14:58:21.000Z","updated_at":"2024-12-18T23:54:23.000Z","dependencies_parsed_at":"2025-03-01T06:38:04.591Z","dependency_job_id":"13cc72ab-67c4-4358-86f4-41b0dd07578a","html_url":"https://github.com/INCATools/dosdp-tools","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/INCATools/dosdp-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INCATools%2Fdosdp-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INCATools%2Fdosdp-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INCATools%2Fdosdp-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INCATools%2Fdosdp-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/INCATools","download_url":"https://codeload.github.com/INCATools/dosdp-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INCATools%2Fdosdp-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273516884,"owners_count":25119765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["design-patterns","dosdp-pattern","monarchinitiative","obofoundry","odp","ontology","owl"],"created_at":"2025-03-01T06:37:55.583Z","updated_at":"2025-09-03T21:44:24.492Z","avatar_url":"https://github.com/INCATools.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/INCATools/dosdp-tools.svg?branch=master)](https://travis-ci.org/INCATools/dosdp-tools)\n\n# dosdp-tools\n\n`dosdp-tools` is a command-line utility for working with DOSDP design patterns and OWL ontologies. Given a YAML design pattern following the [DOSDP spec](https://github.com/dosumis/dead_simple_owl_design_patterns), it can either generate ontology axioms from an input table of terms, or instead generate a SPARQL query that can be used to query an ontology for terms matching the pattern.\n\n## Releases\nPre-packaged releases can be downloaded from [here](https://github.com/INCATools/dosdp-tools/releases).\n\n## Building\n\n1. If you don't already have it, install `sbt` on your system. For Mac OS X, it is easily done using [Homebrew](http://brew.sh): `brew install sbt`\n\n2. Clone the project from GitHub (`git clone git@github.com:INCATools/dosdp-tools.git`).\n\n3. Change into the project directory: `cd dosdp-tools`.\n\n4. To compile and build the executable package, run: `sbt stage`\n\nYou will find executables for Unix and Windows in `target/universal/stage/bin/`. These depend on the libraries in `target/universal/stage/lib`.\n\n## Usage\n\n```\nUsage\n\n dosdp-tools [options] command [command options]\n\nOptions\n\n   --catalog             : catalog file to use for resolving ontology locations\n   --obo-prefixes        : Assume prefixes are OBO ontologies; predefine rdf, rdfs, owl, dc, dct, skos, obo, and oio.\n   --ontology            : OWL ontology (provide labels, query axioms)\n   --outfile             : Output file (OWL or TSV)\n   --prefixes            : CURIE prefixes (YAML)\n   --table-format=STRING : Tabular format: TSV (default) or CSV\n   --template=STRING     : DOSDP file (YAML). If a local file is not found at the given path, the path will be attempted as a URL.\n\nCommands\n\n   generate [command options] : generate ontology axioms for TSV input to a Dead Simple OWL Design Pattern\n      --add-axiom-source-annotation             : Add axiom annotation to generated axioms linking to pattern IRI\n      --axiom-source-annotation-property=STRING : IRI for annotation property to use to link generated axioms to pattern IRI\n      --generate-defined-class                  : Computed defined class IRI from pattern IRI and variable fillers\n      --infile                                  : Input file (TSV or CSV)\n      --restrict-axioms-column                  : Data column containing local axiom output restrictions\n      --restrict-axioms-to=STRING               : Restrict generated axioms to 'logical', 'annotation', or 'all' (default)\n\n   prototype : output \"prototype\" axioms using default fillers for a pattern or folder of patterns\n\n   query [command options] : query an ontology for terms matching a Dead Simple OWL Design Pattern\n      --print-query : Print generated query without running against ontology\n      --reasoner    : Reasoner to use for expanding variable constraints. Valid options are ELK, HermiT, or JFact.\n\n   terms [command options] : dump terms referenced in TSV input and a Dead Simple OWL Design Pattern\n      --infile : Input file (TSV or CSV)\n```\n\n`dosdp-tools` has four modes: **generate**, **query**, **prototype**, and **terms**:\n\n### Generate\n\nThe `generate` command creates an ontology from a DOSDP pattern file and an input file of tab-separated filler values. Column names in the TSV file need to match variables defined in the DOSDP. A special `defined_class` column should provide the IRI for the newly created class instantiating the pattern. A provided ontology is used to find labels for terms, needed to generate annotation values. Example:\n\n```bash\ndosdp-tools generate --obo-prefixes=true --template=exposure_to_chemical.yaml --infile=exposure_to_chemical.tsv --outfile=exposure_to_chemical.ofn --ontology=chebi_import.owl\n```\n\n### Query\n\nThe `query` command queries an ontology for terms that meet the logical patterns defined in a DOSDP pattern file. Instead of performing the query, you can also simply print the generated SPARQL. Example:\n\n```bash\ndosdp-tools query --template=entity_attribute_location.yaml --prefixes=prefixes.yaml --print-query\n```\n\nOutput:\n```sparql\nPREFIX rdf: \u003chttp://www.w3.org/1999/02/22-rdf-syntax-ns#\u003e\nPREFIX rdfs: \u003chttp://www.w3.org/2000/01/rdf-schema#\u003e\nPREFIX owl: \u003chttp://www.w3.org/2002/07/owl#\u003e\n\nSELECT DISTINCT ?defined_class (STR(?defined_class__label) AS ?defined_class_label) ?attribute (STR(?attribute__label) AS ?attribute_label) ?entity (STR(?entity__label) AS ?entity_label) ?location (STR(?location__label) AS ?location_label)\nWHERE {\n?defined_class owl:equivalentClass ?ba95b4a7b13f4a86af50c3e0e1182838 .\n?ba95b4a7b13f4a86af50c3e0e1182838 owl:intersectionOf/rdf:rest*/rdf:first ?c90d72646ac64cc19318ca3273f11cd6 .\n?ba95b4a7b13f4a86af50c3e0e1182838 owl:intersectionOf/rdf:rest*/rdf:first ?attribute .\n?ba95b4a7b13f4a86af50c3e0e1182838 owl:intersectionOf/rdf:rest/rdf:rest rdf:nil .\n?c90d72646ac64cc19318ca3273f11cd6 owl:onProperty \u003chttp://purl.obolibrary.org/obo/RO_0000052\u003e .\n?c90d72646ac64cc19318ca3273f11cd6 owl:someValuesFrom ?7f7e348c174d42f0a76663cc59f21e37 .\n?7f7e348c174d42f0a76663cc59f21e37 owl:intersectionOf/rdf:rest*/rdf:first ?75f4eb2eae374a77878c36acda870206 .\n?7f7e348c174d42f0a76663cc59f21e37 owl:intersectionOf/rdf:rest*/rdf:first ?entity .\n?7f7e348c174d42f0a76663cc59f21e37 owl:intersectionOf/rdf:rest/rdf:rest rdf:nil .\n?75f4eb2eae374a77878c36acda870206 owl:onProperty \u003chttp://purl.obolibrary.org/obo/BFO_0000050\u003e .\n?75f4eb2eae374a77878c36acda870206 owl:someValuesFrom ?location .\nFILTER(?entity != ?75f4eb2eae374a77878c36acda870206)\nFILTER(?c90d72646ac64cc19318ca3273f11cd6 != ?attribute)\nOPTIONAL { ?defined_class rdfs:label ?defined_class__label . }\nOPTIONAL { ?attribute rdfs:label ?attribute__label . }\nOPTIONAL { ?entity rdfs:label ?entity__label . }\nOPTIONAL { ?location rdfs:label ?location__label . }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fincatools%2Fdosdp-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fincatools%2Fdosdp-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fincatools%2Fdosdp-tools/lists"}