On 8/24/16 11:27 AM, Nick Bassiliades wrote:
> Dear all,
> To start off, I'm really not sure if this is the correct forum to pose 
> my question, so I initially apologize
> and I kindly ask to re-direct me to the proper forum, if anyone of you 
> knows.
>
> I have a problem with a SPARQL query I send over a remote client to the 
> public SPARQL endpoint of DBpedia.
> The query is the following:
>
> select ?s1, ?s2 where { {
> select ?s1, ?s2 where {
> ?s1 ?x ?o1 .
> ?o1 bif:contains ' ( "Pierre" AND "Marie" AND "Curie" AND "University" 
> AND "UPMC" ) ' option ( score ?sc ) .
> ?s1 rdfs:label ?s2 .
> ?s1 rdf:type dbo:EducationalInstitution . }
> order by desc ( ?sc * 3e-1 + sql:rnk_scale ( <LONG::IRI_RANK> ( ?s1 ) ) )
> limit 100 } .
> FILTER (lang(?s2) = "en") }
> limit 2
>
> If I type it in the query box of http:dbpedia.org/sparql, everything is 
> fine.
>
> However, when I construct the query and send it over a remote client 
> like this:
>
> http://dbpedia.org/sparql?query=select%20?s1,%20?s2%20where%20{%20{%20select%20?s1,%20?s2%20where%20{%20?s1%20?x%20?o1%20.%20?o1%20bif:contains%20%27%20(%20%22Pierre%22%20AND%20%22Marie%22%20AND%20%22Curie%22%20AND%20%22University%22%20AND%20%22UPMC%22%20)%27%20option%20(%20score%20?sc%20)%20.%20?s1%20rdfs:label%20?s2%20.%20?s1%20rdf:type%20dbo:EducationalInstitution%20.%20}%20order%20by%20desc%20(%20?sc%20*%203e-1%20%2B%20sql:rnk_scale%20(%20%3CLONG::IRI_RANK%3E%20(%20?s1%20)%20)%20)%20limit%20100%20}%20.%20FILTER%20(%20lang(?s2)%20%3D%20%22en%22)%20}%20limit%202&entailment=rdfs&timeout=2000
>
> there is a problem; the following error page appears:
>> > Virtuoso 37000 Error SQ156: Internal Optimized compiler error : col is not 
>> > supposed to be virtual in sqldf.c:1496.
>> > Please report the statement compiled.
>> >
>> > SPARQL query:
>> > define sql:big-data-const 0 select ?s1, ?s2 where { { select ?s1, ?s2 
>> > where { ?s1 ?x ?o1 . ?o1 bif:contains ' ( "Pierre" AND "Marie" AND "Curie" 
>> > AND "University" AND "UPMC" )' option ( score ?sc ) . ?s1 rdfs:label ?s2 . 
>> > ?s1 rdf:type dbo:EducationalInstitution . } order by desc ( ?sc * 3e-1 + 
>> > sql:rnk_scale ( <LONG::IRI_RANK> ( ?s1 ) ) ) limit 100 } . FILTER ( 
>> > lang(?s2) = "en") } limit 2
> The funny thing is that if let's say reduce the query by removing e.g. 
> one of the keywords, then the query runs fine:
>
> http://dbpedia.org/sparql?query=select%20?s1,%20?s2%20where%20{%20{%20select%20?s1,%20?s2%20where%20{%20?s1%20?x%20?o1%20.%20?o1%20bif:contains%20%27%20(%20%22Pierre%22%20AND%20%22Marie%22%20AND%20%22Curie%22%20AND%20%22University%22%20)%27%20option%20(%20score%20?sc%20)%20.%20?s1%20rdfs:label%20?s2%20.%20?s1%20rdf:type%20dbo:EducationalInstitution%20.%20}%20order%20by%20desc%20(%20?sc%20*%203e-1%20%2B%20sql:rnk_scale%20(%20%3CLONG::IRI_RANK%3E%20(%20?s1%20)%20)%20)%20limit%20100%20}%20.%20FILTER%20(%20lang(?s2)%20%3D%20%22en%22)%20}%20limit%202&entailment=rdfs&timeout=2000
>
> Do you think there might be a problem with the length of the URL in 
> Virtuoso?
> Has anyone of you come up with such a problem before?
>
> Thank you in advance.
> Your help will be greatly appreciated.
> Sorry again if this is not the correct forum to report this.
>
> Best Regards,
> Nick
>
>
> -- *************************************************************** *
> Dr. Nick Bassiliades, Associate Professor * * Dept. of Informatics,
> Aristotle University of Thessaloniki * * 54124 Thessaloniki, Greece *
> * * * Tel: +302310997913 E-mail: nbass...@csd.auth.gr * * Fax:
> +302310997913 URL: http://tinyurl.com/bassiliades * *
> =========================================================== * *
> Intelligent Systems Group - http://intelligence.csd.auth.gr *
> ***************************************************************

I just tried this for XML:


curl -i
"http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=select+%3Fs1%2C+%3Fs2+where+%7B+%7B%0D%0Aselect+%3Fs1%2C+%3Fs2+where+%7B%0D%0A%3Fs1+%3Fx+%3Fo1+.%0D%0A%3Fo1+bif%3Acontains+%27+%28+%22Pierre%22+AND+%22Marie%22+AND+%22Curie%22+AND+%22University%22+AND+%22UPMC%22+%29+%27+option+%28+score+%3Fsc+%29+.%0D%0A%3Fs1+rdfs%3Alabel+%3Fs2+.%0D%0A%3Fs1+rdf%3Atype+dbo%3AEducationalInstitution+.+%7D%0D%0Aorder+by+desc+%28+%3Fsc+*+3e-1+%2B+sql%3Arnk_scale+%28+%3CLONG%3A%3AIRI_RANK%3E+%28+%3Fs1+%29+%29+%29%0D%0Alimit+100+%7D+.%0D%0AFILTER+%28lang%28%3Fs2%29+%3D+%22en%22%29+%7D%0D%0Alimit+2&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on";

HTTP/1.1 200 OK
Date: Wed, 24 Aug 2016 16:09:26 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 513
Connection: keep-alive
Server: Virtuoso/07.20.3217 (Linux) i686-generic-linux-glibc212-64  VDB
X-SPARQL-default-graph: http://dbpedia.org
Expires: Wed, 31 Aug 2016 16:09:26 GMT
Cache-Control: max-age=604800
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers:
DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Accept-Encoding
Accept-Ranges: bytes

<table class="sparql" border="1">
  <tr>
    <th>s1</th>
    <th>s2</th>
  </tr>
  <tr>
    <td><a
href="http://dbpedia.org/resource/Pierre_and_Marie_Curie_University";>http://dbpedia.org/resource/Pierre_and_Marie_Curie_University</a></td>
    <td><pre>"Pierre and Marie Curie University"@en</pre></td>
  </tr>
  <tr>
    <td><a
href="http://dbpedia.org/resource/Polytech'Paris-UPMC">http://dbpedia.org/resource/Polytech&#39;Paris-UPMC</a></td>
    <td><pre>"Polytech&#39;Paris-UPMC"@en</pre></td>
  </tr>
</table>


And this for JSON:

curl -i
"http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=select+%3Fs1%2where+%7B+%7B%0D%0Aselect+%3Fs1%2C+%3Fs2+where+%7B%0D%0A%3Fs1+%3Fx+%3Fo1+.%0D%0A%3Fo1+bif%3Acontains+%27+%28+%22Pierre%22+AND+%22Marie%22+AND+%22Curie%22+AND+%22University%22+AND+%22UPMC%22+%29+%27+option+%28+score+%3Fsc+%29+.%0D%0A%3Fs1+rdfs%3Alabel+%3Fs2+.%0D%0A%3Fs1+rdf%3Atype+dbo%3AEducationalInstitution+.+%7D%0D%0Aorder+by+desc+%28+%3Fsc+*+3e-1+%2B+sql%3Arnk_scale+%28+%3CLONG%3A%3AIRI_RANK%3E+%28+%3Fs1+%29+%29+%29%0D%0Alimit+100+%7D+.%0D%0AFILTER+%28lang%28%3Fs2%29+%3D+%22en%22%29+%7D%0D%0Alimit+2&format=application%2Fsparql-results%2Bjson&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on";

HTTP/1.1 200 OK
Date: Wed, 24 Aug 2016 16:11:04 GMT
Content-Type: application/sparql-results+json
Content-Length: 490
Connection: keep-alive
Server: Virtuoso/07.20.3217 (Linux) i686-generic-linux-glibc212-64  VDB
X-SPARQL-default-graph: http://dbpedia.org
Expires: Wed, 31 Aug 2016 16:11:04 GMT
Cache-Control: max-age=604800
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers:
DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Accept-Encoding
Accept-Ranges: bytes


{ "head": { "link": [], "vars": ["s1", "s2"] },
  "results": { "distinct": false, "ordered": true, "bindings": [
    { "s1": { "type": "uri", "value":
"http://dbpedia.org/resource/Pierre_and_Marie_Curie_University"; }    ,
"s2": { "type": "literal", "xml:lang": "en", "value": "Pierre and Marie
Curie University" }},
    { "s1": { "type": "uri", "value":
"http://dbpedia.org/resource/Polytech'Paris-UPMC" }    , "s2": { "type":
"literal", "xml:lang": "en", "value": "Polytech'Paris-UPMC" }} ] } }


-- 
Regards,

Kingsley Idehen       
Founder & CEO 
OpenLink Software   (Home Page: http://www.openlinksw.com)

Medium Blog: https://medium.com/@kidehen
Blogspot Blog: http://kidehen.blogspot.com
Twitter Profile: https://twitter.com/kidehen
Google+ Profile: https://plus.google.com/+KingsleyIdehen/about
LinkedIn Profile: http://www.linkedin.com/in/kidehen
Personal WebID: http://kingsley.idehen.net/dataspace/person/kidehen#this

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

------------------------------------------------------------------------------
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to