You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "Jeffrey C. Witt" <je...@gmail.com> on 2015/05/26 22:30:54 UTC
posting json-ld to fuseki
I'm getting an error when posting a json-ld file to Fuseki 2.0 as follows:
echo "trying jsonld"
./s-post http://localhost:3030/ds/data default
~/WebPages/scta/public/pg-lon.json
./s-post http://localhost:3030/ds/data default
~/WebPages/scta/public/pp-sorb.json
I was under the impression Fuseki 2.0 supported json-ld, but when execute
this post commands I get the following error:
trying jsonld
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/header.rb:17:in
`block in initialize_http_header': undefined method `strip' for
nil:NilClass (NoMethodError)
from
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/header.rb:15:in
`each'
from
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/header.rb:15:in
`initialize_http_header'
from ./s-post:199:in `send_body'
from ./s-post:163:in `POST'
from ./s-post:422:in `cmd_soh'
from ./s-post:697:in `<main>'
I have attached the json-ld file I'm trying to post.
Any ideas what is happening? Am I wrong to think Fuseki can ingest this? If
so, any ideas how I can easily ingest json into my Fuseki server.
Thanks
Re: posting json-ld to fuseki
Posted by Jeffrey Witt <je...@gmail.com>.
Success. One other error on my part was that my files ended in .json not
.jsonld. `content_type` was using the file extension to get the right
³media type², so I needed to change them to .jsonld.
Thanks for your help.
jw
--
Dr. Jeffrey C. Witt
Philosophy Department
Loyola University Maryland
4501 N. Charles St.
Baltimore, MD 21210
On 5/26/15, 5:07 PM, "Andy Seaborne" <an...@apache.org> wrote:
>On 26/05/15 21:30, Jeffrey C. Witt wrote:
>> I'm getting an error when posting a json-ld file to Fuseki 2.0 as
>>follows:
>>
>> echo "trying jsonld"
>> ./s-post http://localhost:3030/ds/data default
>> ~/WebPages/scta/public/pg-lon.json
>> ./s-post http://localhost:3030/ds/data default
>> ~/WebPages/scta/public/pp-sorb.json
>
> From the JSON-LD spec, MIME type registration, the file extension for
>JSON-LD is .jsonld
>
>s-post doesn't include (seems to have been forgotten) so you'll need to
>do it old school:
>
>curl -XPOST --data-binary @FILE.jsonld \
> --header 'Content-type: application/ld+json \
> 'http://localhost:3030/ds/data?default'
>
>
>>
>>
>> I was under the impression Fuseki 2.0 supported json-ld, but when
>> execute this post commands I get the following error:
>
>It should
>
>Sorry about that.
>
> Andy
>
>To patch s-post:
>
>Add just after $mtTurtle:
>
>$mtJsonLD = 'application/ld+json'
>
>and add
>
>$fileMediaTypes['jsonld'] = $mtJsonLD
>
>after
>
>$fileMediaTypes['ttl'] = $mtTurtle
>
>>
>> trying jsonld
>>
>>
>>/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0
>>/net/http/header.rb:17:in
>> `block in initialize_http_header': undefined method `strip' for
>> nil:NilClass (NoMethodError)
>>
>> from
>>
>>/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0
>>/net/http/header.rb:15:in
>> `each'
>>
>> from
>>
>>/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0
>>/net/http/header.rb:15:in
>> `initialize_http_header'
>>
>> from ./s-post:199:in `send_body'
>>
>> from ./s-post:163:in `POST'
>>
>> from ./s-post:422:in `cmd_soh'
>>
>> from ./s-post:697:in `<main>'
>>
>> I have attached the json-ld file I'm trying to post.
>>
>> Any ideas what is happening? Am I wrong to think Fuseki can ingest this?
>> If so, any ideas how I can easily ingest json into my Fuseki server.
>>
>> Thanks
>
Re: posting json-ld to fuseki
Posted by Andy Seaborne <an...@apache.org>.
On 26/05/15 21:30, Jeffrey C. Witt wrote:
> I'm getting an error when posting a json-ld file to Fuseki 2.0 as follows:
>
> echo "trying jsonld"
> ./s-post http://localhost:3030/ds/data default
> ~/WebPages/scta/public/pg-lon.json
> ./s-post http://localhost:3030/ds/data default
> ~/WebPages/scta/public/pp-sorb.json
From the JSON-LD spec, MIME type registration, the file extension for
JSON-LD is .jsonld
s-post doesn't include (seems to have been forgotten) so you'll need to
do it old school:
curl -XPOST --data-binary @FILE.jsonld \
--header 'Content-type: application/ld+json \
'http://localhost:3030/ds/data?default'
>
>
> I was under the impression Fuseki 2.0 supported json-ld, but when
> execute this post commands I get the following error:
It should
Sorry about that.
Andy
To patch s-post:
Add just after $mtTurtle:
$mtJsonLD = 'application/ld+json'
and add
$fileMediaTypes['jsonld'] = $mtJsonLD
after
$fileMediaTypes['ttl'] = $mtTurtle
>
> trying jsonld
>
> /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/header.rb:17:in
> `block in initialize_http_header': undefined method `strip' for
> nil:NilClass (NoMethodError)
>
> from
> /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/header.rb:15:in
> `each'
>
> from
> /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/header.rb:15:in
> `initialize_http_header'
>
> from ./s-post:199:in `send_body'
>
> from ./s-post:163:in `POST'
>
> from ./s-post:422:in `cmd_soh'
>
> from ./s-post:697:in `<main>'
>
> I have attached the json-ld file I'm trying to post.
>
> Any ideas what is happening? Am I wrong to think Fuseki can ingest this?
> If so, any ideas how I can easily ingest json into my Fuseki server.
>
> Thanks