nodeSolidServer / nodeSolidServer/node-solid-server

Blank nodes cause 500 response ("Error translating between RDF formats") when requesting JSON-LD

Open
#1,420 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.8k
Forks
308
PR merge metrics
No merged PRs in 30d

Description

Issue: When attempting to request a JSON-LD serialisation (via "Accept:application/ld+json" header) of a turtle document which includes one or more blank nodes, a 500 error is generated. An equivalent document where the blank node is replaced with a URI-identified node returns JSON-LD just fine.

Solid Version: Running on Solid 5.2.4 (current version on https://solid.community)

Expected outcome: Valid JSON-LD should be returned whether or not blank nodes are included (serialising any blank nodes as JSON objects without "@id", according to the JSON-LD spec).

Steps to reproduce

# 1: document without bnode, requested as turtle
$ http get https://musicog.solid.community/public/without_bnode.ttl
HTTP/1.1 200 OK
Content-Type: text/turtle
# ...
<http://example.com/testSubject1> <http://example.com/testPredicate><http://example.com/testSubject2> .
<http://example.com/testSubject2> <http://example.com/testPredicate2> "Example" .

# 2: document without bnode, requested as JSON-LD
$ http get https://musicog.solid.community/public/without_bnode.ttl Accept:application/ld+json
HTTP/1.1 200 OK
Content-Type: application/ld+json; charset=utf-8
# ...
[
    {
        "@id": "http://example.com/testSubject1",
        "http://example.com/testPredicate": [
            {
                "@id": "http://example.com/testSubject2"
            }
        ]
    },
    {
        "@id": "http://example.com/testSubject2",
        "http://example.com/testPredicate2": [
            {
                "@value": "Example"
            }
        ]
    }
]


# 3: document with bnode, requested as turtle
$ http get https://musicog.solid.community/public/with-bnode.ttl
HTTP/1.1 200 OK
Content-Type: text/turtle
# ...
<http://example.com/testSubject> <http://example.com/testPredicate> [ <http://example.com/testPredicate2> "Example" ] . 

# 4: document with bnode, requested as JSON-LD -> 500 error!
$ http get https://musicog.solid.community/public/with-bnode.ttl Accept:application/ld+json
HTTP/1.1 500 Internal Server Error
Content-Type: text/plain; charset=utf-8
# ... 
Error translating between RDF formats

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the two requests against with-bnode.ttl and without_bnode.ttl, using Accept:application/ld+json, and compare the responses. Trace the server's RDF-to-JSON-LD translation path from the failing request. Done means the blank-node document returns valid JSON-LD with blank nodes represented as objects without @id, rather than a 500 response.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.