Skip to content

Commit

Permalink
0.4.1 - Fix error in JSON serializer for RDF content, literal values …
Browse files Browse the repository at this point in the history
…properly serialized.
  • Loading branch information
enridaga committed Sep 27, 2018
1 parent f5dea60 commit afcc7f6
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion basil/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>basil</groupId>
<artifactId>parent</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<relativePath>../parent</relativePath>
</parent>
<artifactId>basil</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>basil</groupId>
<artifactId>parent</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<relativePath>../parent</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>basil</groupId>
<artifactId>parent</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<packaging>pom</packaging>

<name>BASIL :: Parent</name>
Expand All @@ -24,7 +24,7 @@
<org.eclipse.jetty.version>9.3.0.v20150612</org.eclipse.jetty.version>

<!-- basil version -->
<basil.version>0.4.0</basil.version>
<basil.version>0.4.1</basil.version>

<!-- github server corresponds to entry in ~/.m2/settings.xml -->
<github.global.server>github</github.global.server>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>basil</groupId>
<artifactId>parent</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<relativePath>parent</relativePath>
</parent>
<name>BASIL :: Reactor</name>
Expand Down
2 changes: 1 addition & 1 deletion rendering/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>basil</groupId>
<artifactId>parent</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<relativePath>../parent</relativePath>
</parent>
<artifactId>rendering</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,14 @@ public String render(MediaType type, String graphName, Map<String, String> pref)
}
}
p.append(">");
p.append(n.toString());
if (n.isBlank()) {
p.append(n.getBlankNodeLabel());
} else if (n.isURI()) {
p.append(n.getURI());
} else {
// Literal
p.append(n.getLiteralLexicalForm());
}
p.append("</");
p.append(v);
p.append(">");
Expand Down Expand Up @@ -195,7 +202,18 @@ public String render(MediaType type, String graphName, Map<String, String> pref)
JsonObject item = new JsonObject();
item.add("subject", new JsonPrimitive(t.getSubject().toString()));
item.add("predicate", new JsonPrimitive(t.getPredicate().toString()));
item.add("object", new JsonPrimitive(t.getObject().toString()));

String ostring;
if (t.getObject().isBlank()) {
ostring = t.getObject().getBlankNodeLabel();
} else if (t.getObject().isURI()) {
ostring = t.getObject().getURI();
} else {
// Literal
ostring = t.getObject().getLiteralLexicalForm();
}
item.add("object", new JsonPrimitive(ostring));

item.add("subject_type", new JsonPrimitive(t.getSubject().isBlank() ? "bnode" : "uri"));
item.add("object_type", new JsonPrimitive(
t.getObject().isBlank() ? "bnode" : (t.getObject().isLiteral() ? "literal" : "uri")));
Expand Down
2 changes: 1 addition & 1 deletion server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>basil</groupId>
<artifactId>parent</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<relativePath>../parent</relativePath>
</parent>
<artifactId>basil-server</artifactId>
Expand Down

0 comments on commit afcc7f6

Please sign in to comment.