You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Mikael Pesonen <mi...@lingsoft.fi> on 2019/05/30 15:18:46 UTC

application/sparql-results+json,*/* Accept header returns XML

Is there a way to correct this? I'm not able to change the header in client.

Using Jena Fuseki 11

Br,

-- 
Lingsoft - 30 years of Leading Language Management

www.lingsoft.fi

Speech Applications - Language Management - Translation - Reader's and Writer's Tools - Text Tools - E-books and M-books

Mikael Pesonen
System Engineer

e-mail: mikael.pesonen@lingsoft.fi
Tel. +358 2 279 3300

Time zone: GMT+2

Helsinki Office
Eteläranta 10
FI-00130 Helsinki
FINLAND

Turku Office
Kauppiaskatu 5 A
FI-20100 Turku
FINLAND


Re: application/sparql-results+json,*/* Accept header returns XML

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
I always mix those, using select solved the problem. Thanks!

On 31/05/2019 13:26, Lorenz B. wrote:
> Hello Mikael,
>
>   JSON Format is for SELECT and ASK.
>
> CONSTRUCT creates an RDF graph, the crrect format would be JSON-LD here.
>
>> Here is the exact query
>>
>> curl -H "Accept: application/sparql-results+json, */*"
>> https://localhost/fuseki/ds?query=%20%20%20%20construct%20%7B%3Fs%20%3Fp%20%3Fo%7D%20WHERE%0A%7B%0A%20%20%20%20GRAPH%20%3Chttps%3A%2F%2Fresource.lingsoft.fi%2Fyle_test%2F%3E%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%3Fs%20%3Fp%20%3Fo%0A%20%20%20%20%7D%0A%7D%0A%20%20%20
>>
>> So sparql is
>>
>> construct {?s ?p ?o} WHERE { GRAPH
>> <https://resource.lingsoft.fi/yle_test/> { ?s ?p ?o } }
>>
>> So maybe it's related to construct?
>>
>>
>>
>> On 30/05/2019 19:23, Andy Seaborne wrote:
>>> I get JSON.
>>>
>>>
>>> curl -d query='SELECT * {}' \
>>>       --header 'Accept: application/sparql-results+json, */*' \
>>>       http://localhost:3030/ds
>>> ==>
>>> {
>>>    "head": {
>>>      "vars": [  ]
>>>    } ,
>>>    "results": {
>>>      "bindings": [
>>>        {
>>>
>>>        }
>>>      ]
>>>    }
>>> }
>>>
>>>
>>>
>>>
>>> On 30/05/2019 16:18, Mikael Pesonen wrote:
>>>> Is there a way to correct this? I'm not able to change the header in
>>>> client.
>>>>
>>>> Using Jena Fuseki 11
>>>>
>>>> Br,
>>>>

-- 
Lingsoft - 30 years of Leading Language Management

www.lingsoft.fi

Speech Applications - Language Management - Translation - Reader's and Writer's Tools - Text Tools - E-books and M-books

Mikael Pesonen
System Engineer

e-mail: mikael.pesonen@lingsoft.fi
Tel. +358 2 279 3300

Time zone: GMT+2

Helsinki Office
Eteläranta 10
FI-00130 Helsinki
FINLAND

Turku Office
Kauppiaskatu 5 A
FI-20100 Turku
FINLAND


Re: application/sparql-results+json,*/* Accept header returns XML

Posted by Martynas Jusevičius <ma...@atomgraph.com>.
Lorenz,

I was about to reply the same. But I think */* in the Accept header
should match the RDF graph media types? Even if
application/sparql-results+json does not.

On Fri, May 31, 2019 at 12:26 PM Lorenz B.
<bu...@informatik.uni-leipzig.de> wrote:
>
> Hello Mikael,
>
>  JSON Format is for SELECT and ASK.
>
> CONSTRUCT creates an RDF graph, the crrect format would be JSON-LD here.
>
> >
> > Here is the exact query
> >
> > curl -H "Accept: application/sparql-results+json, */*"
> > https://localhost/fuseki/ds?query=%20%20%20%20construct%20%7B%3Fs%20%3Fp%20%3Fo%7D%20WHERE%0A%7B%0A%20%20%20%20GRAPH%20%3Chttps%3A%2F%2Fresource.lingsoft.fi%2Fyle_test%2F%3E%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%3Fs%20%3Fp%20%3Fo%0A%20%20%20%20%7D%0A%7D%0A%20%20%20
> >
> > So sparql is
> >
> > construct {?s ?p ?o} WHERE { GRAPH
> > <https://resource.lingsoft.fi/yle_test/> { ?s ?p ?o } }
> >
> > So maybe it's related to construct?
> >
> >
> >
> > On 30/05/2019 19:23, Andy Seaborne wrote:
> >> I get JSON.
> >>
> >>
> >> curl -d query='SELECT * {}' \
> >>      --header 'Accept: application/sparql-results+json, */*' \
> >>      http://localhost:3030/ds
> >> ==>
> >> {
> >>   "head": {
> >>     "vars": [  ]
> >>   } ,
> >>   "results": {
> >>     "bindings": [
> >>       {
> >>
> >>       }
> >>     ]
> >>   }
> >> }
> >>
> >>
> >>
> >>
> >> On 30/05/2019 16:18, Mikael Pesonen wrote:
> >>>
> >>> Is there a way to correct this? I'm not able to change the header in
> >>> client.
> >>>
> >>> Using Jena Fuseki 11
> >>>
> >>> Br,
> >>>
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>

Re: application/sparql-results+json,*/* Accept header returns XML

Posted by "Lorenz B." <bu...@informatik.uni-leipzig.de>.
Hello Mikael,

 JSON Format is for SELECT and ASK.

CONSTRUCT creates an RDF graph, the crrect format would be JSON-LD here.

>
> Here is the exact query
>
> curl -H "Accept: application/sparql-results+json, */*"
> https://localhost/fuseki/ds?query=%20%20%20%20construct%20%7B%3Fs%20%3Fp%20%3Fo%7D%20WHERE%0A%7B%0A%20%20%20%20GRAPH%20%3Chttps%3A%2F%2Fresource.lingsoft.fi%2Fyle_test%2F%3E%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%3Fs%20%3Fp%20%3Fo%0A%20%20%20%20%7D%0A%7D%0A%20%20%20
>
> So sparql is
>
> construct {?s ?p ?o} WHERE { GRAPH
> <https://resource.lingsoft.fi/yle_test/> { ?s ?p ?o } }
>
> So maybe it's related to construct?
>
>
>
> On 30/05/2019 19:23, Andy Seaborne wrote:
>> I get JSON.
>>
>>
>> curl -d query='SELECT * {}' \
>>      --header 'Accept: application/sparql-results+json, */*' \
>>      http://localhost:3030/ds
>> ==>
>> {
>>   "head": {
>>     "vars": [  ]
>>   } ,
>>   "results": {
>>     "bindings": [
>>       {
>>
>>       }
>>     ]
>>   }
>> }
>>
>>
>>
>>
>> On 30/05/2019 16:18, Mikael Pesonen wrote:
>>>
>>> Is there a way to correct this? I'm not able to change the header in
>>> client.
>>>
>>> Using Jena Fuseki 11
>>>
>>> Br,
>>>
>
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center


Re: application/sparql-results+json,*/* Accept header returns XML

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
Here is the exact query

curl -H "Accept: application/sparql-results+json, */*" 
https://localhost/fuseki/ds?query=%20%20%20%20construct%20%7B%3Fs%20%3Fp%20%3Fo%7D%20WHERE%0A%7B%0A%20%20%20%20GRAPH%20%3Chttps%3A%2F%2Fresource.lingsoft.fi%2Fyle_test%2F%3E%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%3Fs%20%3Fp%20%3Fo%0A%20%20%20%20%7D%0A%7D%0A%20%20%20

So sparql is

construct {?s ?p ?o} WHERE { GRAPH 
<https://resource.lingsoft.fi/yle_test/> { ?s ?p ?o } }

So maybe it's related to construct?



On 30/05/2019 19:23, Andy Seaborne wrote:
> I get JSON.
>
>
> curl -d query='SELECT * {}' \
>      --header 'Accept: application/sparql-results+json, */*' \
>      http://localhost:3030/ds
> ==>
> {
>   "head": {
>     "vars": [  ]
>   } ,
>   "results": {
>     "bindings": [
>       {
>
>       }
>     ]
>   }
> }
>
>
>
>
> On 30/05/2019 16:18, Mikael Pesonen wrote:
>>
>> Is there a way to correct this? I'm not able to change the header in 
>> client.
>>
>> Using Jena Fuseki 11
>>
>> Br,
>>

-- 
Lingsoft - 30 years of Leading Language Management

www.lingsoft.fi

Speech Applications - Language Management - Translation - Reader's and Writer's Tools - Text Tools - E-books and M-books

Mikael Pesonen
System Engineer

e-mail: mikael.pesonen@lingsoft.fi
Tel. +358 2 279 3300

Time zone: GMT+2

Helsinki Office
Eteläranta 10
FI-00130 Helsinki
FINLAND

Turku Office
Kauppiaskatu 5 A
FI-20100 Turku
FINLAND


Re: application/sparql-results+json,*/* Accept header returns XML

Posted by Andy Seaborne <an...@apache.org>.
I get JSON.


curl -d query='SELECT * {}' \
      --header 'Accept: application/sparql-results+json, */*' \
      http://localhost:3030/ds
==>
{
   "head": {
     "vars": [  ]
   } ,
   "results": {
     "bindings": [
       {

       }
     ]
   }
}




On 30/05/2019 16:18, Mikael Pesonen wrote:
> 
> Is there a way to correct this? I'm not able to change the header in 
> client.
> 
> Using Jena Fuseki 11
> 
> Br,
>