Skip to content

Commit e5f29f8

Browse files
Test ability to store an RDF document with named graphs (quads) in it (#101)
* Add fixture from solid-contrib/test-suite#158 (comment) * Fix fixture name * Add new test in manifest as unreviewed * Add requirement for named graphs support in JSON-LD and TTL --------- Co-authored-by: Pete Edwards <edwardsph@users.noreply.github.com>
1 parent dc38ab5 commit e5f29f8

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Feature: RDF documents containing named graphs can be stored and retrieved
2+
3+
Background: Create a JSON-LD resource with a named graph
4+
* def testContainer = rootTestContainer.reserveContainer()
5+
* def withNamedGraphsJson = karate.readAsString('../fixtures/with-named-graphs.json')
6+
* def resource = testContainer.createResource('.json', withNamedGraphsJson, 'application/ld+json');
7+
* def expected = parse(withNamedGraphsJson, 'application/ld+json')
8+
* configure headers = clients.alice.getAuthHeaders('GET', resource.url)
9+
* url resource.url
10+
11+
Scenario: Alice can GET the JSON-LD with named graph as JSON-LD
12+
Given header Accept = 'application/ld+json'
13+
When method GET
14+
Then status 200
15+
And match header Content-Type contains 'application/ld+json'
16+
And assert parse(response, 'application/ld+json', resource.url).contains(expected)
17+
18+
Scenario: Alice can GET the JSON-LD with named graph as TTL
19+
Given header Accept = 'text/turtle'
20+
When method GET
21+
Then status 200
22+
And match header Content-Type contains 'text/turtle'
23+
And assert parse(response, 'text/turtle', resource.url).contains(expected)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"@context": { "ex": "http://example.org/ns/" },
3+
"@id": "ex:test",
4+
"@type": "ex:Graph",
5+
"@graph": {
6+
"@id": "ex:naughty",
7+
"@type": "ex:Trial"
8+
}
9+
}

protocol/solid-protocol-test-manifest.ttl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ manifest:content-negotiation-jsonld
6060
spec:testScript
6161
<https://github.com/solid-contrib/specification-tests/blob/main/protocol/content-negotiation/content-negotiation-jsonld.feature> .
6262

63+
manifest:content-negotiation-named-graphs
64+
a td:TestCase ;
65+
spec:requirementReference sopr:server-representation-turtle-jsonld ;
66+
td:reviewStatus td:unreviewed ;
67+
spec:testScript
68+
<https://github.com/solid-contrib/specification-tests/blob/main/protocol/content-negotiation/content-negotiation-named-graphs.feature> .
69+
6370
manifest:uri-assignment
6471
a td:TestCase ;
6572
spec:requirementReference sopr:server-put-patch-uri-assignment ;

0 commit comments

Comments
 (0)