Sorry I had a post processing that broke the code, so all good.

Thanks,
Mikael


On 2.1.2018 22:49, Andy Seaborne wrote:
Because curl does magic @ or {}?

    Andy

On 02/01/18 15:59, Mikael Pesonen wrote:

Any idea what could be causing these?

I'm using curl:

     $ch = curl_init();

     curl_setopt($ch, CURLOPT_VERBOSE, 1);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
     curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANYSAFE);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLINFO_HEADER_OUT, 1);
     curl_setopt($ch, CURLOPT_HTTPHEADER, $header_a);
     curl_setopt($ch, CURLOPT_POST, 1);
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
...

     curl_close( $ch );


url is

http://<host>:3030/ds?graph=<graph>

and headers

Array
(
     [0] => Accept: */*
     [1] => Content-Type: application/ld+json
)



On 2.1.2018 17:43, Andy Seaborne wrote:
That one works for me as well with

  riot --out TTL ~/tmp/D.jsonld

==>
@prefix dc:  <http://purl.org/dc/elements/1.1/> .
@prefix dcterms:  <http://purl.org/dc/terms/> .

_:b0    dc:identifier    "1234" ;
        dcterms:subject <https://finto.fi/koko/fi/page/p57158> ;
        dcterms:subject <https://finto.fi/koko/fi/page/p57159> .

    Andy

On 02/01/18 15:06, Mikael Pesonen wrote:

Also tried with context

{
      "dc:identifier": "1234",
      "dcterms:subject": [
          "https://finto.fi/koko/fi/page/p57158";,
          "https://finto.fi/koko/fi/page/p57159";
      ],
      "@context": {
          "dc": "http://purl.org/dc/elements/1.1/";,
          "dcterms": "http://purl.org/dc/terms/";,
         "dcterms:subject":
         {
           "@id": "http://purl.org/dc/terms/subject";,
           "@type": "@id"
         }
      }
}

and getting

Error 400: Parse error: [line: 13, col: 17] Unexpected character (':' (code 58)): was expecting comma to separate Object entries


Fuseki - version 3.6.0 (Build date: 2017-12-13T21:13:34+0000)

Br,


On 2.1.2018 16:03, Andy Seaborne wrote:
Hi Mikael,

Jena v3.6.0 and several earlier versions I tried parses that input just fine. Jena use "jsonld-java".

-----------------------
@prefix dc:  <http://purl.org/dc/elements/1.1/> .
@prefix dcterms:  <http://purl.org/dc/terms/> .

_:b0    dc:identifier    "1234" ;
        dcterms:subject <https://finto.fi/koko/fi/page/p57158> ;
        dcterms:subject <https://finto.fi/koko/fi/page/p57159> .
-----------------------

which agrees with the JSON playground.

Which version are you using?

    Andy

On 02/01/18 12:36, Mikael Pesonen wrote:

Hi,

following JSON-LD insert gives error in Jena

{
     "dc:identifier": "1234",
     "dcterms:subject": [
         { "@id": "https://finto.fi/koko/fi/page/p57158"; },
         { "@id": "https://finto.fi/koko/fi/page/p57159"; }
     ],
     "@context": {
         "dc": "http://purl.org/dc/elements/1.1/";,
         "dcterms": "http://purl.org/dc/terms/";
     }
}

Error 500: Parse error: [line: 5, col: 8 ] Unexpected character (':' (code 58)): was expecting comma to separate Array entries


So in this case putting several links to dcterms:subject can't be done?

Is only way to handle this to describe datatypes in @context section? Is it possible to do automatically somehow, since Dublin Core is a well defined schema (at least should be).

{
     "dc:identifier": "1234",
     "dcterms:subject": [
         "https://finto.fi/koko/fi/page/p57158"; ,
         "https://finto.fi/koko/fi/page/p57159";
     ],
     "@context": {
         "dc": "http://purl.org/dc/elements/1.1/";,
         "dcterms": "http://purl.org/dc/terms/";
... add datatype descriptions for dcterms:subject here
     }
}

Thanks





--
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: [email protected]
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

Reply via email to