Hello everyone,

I want to get all transitive parent classes of a given class. The data
is already stored in a Virtuoso  server with SPARQL 1.1 and the
ontology contains 1 159 021 classes.

The query that I executed is:

========================================
query 1
========================================
SELECT DISTINCT ?classuri {GRAPH <http://maze.org> {
?subclass owl:SubClassOf+ ?classuri
OPTION (TRANSITIVE , T_DISTINCT, t_in(?subclass), t_out(?classuri),
t_max(6), T_DIRECTION 1 , T_NO_CYCLES).
FILTER(?subclass = <http://maze.org/concept/4788>)
}}

but the process never ended in spite of increasing the
TN_DEFAULT_MAX_MEMORY parameter from 100MB to 5GB (after recompiling
the server again). I concluded: to many loops in the data. In fact,
there exists more than 2000 pair of classes where for each pair, each
class is a subclass from each other.

Then, a friend of mine changed a little bit the previous query. He
removed the property path "+" from the query because he is still using
SPARQL 1.0 in his Virtuoso server and he removed both t_in and t_out
parameters from "transitive option". Then, He run the following query
and it worked.

========================================
query 2
========================================

SELECT ?classuri WHERE
{ GRAPH <http://maze.org> {
  ?subclass rdfs:subClassOf ?classuri OPTION (TRANSITIVE, T_DISTINCT
,T_NO_CYCLES, T_MIN(0)).
  FILTER (?subclass = <http://maze.org/concept/4788>)
}}

========================================


My question is:

Which query is doing what is expecting? It means, to get all
transitive parent classes of a given class. Why?

Thanks in advance

Adam

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to