Skip to content

Commit

Permalink
Fix NodeMapBuilder active subject - issue #198
Browse files Browse the repository at this point in the history
  • Loading branch information
filip26 committed Dec 12, 2021
1 parent 8e31e6a commit a791089
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public Flattening ordered(boolean ordered) {
public JsonArray flatten() throws JsonLdError {

// 1.
NodeMap nodeMap = new NodeMap();
final NodeMap nodeMap = new NodeMap();

// 2.
NodeMapBuilder.with(element, nodeMap).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ public NodeMap build() throws JsonLdError {
.referencedNode(referenced)
.activeProperty(entry.getKey())
.build();

}
}

Expand Down Expand Up @@ -411,7 +410,6 @@ public NodeMap build() throws JsonLdError {
.activeGraph(activeGraph)
.activeSubject(id)
.activeProperty(property)
.referencedNode(referencedNode)
.build();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"@context" : "issue198-context.json",
"data": {
"allFactSheets": {
"edges": [
Expand Down
76 changes: 46 additions & 30 deletions src/test/resources/com/apicatalog/jsonld/test/issue198-out.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,57 @@
{
"@graph": [
{
"@id": "_:b0",
"https://adidas-dev.collibra.com/ignore": {
[
{
"@id": "_:b0",
"https://adidas-dev.collibra.com/ignore": [
{
"@id": "_:b1"
}
},
{
"@id": "http://leanix.net/338b1d1d-617d-4ee4-b79f-dee72e265831",
"@type": "https://adidas-dev.collibra.com/00000000-0000-0000-0000-000000031026",
"https://adidas-dev.collibra.com/displayname": {
]
},
{
"@id": "http://leanix.net/338b1d1d-617d-4ee4-b79f-dee72e265831",
"@type": [
"https://adidas-dev.collibra.com/00000000-0000-0000-0000-000000031026"
],
"https://adidas-dev.collibra.com/displayname": [
{
"@type": "xsd:string",
"@value": "IT Landscape Meta Data"
}
},
{
"@id": "http://leanix.net/9a8fb137-0a53-4c95-adbb-d9f8bd27b2bc",
"@index": "edges",
"@type": "https://adidas-dev.collibra.com/1099a85a-48c4-4d34-996e-07f63bc0034e",
"https://adidas-dev.collibra.com/to": {
]
},
{
"@id": "http://leanix.net/9a8fb137-0a53-4c95-adbb-d9f8bd27b2bc",
"@index": "edges",
"@type": [
"https://adidas-dev.collibra.com/1099a85a-48c4-4d34-996e-07f63bc0034e"
],
"https://adidas-dev.collibra.com/to": [
{
"@id": "http://leanix.net/338b1d1d-617d-4ee4-b79f-dee72e265831"
}
},
{
"@id": "http://leanix.net/ec254751-86be-4b7d-82b8-b716bedb87ce",
"@index": "edges",
"@type": "http://leanix.net/Application",
"https://adidas-dev.collibra.com/assets_in_domain_relation": {
"@id": "_:b1"
},
"https://adidas-dev.collibra.com/displayname": {
]
},
{
"@id": "http://leanix.net/ec254751-86be-4b7d-82b8-b716bedb87ce",
"@index": "edges",
"@type": [
"http://leanix.net/Application"
],
"https://adidas-dev.collibra.com/displayname": [
{
"@type": "xsd:string",
"@value": "#MYBEST"
},
"https://adidas-dev.collibra.com/relates": {
}
],
"https://adidas-dev.collibra.com/relates": [
{
"@id": "http://leanix.net/9a8fb137-0a53-4c95-adbb-d9f8bd27b2bc"
}
}
]
}
],
"https://adidas-dev.collibra.com/assets_in_domain_relation": [
{
"@id": "_:b1"
}
]
}
]
3 changes: 1 addition & 2 deletions src/test/resources/com/apicatalog/jsonld/test/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,11 @@
"option": { "useNativeTypes": true }
},
{
"@id": "#t0013",
"@id": "#t0014",
"@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
"name": "Issue #198: @reverse in @context",
"input": "issue198-in.json",
"expect": "issue198-out.json",
"frame": "issue198-frame.json",
"option": { "expandContext" : "issue198-context.json", "base": "http://leanix.net/" }
}
]
Expand Down

0 comments on commit a791089

Please sign in to comment.