- From: Bijan Parsia <bparsia@cs.man.ac.uk>
- Date: Wed, 11 Apr 2007 17:56:05 +0100
- To: "Cristina Lancioni, Doctor in Computer Science" <cristina.lancioni@unicam.it>
- Cc: semantic-web@w3.org
On 10 Apr 2007, at 14:10, Cristina Lancioni, Doctor in Computer Science wrote: > Hello, > I'm a phd student in Information Technology at the University of > Camerino (Italy). > I would like to know if it's possible to do recursive queries in > SPARQL. "Recursive query" can mean several things. > In fact I've this problem. I've an ontology in OWL with only > relations is-a. Do you mean the subclass tree? are you using subclassof? > This ontology is made like a tree. I would like to select a > subgraph made of the path from the leaf node to the root node > (result example: A(leaf) is-a B is-a C is-a D(root)). Are you querying for class names? > How could I do this using only a single query? Shoud I do this with > SPARQL? If not, do You know another ontology query language to do > this? If you are building the ontology yourself, you could use a transitive role in the ontology (e.g., for is-a), then a standard sparql query will do the job (assuming that the store supports it). There are some query languages that support a transitive closure operator in the query, e.g., the one with Kowari/whatever it's called now, the one in wilbur (which has more general regular expressions), or you might try SPARQL Rules <http://platon.escet.urjc.es/~axel/publications/GIA-TR-2006-11-28.pdf> Vanilla sparql will not do the job. You could also lobby your favorite engine implementor for an extension. Cheers, Bijan.
Received on Wednesday, 11 April 2007 16:55:27 UTC