Hi Ivan,

I understand you reasoning. But it is a departure from the standard.
Which seems silly to me because this works.

PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>

CONSTRUCT
   { ?sub rdfs:subClassOf ?super .}
FROM <http://purl.uniprot.org/go/>
WHERE
   { ?sub rdfs:subClassOf [] .
     ?sub (rdfs:subClassOf)* ?super .
     [] rdfs:subClassOf ?super}

Regards,
Jerven


On 14/05/13 14:51, Ivan Mikhailov wrote:
> Hello Jerven,
>
> In Virtuoso, transitive queries should have some equality at one end of
> chain (or at both ends). It may be relaxed in the future, but now it may
> requires some additional refinement on one of variables. It's not bad
> idea anyway; in most cases you don't want to get a result set with all
> subjects mentioned in a graph or in a whole storage.
>
> On LOD, 50B quads, the following works quite fast:
>
> PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>
> select ?sub ?super
> WHERE
>     {
>   { select distinct ?sub where { { ?sub a rdfs:Class } union { ?sub
> rdfs:subClassOf|^rdfs:subClassOf|^rdfs:Domain|^rdfs:Range ?x } } }
>   ?sub (rdfs:subClassOf)* ?super }
>
> but demonstrates that the database contains enough garbage in some
> graphs. Formally speaking, blank nodes are legal as types and they are
> found in LOD but I've never seen types without IRIs in "my" ontologies
> and I'm egocentric enough to treat such types as garbage. Next version
> eliminates blank node supertypes:
>
> PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>
> select ?sub ?super
> WHERE
>     {
>   { select distinct ?super where { { ?super a rdfs:Class } union { ?super
> rdfs:subClassOf|^rdfs:subClassOf|^rdfs:Domain|^rdfs:Range ?x } filter
> (isIRI(?super)) } }
>   ?sub (rdfs:subClassOf)* ?super }
>
> The common idea is self-evident. Some subquery or a triple pattern
> enumerates starting or ending ends, the transitive path deals with each
> end in turn. In data manipulations, it may be convenient to make one
> insert of transitive closure per one start or end, so a select query
> enumerates starting or ending ends and a data manipulation statement is
> executed in a loop, once for each enumerated node. Something like
>
> for (sparql select distinct ?end where { enumeration pattern } ) do
>    {
>      sparql insert { ?s p ?o } where { ?s p* ?o . filter (?s = ?:end) } ;
>    }
>
> inside a stored procedure. The advantage is that the DML statements in
> the loop body can be placed in an async_queue, providing better hardware
> utilization on multi-processor box or on a cluster.
>
> Best Regards,
>
> Ivan Mikhailov
> OpenLink Software
> http://virtuoso.openlinksw.com
>
> On Tue, 2013-05-14 at 12:57 +0200, Jerven Bolleman wrote:
>> Hi Hugh,
>>
>> That is not a SPARQL 1.1 requirement. Are the developers aiming to
>> remove this constraint?
>>
>> Anyway, I then hit the next roadblock.
>>
>>    Exception:virtuoso.jdbc3.VirtuosoException: TN...: Exceeded 1000000000
>> bytes in transitive temp memory. use t_distinct, t_max or more
>> T_MAX_memory options to limit the search or increase the pool
>>
>> Looking at google the only way to change this is in the code.
>> Is this still correct?
>>
>> Regards,
>> Jerven
>>
>> On 14/05/13 12:31, Hugh Williams wrote:
>>> Hi Jerven,
>>>
>>> Either ?sub or ?super (or both) should appear in some non-transitive
>>> triple pattern to specify at least one of transitive ends.
>>>
>>> See the following property path examples:
>>>
>>> http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtTipsAndTricksSPARQL11PropertyPaths
>>>
>>> Best Regards
>>> Hugh Williams
>>> Professional Services
>>> OpenLink Software, Inc.      // http://www.openlinksw.com/
>>> Weblog   -- http://www.openlinksw.com/blogs/
>>> LinkedIn -- http://www.linkedin.com/company/openlink-software/
>>> Twitter  -- http://twitter.com/OpenLink
>>> Google+  -- http://plus.google.com/100570109519069333827/
>>> Facebook -- http://www.facebook.com/OpenLinkSoftware
>>> Universal Data Access, Integration, and Management Technology Providers
>>>
>>> On 14 May 2013, at 09:16, Jerven Bolleman <[email protected]
>>> <mailto:[email protected]>> wrote:
>>>
>>>> Hi All,
>>>>
>>>> When executing
>>>>
>>>> PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>>>>
>>>> CONSTRUCT
>>>>    { ?sub rdfs:subClassOf ?super .}
>>>> FROM <http://purl.uniprot.org/go/>
>>>> WHERE
>>>>    { ?sub (rdfs:subClassOf)* ?super }
>>>>
>>>> I get the following exception.
>>>>
>>>> Query evaluation failed:PREFIX
>>>> rdfs:<http://www.w3.org/2000/01/rdf-schema#> CONSTRUCT {?sub
>>>> rdfs:subClassOf ?super} FROM <http://purl.uniprot.org/go/> WHERE {?sub
>>>> rdfs:subClassOf* ?super}
>>>> org.openrdf.query.QueryEvaluationException: : SPARQL execute
>>>> failed:[PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> CONSTRUCT
>>>> {?sub rdfs:subClassOf ?super} FROM <http://purl.uniprot.org/go/> WHERE
>>>> {?sub rdfs:subClassOf* ?super}]
>>>>   Exception:virtuoso.jdbc3.VirtuosoException: TR...: transitive start
>>>> not given
>>>> at
>>>> virtuoso.sesame2.driver.VirtuosoRepositoryConnection.executeSPARQLForHandler(Unknown
>>>>
>>>> Source)
>>>>
>>>>
>>>> Regards,
>>>> Jerven
>>>> --
>>>> -------------------------------------------------------------------
>>>>   Jerven Bolleman [email protected]
>>>> <mailto:[email protected]>
>>>>   SIB Swiss Institute of Bioinformatics  Tel: +41 (0)22 379 58 85
>>>>   CMU, rue Michel Servet 1               Fax: +41 (0)22 379 58 58
>>>>   1211 Geneve 4,
>>>>   Switzerland www.isb-sib.ch <http://www.isb-sib.ch> - www.uniprot.org
>>>> <http://www.uniprot.org>
>>>>   Follow us at https://twitter.com/#!/uniprot
>>>> -------------------------------------------------------------------
>>>>
>>>> ------------------------------------------------------------------------------
>>>> AlienVault Unified Security Management (USM) platform delivers complete
>>>> security visibility with the essential security capabilities. Easily and
>>>> efficiently configure, manage, and operate all of your security controls
>>>> from a single console and one unified framework. Download a free trial.
>>>> http://p.sf.net/sfu/alienvault_d2d
>>>> _______________________________________________
>>>> Virtuoso-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>>>
>>
>>
>


-- 
-------------------------------------------------------------------
  Jerven Bolleman                        [email protected]
  SIB Swiss Institute of Bioinformatics  Tel: +41 (0)22 379 58 85
  CMU, rue Michel Servet 1               Fax: +41 (0)22 379 58 58
  1211 Geneve 4,
  Switzerland     www.isb-sib.ch - www.uniprot.org
  Follow us at https://twitter.com/#!/uniprot
-------------------------------------------------------------------

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Virtuoso-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to