INCATools/dosdp-tools

Name: dosdp-tools

Owner: INCATools

Description: Utility for working with DOSDP design patterns and OWL ontologies

Created: 2016-08-30 14:58:21.0

Updated: 2017-11-09 17:20:14.0

Pushed: 2017-12-02 04:31:40.0

Homepage:

Size: 80

Language: Scala

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status

dosdp-tools

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, 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.

Releases

Pre-packaged releases can be downloaded from here.

Building

Install sbt on your system. For Mac OS X, it is easily done using Homebrew: brew install sbt

To compile and build the executable package, run:

sbt stage

You will find executables for Unix and Windows in target/universal/stage/bin/. These depend on the libraries in target/universal/stage/lib.

Usage
e

dp-tools [options] command [command options]

ons

-obo-prefixes : Assume prefixes are OBO ontologies; predefine rdf, rdfs, and owl
-ontology     : OWL ontology (provide labels, query axioms)
-outfile      : Output file (OWL or TSV)
-prefixes     : CURIE prefixes (YAML)
-template     : DOSDP file (YAML)

ands

enerate [command options] : generate ontology axioms for TSV input to a Dead Simple OWL Design Pattern
  --infile : Input file (TSV)

uery [command options] : query an ontology for terms matching a Dead Simple OWL Design Pattern
  --print-query : Print generated query without running against ontology
  --reasoner    : Reasoner to use for expanding variable constraints (currently only valid option is `elk`)

dosdp-tools has two modes: generate and query:

Generate

The 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:

p-tools generate --obo-prefixes=true --template=exposure_to_chemical.yaml --infile=exposure_to_chemical.tsv --outfile=exposure_to_chemical.ofn --ontology=chebi_import.owl
Query

The 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:

p-tools query --template=entity_attribute_location.yaml --prefixes=prefixes.yaml --print-query

Output:

IX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
IX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
IX owl: <http://www.w3.org/2002/07/owl#>

CT 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)
E {
ined_class owl:equivalentClass ?ba95b4a7b13f4a86af50c3e0e1182838 .
5b4a7b13f4a86af50c3e0e1182838 owl:intersectionOf/rdf:rest*/rdf:first ?c90d72646ac64cc19318ca3273f11cd6 .
5b4a7b13f4a86af50c3e0e1182838 owl:intersectionOf/rdf:rest*/rdf:first ?attribute .
5b4a7b13f4a86af50c3e0e1182838 owl:intersectionOf/rdf:rest/rdf:rest rdf:nil .
d72646ac64cc19318ca3273f11cd6 owl:onProperty <http://purl.obolibrary.org/obo/RO_0000052> .
d72646ac64cc19318ca3273f11cd6 owl:someValuesFrom ?7f7e348c174d42f0a76663cc59f21e37 .
e348c174d42f0a76663cc59f21e37 owl:intersectionOf/rdf:rest*/rdf:first ?75f4eb2eae374a77878c36acda870206 .
e348c174d42f0a76663cc59f21e37 owl:intersectionOf/rdf:rest*/rdf:first ?entity .
e348c174d42f0a76663cc59f21e37 owl:intersectionOf/rdf:rest/rdf:rest rdf:nil .
4eb2eae374a77878c36acda870206 owl:onProperty <http://purl.obolibrary.org/obo/BFO_0000050> .
4eb2eae374a77878c36acda870206 owl:someValuesFrom ?location .
ER(?entity != ?75f4eb2eae374a77878c36acda870206)
ER(?c90d72646ac64cc19318ca3273f11cd6 != ?attribute)
ONAL { ?defined_class rdfs:label ?defined_class__label . }
ONAL { ?attribute rdfs:label ?attribute__label . }
ONAL { ?entity rdfs:label ?entity__label . }
ONAL { ?location rdfs:label ?location__label . }


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.