RE: Yet another Hydra Console question

I’ve investigated a bit deeper. I was able to craft a very tiny example (I’ve added to the gist I’ve created earlier, see https://gist.github.com/alien-mcl/bbe031342ed64e9a1e89).

It seems that the hydra console doesn’t like explicitely typed literals. In the example below:

{
  "@graph": [
    {
      "@id": "http://localhost:51509/person?format=jsonld/#",
      "@type": ["http://www.w3.org/ns/hydra/core#ApiDocumentation"],
      "http://www.w3.org/ns/hydra/core#supportedClasses": {
        "@id": "http://temp.uri/test"
      }
    },
    {
      "@id": "http://temp.uri/test",
      "@type": [
        "http://www.w3.org/ns/hydra/core#Class",
        "http://www.w3.org/2000/01/rdf-schema#Resource",
        "http://www.w3.org/ns/hydra/core#Resource",
        "http://www.w3.org/2000/01/rdf-schema#Class"
      ],
      "http://www.w3.org/2000/01/rdf-schema#comment": {
        "@type": "http://www.w3.org/2001/XMLSchema#string",
        "@value": "Describes a person."
      },
      "http://www.w3.org/2000/01/rdf-schema#label": {
        "@type": "http://www.w3.org/2001/XMLSchema#string",
        "@value": "Person"
      }
    }
  ]
}

It causes a 400 JsonLdException, but when removing ‘"@type": "http://www.w3.org/2001/XMLSchema#string",‘ it starts to work!

Is it a bug? I’ve consulted JSON-LD spec on W3C and this construct is pretty legal.

Regards

Karol Szczepański



Od: Asbjørn Ulsberg
Wysłano: poniedziałek, 21 września 2015 22:08
Do: Karol Szczepański
DW: public-hydra@w3.org
Temat: Re: Yet another Hydra Console question


Have you tried to paste your document into the JSON-LD playground?

http://json-ld.org/playground/index.html


If you want to make it available online, you can paste it into a (private) gist on GitHub:

https://gist.github.com/


2015-09-21 20:59 GMT+02:00 Karol Szczepański <karol.szczepanski@gmail.com>:
Hi
 
I’m quite advanced in my tiny creation of my own in C# and I wanted to test it with the Hydra Console. I did set it up on my machine locally (Windows 10, IIS7, PHP 5.6.13 x32 NTS FastCGI) using the procedure provided and I was able to start it up.
 
It does a request to my API documentation uri, but for some reason it fails with a strange exception: of type HTTP 400 JsonLdException:
 
Invalid value for @type detected (must be an IRI) (near {&quot;@type&quot;:{&quot;__iri&quot;:&quot;@type&quot;,&quot;__value&quot;:{&quot;__orig_value&quot;:&quot;http://www.w3.org/2001/XMLSchema#string&quot;,&quot;__value&quot;:{&quot;@id&quot;:&quot;http://www.w3.org/2001/XMLSchema#string&quot;}}},&quot;@value&quot;:&quot;Describes a person.&quot;}).
 
I quickly reviewed my JSON-LD generated API documentation and it seems to be OK – testing it with JSON-LD playground shows no issues with neither expansion nor compaction. Also framing using context found in the PHP proxy works like a charm. Also the exception message seems weird – I don’t have a code listed in the message in my document.
 
Is there a chance that there is an issue in PHP JSON-LD API used in the proxy?
 
How can I post my JSON-LD document as it’s quite huge (1000 lines nicely formatted).
 
Regards
 
Karol Szczepański




-- 
Asbjørn Ulsberg           -=|=-        asbjorn@ulsberg.no
«He's a loathsome offensive brute, yet I can't look away»

Received on Thursday, 24 September 2015 17:40:48 UTC