Steve; I believe the following query will work for you:
SELECT ?avfCls
WHERE {
?cls rdfs:subClassOf ?x .
?x owl:allValuesFrom ?avfCls .
}
...and with SPARQL 1.1 Property Paths this can be shortened to
SELECT ?avfCls
WHERE {
?cls rdfs:subClassOf / owl:allValuesFrom ?avfCls .
}
Keep in mind that the graph pattern matching does the iteration for
you. Recursive solutions are rarely needed.
-- Scott
On Feb 8, 5:41 pm, "Steve Ray (CMU)" <[email protected]> wrote:
> I have been working on writing a graph-traversal algorithm using SPARQL
> queries and function calls, and it occurs to me that someone in this group
> might have already done this. I am trying to transitively follow all of the
> owl:allValuesFrom restrictions from a given starting class. The two
> challenges are that this involves a double-hop from one class to the next
> (rdfs:subClassOf followed by owl:allValuesFrom), and that such a traversal
> typically has many cycles (i.e. closed loops) within it, most trivially with
> bidirectional relations.
>
> If anybody has done this, either elegantly or otherwise, I'd love to see
> your solution. Meanwhile, I will share with this group when and if I get
> mine to work.
>
> - Steve
>
> Steven R. Ray, Ph.D.
>
> Distinguished Research Fellow
>
> Carnegie Mellon University
>
> NASA Research Park
>
> Building 23 (MS 23-11)
>
> P.O. Box 1
> Moffett Field, CA 94305-0001
>
> Email: [email protected]
>
> Phone: (650) 587-3780
>
> Cell: (202) 316-6481
>
> Skype: steverayconsulting
>
> 10yr-logo-sm
>
> image001.jpg
> 12KViewDownload
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary
Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.