Hello Burak Yönyül,

> I cannot execute queries which are greater than a few kilobytes on Virtuoso. 
> I've loaded example drugbank dataset into Virtuoso Opensource 6.1 and I'm 
> trying to execute the query in the file I've attached here, on my local 
> drugbank dataset with the sparql endpoint 
> "http://155.223.24.47:8893/drugbank/sparql";. But when I execute this I get 
> "HTTPException: 400 Bad Request". How can I execute queries greater than 25 
> KB?

I promised i would also have a look at the query itself and see if it could be 
simplified.

Your query consists of a union of repeating patterns like this:

{ ?y_0 <http://www.w3.org/2002/07/owl#sameAs> 
<http://dbpedia.org/resource/Tetrahydrocannabinol> .
?Int_0 
<http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/interactionDrug1> 
?y_0 .
?Int_0 
<http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/interactionDrug2> 
?IntDrug_0 .
?Int_0 <http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/text> 
?IntEffect_0
}
UNION
{ ?y_1 <http://www.w3.org/2002/07/owl#sameAs> 
<http://dbpedia.org/resource/Mescaline> .
?Int_1 
<http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/interactionDrug1> 
?y_1 .
?Int_1 
<http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/interactionDrug2> 
?IntDrug_1 .
?Int_1 <http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/text> 
?IntEffect_1
}
}
UNION
{ ?y_2 <http://www.w3.org/2002/07/owl#sameAs> 
<http://dbpedia.org/resource/Bacillus_Calmette-Gu%C3%A9rin> .
?Int_2 
<http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/interactionDrug1> 
?y_2 .
?Int_2 
<http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/interactionDrug2> 
?IntDrug_2 .
?Int_2 <http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/text> 
?IntEffect_2
}
}
UNION
{ ?y_3 <http://www.w3.org/2002/07/owl#sameAs> 
<http://dbpedia.org/resource/Sugammadex> .
?Int_3 
<http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/interactionDrug1> 
?y_3 .
?Int_3 
<http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/interactionDrug2> 
?IntDrug_3 .
?Int_3 <http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/text> 
?IntEffect_3
}
}
UNION
{ ?y_4 <http://www.w3.org/2002/07/owl#sameAs> 
<http://dbpedia.org/resource/Carnitine> .
?Int_4 
<http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/interactionDrug1> 
?y_4 .
?Int_4 
<http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/interactionDrug2> 
?IntDrug_4 .
?Int_4 <http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/text> 
?IntEffect_4
}
}

etc.

In this case you should be able to use the SPARQL 1.1 IN construction[1] as in:

SELECT * WHERE {
  ?y_0 <http://www.w3.org/2002/07/owl#sameAs> ?d_1 .
  FILTER (?d_1 in (
        <http://dbpedia.org/resource/Tetrahydrocannabinol> , 
        <http://dbpedia.org/resource/Mescaline>,
        <http://dbpedia.org/resource/Bacillus_Calmette-Gu%C3%A9rin>,
        <http://dbpedia.org/resource/Sugammadex>,
        <http://dbpedia.org/resource/Carnitine>
  )).

  ?Int_0 
<http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/interactionDrug1> 
?y_0 .
  ?Int_0 
<http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/interactionDrug2> 
?IntDrug_0 .
  ?Int_0 <http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/text> 
?IntEffect_0
}

which results in a much shorter query.

See also:
[1] http://www.w3.org/TR/sparql11-query/#func-in


Best regards,

Patrick

Attachment: smime.p7s
Description: S/MIME cryptographic signature

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to