Skip to content

Commit 4a81bd3

Browse files
author
ANDREA CIMMINO ARRIAGA
committed
pom updated
1 parent 2d80943 commit 4a81bd3

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>es.upm.fi.oeg</groupId>
55
<artifactId>wothive</artifactId>
6-
<version>0.1.5</version>
6+
<version>0.1.6</version>
77
<name>Directory for the Web of Things</name>
88

99
<properties>

src/main/java/directory/Utils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class Utils {
3131
public static final String METHOD_PUT = "PUT";
3232

3333
public static final String MIME_DIRECTORY_ERROR = "application/problem+json";
34-
protected static final String DIRECTORY_VERSION = "WoTHive/0.1.5";
34+
protected static final String DIRECTORY_VERSION = "WoTHive/0.1.6";
3535
protected static final String WOT_DIRECTORY_LOGO = "\n"+
3636
"██╗ ██╗ ██████╗ ████████╗\n" +
3737
"██║ ██║██╔═══██╗╚══██╔══╝\n" +

src/main/java/directory/things/ThingsDAO.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public static Boolean create(Thing thing, String graphId, Boolean exist) {
3535
Boolean correct = false;
3636
String query = null;
3737
ThingsMapper.syntacticValidation(thing);
38+
if(!thing.getId().contains(":"))
39+
thing.setId("id:"+thing.getId());
3840

3941
String thingRDF = ThingsMapper.thingToRDFWithValidation(thing, RDFFormat.NTRIPLES);
4042
query = Utils.buildMessage("\nINSERT DATA { GRAPH <",graphId,"> { \n",thingRDF,"} }");

src/main/java/directory/things/ThingsMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static Thing createJsonThing(String td) {
6464
try {
6565
JsonObject thingJson = JTD.parseJson(td);
6666

67-
if (!thingJson.has(ID1) || thingJson.has(ID2))
67+
if (!thingJson.has(ID1) || !thingJson.has(ID2))
6868
throw new ThingRegistrationException(
6969
"Things under the form application/td+json registered using PUT method must provide a valid 'id', otherwhise se the POST method for Things without 'id'");
7070
thing = Thing.fromJson(thingJson);

0 commit comments

Comments
 (0)