Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Hello!
I find the new INDIRECT_ prefix to obtain indirect relations very useful and exciting. From the documentation I understand I cannot perform the inverse where I would query for all subjects which satisfy a certain property value. That is to say, the INDIRECT_ prefix allows me to perform something of the like of the following SPARQL query: PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX obo: <http://purl.obolibrary.org/obo/> PREFIX cl: <http://purl.obolibrary.org/obo/cl.owl> SELECT distinct ?cellPropValue WHERE { graph cl: { values ?cell {obo:CL_0000928} ?cell rdfs:subClassOf* ?cellAncestor . ?cellAncestor (rdfs:subClassOf|(owl:equivalentClass/owl:intersectionOf/rdf:rest*/rdf:first)) ?x . ?x owl:onProperty obo:RO_0002104 ; owl:someValuesFrom ?cellPropValue . } } Limit 100 But I cannot query for something like: SELECT distinct ?cell ?cellPropValue WHERE { graph cl: { # values ?cell {obo:CL_0000928} values ?cellPropValue {obo:PR_000001874} ?cell (rdfs:subClassOf/(rdfs:subClassOf|(owl:equivalentClass/owl:intersectionOf/rdf:rest*/rdf:first))) ?x . ?x owl:onProperty obo:RO_0002104 ; owl:someValuesFrom ?cellPropValue . } } Limit 100where these queries are performed against the cell ontology. Or did I miss something? Cheers! GP |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
Hello,
For individuals, you can use inverse properties. If the inverse property does not exist, you can create it in a separated temporary ontology, to avoid polluting the main one. For classes (as your example suggests), it is more complicated. For a formal and logical point of view, one cannot infer restriction on inverse properties from restrictions on a property. For example, "nucleus is part of some cell" does not imply that "cell has part some nucleus": in fact, all cells do not have a nucleus, while all nucleus belong to a cell. However, it is still interesting in some situations, I agree. Owlready has the Class.inverse_restriction(property) class method that follows restriction in reverse direction. But it does not support indirect relations. Maybe what you would need is a "indirect_inverse_restriction()" method ? Best regards, Jiba |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Hi,
Indeed going for inverse properties makes seldom sense. In this very case I only want to obtain all cells which are positive for some marker (obo:RO_0002104) and obviously the properties are spread a bit throughout the whole taxonomy, though looking at the parent classes is probably enough in most cases. The Sparql query I gave does the work (at least partly) but it is notable that it runs very slowly when using the internal rdflib parser. A proper graph server (virtuoso, jena, etc) is able to handle the query in a much more efficient manner (sub-second) so there is some space there. Thanks for your help and the nice library once again! GP |
Free forum by Nabble | Edit this page |