I'm getting errors when I'm trying to post jsonld, version 1.1. Is it a bug or v1.1 is just not supported?
Right now, I convert it to the turtle format before posting, but would be great if I can post jsonld without any extra steps.
import json
import requests
from requests.auth import HTTPBasicAuth
STARDOG_USER, STARDOG_PASS = ....
graph_endpoint = ...
headers = {'Content-Type': 'application/ld+json'}
json_v11 = '''
{
"@context": {
"@version": 1.1,
"skos": "http://www.w3.org/2004/02/skos/core#",
"labels": "@nest",
"main_label": {"@id": "skos:prefLabel"},
"other_label": {"@id": "skos:altLabel"},
"homepage": {"@id": "http://schema.org/description", "@type": "@id"}
},
"@id": "http://example.org/myresource",
"homepage": "http://example.org",
"labels": {
"main_label": "This is the main label for my resource",
"other_label": "This is the other label"
}
}
'''
response = requests.post(url=graph_endpoint, data=json_v11, headers=headers, auth=HTTPBasicAuth(STARDOG_USER, STARDOG_PASS))
print(response.status_code, response.content)
# 400 b'{"message":"Could not parse JSONLD: invalid term definition: 1.1","code":"QEIVR2"}'