Adaptive Information Disclosure (AID)

Participating in the VL-e project

Adaptive Information Disclosure (AID) header image 1

BioAID SeRQL query examples

A. Class Queries

All classes in the knowledgebase:

SELECT DISTINCT c
FROM
{c} rdf:type {owl:Class}

Select direct subClasses of a Class, e.g. of owl:Thing:
SELECT DISTINCT c
FROM
{c} serql:directSubClassOf {pc} rdf:type {owl:Class}
WHERE
pc = owl:Thing

Without this serql predicate ‘directSubClassOf’ this would be difficult, because the reasoner would tell that subClasses of subClasses of Class X are subClasses of Class X, e.g. the following query will give all classes under owl:Thing:

SELECT DISTINCT c
FROM
{c} rdfs:subClassOf {pc} rdf:type {owl:Class}
WHERE
pc = owl:Thing AND c != owl:Thing

Subclasses of subclasses of owl:Thing:

SELECT DISTINCT pc, c
FROM
{pc} serql:directSubClassOf {ppc} rdf:type {owl:Class},
{c} serql:directSubClassOf {pc} rdf:type {owl:Class}
WHERE
ppc = owl:Thing

B. Property queries

1. Query that retrieves all properties and their domain and range for properties for which a domain has been specified

SELECT DISTINCT domain, domain_instance, property, range
FROM
{domain_instance} property {range},
{property} rdfs:domain {domain} rdf:type {owl:Class}

NB I think this FROM clause implies domain_instance will always be an instance of a class, hence ‘{domain_instance} rdf:type {} rdf:type {owl:Class}’ would be superfluous.

2. Query that retrieves the properties of a specific class, here ‘meth:DiscoveryScore’, a property that has instances and for which a domain has been specified.

SELECT DISTINCT domain, property
FROM
{domain_instance} property {range},
{property} rdfs:domain {domain} serql:directType {owl:Class}
WHERE
domain = meth:DiscoveryScore
USING namespace
inst = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Enriched-ontology/ExampleInstances.owl#>,
bio = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/BioModel.owl#>,
txt = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/Text.owl#>,
meth = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/TextMining.owl#>,
map = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/MappingBioTextMining.owl#>

3. Query that retrieves properties and their (implicit) domain and range for properties with instances and outside of the standard namespaces.

SELECT DISTINCT domain, domain_instance, property, range
FROM
{domain_instance} property {range},
{domain_instance} serql:directType {domain} serql:directType {owl:Class}
WHERE
namespace(property) != rdf: AND namespace(property) != rdfs: AND namespace(property) != owl:
USING namespace
inst = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Enriched-ontology/ExampleInstances.owl#>,
bio = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/BioModel.owl#>,
txt = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/Text.owl#>,
meth = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/TextMining.owl#>,
map = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/MappingBioTextMining.owl#>

4. Query that retrieves properties of all domains (for properties that have their domain set)

SELECT DISTINCT domain, property
FROM
{property} rdfs:domain {domain} serql:directType {owl:Class}
WHERE
namespace(property) != rdf: AND namespace(property) != rdfs: AND namespace(property) != owl:
USING namespace
inst = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Enriched-ontology/ExampleInstances.owl#>,
bio = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/BioModel.owl#>,
txt = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/Text.owl#>,
meth = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/TextMining.owl#>,
map = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/MappingBioTextMining.owl#>

5. Query that retrieves properties within a certain domain, here meth:DiscoveryScore (as 4 with a limit)

SELECT DISTINCT domain, property
FROM
{property} rdfs:domain {domain} serql:directType {owl:Class}
WHERE
domain = meth:DiscoveryScore AND
namespace(property) != rdf: AND namespace(property) != rdfs: AND namespace(property) != owl:
USING namespace
inst = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Enriched-ontology/ExampleInstances.owl#>,
bio = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/BioModel.owl#>,
txt = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/Text.owl#>,
meth = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/TextMining.owl#>,
map = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/MappingBioTextMining.owl#>

NB I imagine using this when a class is opened in VBrowser to show the class’s direct properties next to the direct subclasses and direct instances of that class. Problem: properties without a domain set apparently do not to show up at all (assume they implicitely ‘Thing’ as domain, but Sesame apparently does not know).

C. Instance queries

1. Query that retrieves all instances and their classes, including superclasses, replace rdf:type with serql:directType to only get direct instances of a class.

SELECT DISTINCT instance, class
FROM
{instance} rdf:type {class} rdf:type {owl:Class}

2. Query that retrieves instances of a particular class (and not of its subclasses)

SELECT DISTINCT instance
FROM
{instance} serql:directType {class}
WHERE
class = txt:Document
USING namespace
inst = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Enriched-ontology/ExampleInstances.owl#>,
bio = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/BioModel.owl#>,
txt = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/Text.owl#>,
meth = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/TextMining.owl#>,
map = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/MappingBioTextMining.owl#>

3. Query that retrieves instances of which the class is in the biological model domain and that are not example instances. The WHERE clause includes conditions to retrieve only one label and one comment.

SELECT DISTINCT label(first_label), localName(instance), label(first_comment), instance
FROM
{instance} rdf:type {inst_class} rdf:type {owl:Class},
{instance} rdfs:label {first_label},
{instance} rdfs:comment {first_comment}
WHERE
namespace(inst_class) = bio: AND NOT (namespace(instance) = eg:) AND
first_label = ALL ( SELECT inst_label FROM {instance} rdfs:label {inst_label} ) AND
first_comment = ALL ( SELECT inst_comment FROM {instance} rdfs:comment {inst_comment} )
USING namespace
eg = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Enriched-ontology/ExampleInstances.owl#>,
inst = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Enriched-ontology/BioAID_Instances.owl#>,
bio = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/BioModel.owl#>,
txt = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/Text.owl#>,
meth = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/TextMining.owl#>,
map = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/MappingBioTextMining.owl#>

3b. Query that retrieves instances of biological hypotheses and their partial representations by user queries.

SELECT DISTINCT instance AS "biological model instance", label(repr_label) AS "representation label", label(query) AS "query partially representing model"
FROM
{instance} rdf:type {bio:BiologicalModel} rdf:type {owl:Class},
{representation} map:partially_represents {instance},
{representation} rdfs:label {repr_label},
{representation} meth:has_query {query}
USING namespace
eg = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Enriched-ontology/ExampleInstances.owl#>,
inst = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Enriched-ontology/BioAID_Instances.owl#>,
bio = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/BioModel.owl#>,
txt = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/Text.owl#>,
meth = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/TextMining.owl#>,
map = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/MappingBioTextMining.owl#>

4. Query that retrieves proteins from the biological model that are components of two specific biological models:

SELECT DISTINCT label(first_label), localName(instance), label(first_comment), instance
FROM
{instance} rdf:type {inst_class} rdf:type {owl:Class},
{instance} rdfs:label {first_label},
{instance} rdfs:comment {first_comment},
{instance} bio:isModelComponentOf {model1},
{instance} bio:isModelComponentOf {model2}
WHERE
namespace(inst_class) = bio: AND NOT (namespace(instance) = eg:) AND
inst_class = bio:Protein AND
localName(model1) = "BioModel_HDAC1_AND_chromatin" AND localName(model2) = "BioModel_(Nutrician_OR_food)_AND_(chromatin_OR_epigenetics)_AND_(protein_OR_proteins)" AND
first_label = ALL ( SELECT inst_label FROM {instance} rdfs:label {inst_label} ) AND
first_comment = ALL ( SELECT inst_comment FROM {instance} rdfs:comment {inst_comment} )
USING namespace
eg = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Enriched-ontology/ExampleInstances.owl#>,
inst = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Enriched-ontology/BioAID_Instances.owl#>,
bio = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/BioModel.owl#>,
txt = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/Text.owl#>,
meth = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/TextMining.owl#>,
map = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/MappingBioTextMining.owl#>

4b. A simpler version of the above

SELECT DISTINCT label(first_comment) AS "Protein", label(query1) AS "original query for model 1", label(query2) AS "original query for model 2"
FROM
{instance} rdf:type {bio:Protein} rdf:type {owl:Class},
{instance} rdfs:comment {first_comment},
{instance} bio:isModelComponentOf {model1}; bio:isModelComponentOf {model2},
{representation1} map:partially_represents {model1}; rdfs:label {modlabel1}; meth:has_query {query1},
{representation2} map:partially_represents {model2}; rdfs:label {modlabel2}; meth:has_query {query2}
WHERE
model1 = inst:BioModel_HDAC1_AND_chromatin AND
label(modlabel1) = "original query" AND label(modlabel2) = "original query" AND
representation1 != representation2
AND
first_comment = ALL ( SELECT inst_comment FROM {instance} rdfs:comment {inst_comment} )
USING namespace
eg = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Enriched-ontology/ExampleInstances.owl#>,
inst = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Enriched-ontology/BioAID_Instances.owl#>,
bio = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/BioModel.owl#>,
txt = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/Text.owl#>,
meth = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/TextMining.owl#>,
map = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/MappingBioTextMining.owl#>

D. Evidence trail queries

1. Query that retrieves a trail to evidence for a particular protein (NF-KappaB), including the discovery process, the service by which this was implemented, who implemented it, when it was run, and on what input.

SELECT DISTINCT
label(first_comment) AS "Protein", localName(text_instance) AS "Name", label(process_label) AS "discovered by",
localName(service) AS "implemented by", label(input_comment) AS "input document",
label(service_creator) AS "service by",
label(run_date) AS "timestamp"
FROM
{instance} rdf:type {bio:Protein} rdf:type {owl:Class},
{instance} rdfs:comment {first_comment},
{text_instance} map:references {instance}; rdf:type {txt:ProteinTerm} rdf:type {owl:Class},
{text_instance} meth:discovered_by {discovery_process_run} rdf:type {process_type} rdf:type {owl:Class},
{discovery_process_run} meth:run_of_process {process} rdfs:label {process_label},
{discovery_process_run} map:process_run_performed_by_computation_run {computation_run},
{discovery_process_run} map:process_run_performed_by_computation_run {computation_run} wf:computation_run_of {service} rdf:type {wf:ComputationElement},
{service} rdfs:comment {service_comment},
{service} <http://purl.org/dc/elements/1.1/creator> {service_creator},
{computation_run} wf:has_input {input}; dc:date {run_date},
{input} rdfs:comment {input_comment}
WHERE
instance = inst:P19838
USING namespace
inst = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Enriched-ontology/BioAID_Instances.owl#>,
bio = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/BioModel.owl#>, txt = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/Text.owl#>, meth = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/TextMining.owl#>, map = <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/MappingBioTextMining.owl#>, wf= <http://rdf.adaptivedisclosure.org/owl/BioAID/myModel/Proto-ontology/Workflow.owl#>, dc = <http://purl.org/dc/elements/1.1#>

No Comments

0 responses so far ↓

You must log in to post a comment.