0

Sorry if this is a noob's and simple question, but it will help me resolve a conceptual confusion of mine! I have some guesses, but want to make sure.

I got the location of a part of brain via NeuroFMA ontology and the query below:

PREFIX fma: <http://sig.uw.edu/fma#>
 
 select ?loc{
 fma:Superior_temporal_gyrus fma:location ?loc}  

The result was: fma:live_incus_fm_14056

I thought I might be able to get some more information on this item.

Question 1: Was there a difference if the result was a literal?

So, I used optional {?loc ?p ?o} and got some results.

However, I thought since this ontology also imported RDF and OWL, the following queries should work too, but it was not the case (hopefully these codes are correct)!

    optional {?value rdfs:range ?loc}
    optional {?loc rdfs:domain ?value}
    optional {?loc rdf:type ?value}

Question 2 If the above queries are correct, are RDFS and OWL just a suggestion? Or do ontologies that import/ follow them have to use all their resources or at least expand on them?

Thanks!

Community
  • 1
  • 1
RFAI
  • 459
  • 4
  • 17
  • 2
    TIp: you've got two (three?) questions in one here. This is usually a signal that your question is too broad and not well-defined. Try and make your questions specific and answerable. Provide a [mcve]. Have a look at [ask] for more tips on how to write good questions. – Jeen Broekstra Jul 04 '19 at 05:36
  • 1
    What do you mean by "import"? The standard OWL feature `owl:imports` is not used by NeuroFMA. – Antoine Zimmermann Jul 04 '19 at 07:24
  • @AntoineZimmermann Aha! So probably I made a mistake. By 'import' I meant it uses owl properties such as owl:ObjectProperty. Does this mean NeuroFMA just uses some owl properties? – RFAI Jul 04 '19 at 14:07
  • @JeenBroekstra Yes, I know. I just wanted to avoid posting several similar questions with similar code multiple times. – RFAI Jul 04 '19 at 14:09

1 Answers1

2

An import declaration in OWL is, for the most part, just informative. It is typically used to signal that this ontology re-uses some of the concepts defined in the target (for example, it could define some additional subclasses of classes defined in the target data).

Whether the import results in any additional data being loaded into your dataset depends on what database/API/reasoner you use to process the ontology. Most tools don't automatically load the targets of import declarations, by default, so the presence or absence of the import-declaration will have no influence on what your queries return.

I thought since this ontology also imported RDF and OWL, the following queries should work too, but it was not the case (hopefully these codes are correct)!

optional {?value rdfs:range ?loc}
optional {?loc rdfs:domain ?value}
optional {?loc rdfs:type ?value}

It's rdf:type, not rdfs:type. Apart from that, each of these individually look fine. However, judging from your broader query, ?loc is usually not a property, but a property value. Property values don't have domains and ranges. You could query for something like this, possibly:

 optional { fma:location rdfs:domain ?value}

This asks "if the property fma:location has a domain declaration, return that declaration and bind it to the ?value variable".

More generally, whether these queries return any results has little or nothing to do with what import declaration are present in your ontology. If your ontology contains a range declaration for a property, the first pattern will return a result. If it contains a domain declaration, the second one will return a result. And finally, if your ontology contains an instance of some class, the third pattern (corrected) will return a result. It's as simple as that.

There is no magic here: the query only returns what is present in your dataset. What is present in your dataset is determined by how you have loaded the data into your database, and (optionally) what form of reasoner you have enabled on top of your database.

Jeen Broekstra
  • 21,642
  • 4
  • 51
  • 73
  • Thanks! I have edit my typo error on `'rdf:type`. Can you please take a look at my first question too? Based on what you mentioned, especially the code on domain and range, I think the type of object should not make any differences. – RFAI Jul 04 '19 at 05:29
  • 2
    I genuinely don't understand your first question. "Was there a difference if the result was a literal"? A difference compared to what? – Jeen Broekstra Jul 04 '19 at 05:31
  • 1
    @RFNO Please read again the most important part in the answer: **"There is no magic here: the query only returns what is present in your dataset."** - if nobody declared domain or range, then what do you expect? And yes, it matters whether its a property or not because nobody designing an ontology will define domain and range for something else (I omit the fact here for simplicity that by inference any `:x` having a domain or range belongs to type `rdf:Property`). – UninformedUser Jul 04 '19 at 05:44
  • @RFNO I also don't get, what is the idea behind `optional {?value rdfs:range ?loc}` ? What is `?value` here? Please read about the usage of `rdfs:domain` and `rdfs:range` in the docs. – UninformedUser Jul 04 '19 at 05:46
  • @JeenBroekstra @AKSW OK, I think I almost understood what you said. Let me just put my last (hopefully:) question this way: In the same ontology, there is a `fma:volume` defined. It has `rdf:type owl:ObjectProperty & owl:FunctionalProperty` but it has never been used in the ontology (not related to any other subject or object). I wonder if they defined this property just for the future uses such as annotation purposes? – RFAI Jul 04 '19 at 15:17