biolink / biolinkml

DEPRECATED: replaced by linkml
https://github.com/linkml/linkml
Creative Commons Zero v1.0 Universal
23 stars 12 forks source link

SPARQL queries for models and instance data #229 #318

Closed cmungall closed 3 years ago

cmungall commented 3 years ago

See https://github.com/linkml/linkml/issues/46

BiolinkML SPARQL checks

These sparql checks can be used to query either biolinkML schemas or instance data for biolinkML schemas.

The schema should be in the form of a .ttl file (using gen-rdf).

For instance data, this should be merged with the schema.ttl

The script meta-sparql.sh provides a convenient wrapper that use robot to merge files and do queries.

Naming conventions

Examples (schemas)

To query for all elements in a schema:

./sparql/meta-sparql.sh -s examples/organization2.ttl -q sparql/element-list.rq

The metamodel can be queried:

./sparql/meta-sparql.sh -s meta.ttl -q sparql/element-list.rq

Examples (instance data)

Find all unyped instances

./sparql/meta-sparql.sh -i examples/organization2.ttl -s examples/organization2.ttl -q sparql/untyped-instance-violation.rq

TODO

cmungall commented 3 years ago

discussed with @hsolbrig - we will merge for now even if incomplete, we want to know how best to integrate this with tests