You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Diogo FC Patrao <dj...@gmail.com> on 2013/04/10 15:19:40 UTC

SERVICE problem

Hello all

I have a d2r-server (a joseki server providing a sparql endpoint using
d2rq, a library that translates sparql to sql) and noticed a strange effect
when issuing a certain query:

SELECT DISTINCT  *
WHERE
  {
SERVICE <http://0.0.0.0:2020/sparql> { ?document
<http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentType>
"exam request" . }
SERVICE <http://0.0.0.0:2020/sparql> { ?document
<http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentAuthor>
?author . }
  }

[ This query is part of a bigger one that refers to several d2r-server
instances, and I know that I could join both SERVICEs in one, or even query
the service directly but that's not the point. ]

0.0.0.0:2020/sparql points to a d2r-server instance. This query was issued
not directly to this instance, but rather by a  command line ARQ
2.10.1-snapshot over an empty graph.

The problem is, instead of getting proper URIs for ?author, for some
lines I'm getting those huge hex data, like

<687474703A2F2F7777772E636970652E616363616D6172676F2E6F72672E62722F6F6E746F6C6F676961732F683274632E6F776C237573657273554E495636363837353234353636>

Interestingly enough, converting consecutive pairs of those bytes to chars,
it turns into a URI!

http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#usersUNIV6687524566

Which is a valid answer to ?author.

I have verified that a query without those SERVICE keywords works
perfectly, when issued directly to D2R-server. Or, if I join the two
SERVICEs in one, it also works ok.

*jena version (at D2R server)*
joseki-3.4.4
jena-arq-2.9.0-incubating
jena-core-2.7.0-incubating
jena-iri-9.9.0-incubating

Any help in order to get things straight will be appreciated.

Thanks,
--
diogo patrão

Re: SERVICE problem

Posted by Diogo FC Patrao <dj...@gmail.com>.
Hi Andy

I did some more tests and the problem was that some SQL expression were
returning a binary data type instead of varchar for the URI, and D2R got
that serialized as a string of hex codes.

Thanks anyway!

--
diogo patrão




On Thu, Apr 11, 2013 at 8:58 AM, Andy Seaborne <an...@apache.org> wrote:

> On 11/04/13 12:45, Diogo FC Patrao wrote:
>
>> Hello Andy
>>
>>
>>
>>  joseki-3.4.4
>>>
>>>>
>>>>
>>> Use Fuseki
>>>
>>>
>> I'll try;
>>
>>
>>  Any help in order to get things straight will be appreciated.
>>>
>>>>
>>>>
>>> I can't think of anything
>>>
>>> You say the query directly to the D2R-server -- what format is that
>>> using?
>>> Could you show a sample of the results (inc MIME type)?
>>>
>>>
>> Sorry, I didn't get what you mean about format or result mimetype.
>>
>
> I want to know what comes back from the D2R server when the SERVICE call
> is made. I.e. is the wrong at the point it is sent from the D2R server.
>  Removing %, without decoding, is not something Jena does - so first check
> on what comes back.
>
> Something like (this is all one line)
>
> wget -O- --header "Accept: application/sparql-results" '
> http://0.0.0.0:2020/sparql?**query=SELECT<http://0.0.0.0:2020/sparql?query=SELECT>* SERVICE <
> http://0.0.0.0:2020/sparql> { ?document
> <http://www.cipe.accamargo.**org.br/ontologias/h2tc.owl#**documentAuthor<http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentAuthor>
> >
> ?author . } LIMIT 5}'
>
>
>         Andy
>

Re: SERVICE problem

Posted by Andy Seaborne <an...@apache.org>.
On 11/04/13 12:45, Diogo FC Patrao wrote:
> Hello Andy
>
>
>
>> joseki-3.4.4
>>>
>>
>> Use Fuseki
>>
>
> I'll try;
>
>
>> Any help in order to get things straight will be appreciated.
>>>
>>
>> I can't think of anything
>>
>> You say the query directly to the D2R-server -- what format is that using?
>> Could you show a sample of the results (inc MIME type)?
>>
>
> Sorry, I didn't get what you mean about format or result mimetype.

I want to know what comes back from the D2R server when the SERVICE call 
is made. I.e. is the wrong at the point it is sent from the D2R server. 
  Removing %, without decoding, is not something Jena does - so first 
check on what comes back.

Something like (this is all one line)

wget -O- --header "Accept: application/sparql-results" 
'http://0.0.0.0:2020/sparql?query=SELECT * SERVICE 
<http://0.0.0.0:2020/sparql> { ?document
<http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentAuthor>
?author . } LIMIT 5}'


	Andy

Re: SERVICE problem

Posted by Diogo FC Patrao <dj...@gmail.com>.
Hello Andy



> joseki-3.4.4
>>
>
> Use Fuseki
>

I'll try;


> Any help in order to get things straight will be appreciated.
>>
>
> I can't think of anything
>
> You say the query directly to the D2R-server -- what format is that using?
> Could you show a sample of the results (inc MIME type)?
>

Sorry, I didn't get what you mean about format or result mimetype.

Here's what I get, though (limiting results)

[djogo@fisher ~]$ /opt/apache-jena-2.10.1-SNAPSHOT/bin/arq --query
bug_sparql_jena_ou_d2r.txt --graph
/opt/djogo_paper/rodada20130325/roda_unificado_unificado/ontocloud.owl
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| document
| author
                                                                          |
=================================================================================================================================================================================================================================
| <http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentsEHR27489>
|
<687474703A2F2F7777772E636970652E616363616D6172676F2E6F72672E62722F6F6E746F6C6F676961732F683274632E6F776C237573657273554E495632313237363936363530>
|
| <http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentsEHR27491>
|
<687474703A2F2F7777772E636970652E616363616D6172676F2E6F72672E62722F6F6E746F6C6F676961732F683274632E6F776C237573657273554E495632313237363936363530>
|
| <http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentsEHR27492>
|
<687474703A2F2F7777772E636970652E616363616D6172676F2E6F72672E62722F6F6E746F6C6F676961732F683274632E6F776C237573657273554E495632313237363936363530>
|
| <http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentsEHR27687>
|
<687474703A2F2F7777772E636970652E616363616D6172676F2E6F72672E62722F6F6E746F6C6F676961732F683274632E6F776C237573657273554E495638363837373434373235>
|
| <http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentsEHR27691>
|
<687474703A2F2F7777772E636970652E616363616D6172676F2E6F72672E62722F6F6E746F6C6F676961732F683274632E6F776C237573657273554E495636333732373236363131>
|
| <http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentsEHR27801>
|
<687474703A2F2F7777772E636970652E616363616D6172676F2E6F72672E62722F6F6E746F6C6F676961732F683274632E6F776C237573657273554E495637343335363138303637>
|
| <http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentsEHR27802>
|
<687474703A2F2F7777772E636970652E616363616D6172676F2E6F72672E62722F6F6E746F6C6F676961732F683274632E6F776C237573657273554E495637353933303737343734>
|
| <http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentsEHR32640>
|
<687474703A2F2F7777772E636970652E616363616D6172676F2E6F72672E62722F6F6E746F6C6F676961732F683274632E6F776C23757365727345485231363135>
              |
| <http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentsEHR32660>
|
<687474703A2F2F7777772E636970652E616363616D6172676F2E6F72672E62722F6F6E746F6C6F676961732F683274632E6F776C237573657273554E495639393438313135333338>
|
| <http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentsEHR32719>
|
<687474703A2F2F7777772E636970652E616363616D6172676F2E6F72672E62722F6F6E746F6C6F676961732F683274632E6F776C237573657273554E495631323931373635353036>
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The query is:

SELECT DISTINCT  *
WHERE
  {
SERVICE <http://0.0.0.0:2020/sparql> { ?document
<http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentType>
"exam request" . }
SERVICE <http://0.0.0.0:2020/sparql> { ?document
<http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentAuthor>
?author . }
  }
limit 10


ARQ 2.8.8 yields the same.


>
>
>> Thanks,
>> --
>> diogo patrão
>>
>>
>

Re: SERVICE problem

Posted by Andy Seaborne <an...@apache.org>.
On 10/04/13 14:19, Diogo FC Patrao wrote:
> Hello all
>
> I have a d2r-server (a joseki server providing a sparql endpoint using
> d2rq, a library that translates sparql to sql) and noticed a strange effect
> when issuing a certain query:
>
> SELECT DISTINCT  *
> WHERE
>    {
> SERVICE <http://0.0.0.0:2020/sparql> { ?document
> <http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentType>
> "exam request" . }
> SERVICE <http://0.0.0.0:2020/sparql> { ?document
> <http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#documentAuthor>
> ?author . }
>    }
>
> [ This query is part of a bigger one that refers to several d2r-server
> instances, and I know that I could join both SERVICEs in one, or even query
> the service directly but that's not the point. ]
>
> 0.0.0.0:2020/sparql points to a d2r-server instance. This query was issued
> not directly to this instance, but rather by a  command line ARQ
> 2.10.1-snapshot over an empty graph.
>
> The problem is, instead of getting proper URIs for ?author, for some
> lines I'm getting those huge hex data, like
>
> <687474703A2F2F7777772E636970652E616363616D6172676F2E6F72672E62722F6F6E746F6C6F676961732F683274632E6F776C237573657273554E495636363837353234353636>
>
> Interestingly enough, converting consecutive pairs of those bytes to chars,
> it turns into a URI!
>
> http://www.cipe.accamargo.org.br/ontologias/h2tc.owl#usersUNIV6687524566
>
> Which is a valid answer to ?author.
>
> I have verified that a query without those SERVICE keywords works
> perfectly, when issued directly to D2R-server. Or, if I join the two
> SERVICEs in one, it also works ok.
>
> *jena version (at D2R server)*
> joseki-3.4.4

Use Fuseki

> jena-arq-2.9.0-incubating
> jena-core-2.7.0-incubating
> jena-iri-9.9.0-incubating

0.9.0 :-)

>
> Any help in order to get things straight will be appreciated.

I can't think of anything

You say the query directly to the D2R-server -- what format is that 
using? Could you show a sample of the results (inc MIME type)?

>
> Thanks,
> --
> diogo patrão
>