Skip to content

Commit 71a38c8

Browse files
author
cimmino
committed
minor fixings
1 parent 74df5e8 commit 71a38c8

File tree

13 files changed

+13
-20
lines changed

13 files changed

+13
-20
lines changed

pom.xml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@
1414
<github.global.server>github.vicinity.distributed-query-client</github.global.server>
1515
</properties>
1616

17-
<!-- Maven repository
18-
<repositories>
19-
<repository>
20-
<id>github.vicinity.distributed-query-client</id>
21-
<url>https://github.com/vicinityh2020/vicinity-open-gateway-api-distributed-query-client/tree/maven</url>
22-
</repository>
23-
</repositories>-->
17+
2418

2519
<dependencies>
2620
<!-- Jena basic libraries (all in one): https://mvnrepository.com/artifact/org.apache.jena/apache-jena-libs -->
@@ -31,12 +25,6 @@
3125
<type>pom</type>
3226
</dependency>
3327

34-
<!-- Json -->
35-
<dependency>
36-
<groupId>org.json</groupId>
37-
<artifactId>json</artifactId>
38-
<version>20140107</version>
39-
</dependency>
4028

4129
<!-- JsonPath: https://github.com/json-path/JsonPath -->
4230
<dependency>

src/main/java/client/tmp/VicinityClientImpl.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,25 @@ public static void main(String[] args) throws UnirestException {
7373
"prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" +
7474
"prefix map: <http://iot.linkeddata.es/def/wot-mappings#> \n" +
7575
"\n" +
76-
"SELECT DISTINCT ?s WHERE {\n" + //
77-
" ?s rdf:type wot:Thing . \n" +
78-
"}";
76+
"select distinct ?thing ?clazz ?value where {\n" +
77+
" ?thing rdf:type wot:Thing .\n" +
78+
" ?thing core:represents ?object .\n" +
79+
" ?object rdf:type ?clazz .\n" +
80+
" ?thing wot:providesInteractionPattern ?pattern .\n" +
81+
" ?pattern core:hasValue ?valueResource .\n" +
82+
//" optional { ?valueResource core:literalValue ?value .} \n" +
83+
"} LIMIT 5";
7984

8085

8186
long startTime = System.currentTimeMillis();
8287
// Retrieve from the Gateway API Services using a secured channel (datails)
8388
Map<String, String> headers = new HashMap<String, String>();
84-
//headers.put("Content-Type", "application/ld+json"); .headers(headers) /vicinity-
85-
String jsonTED = Unirest.post("http://gateway-services.vicinity.linkeddata.es/discovery").headers(headers).body(query).asString().getBody();
89+
//headers.put("Content-Type", "application/ld+json"); .headers(headers) /vicinity- advanced-discovery
90+
String jsonTED = Unirest.post("http://localhost:8081/advanced-discovery?neighbors=dXBtLXd-lYXRoZX-Itc2VydmljZQ").headers(headers).body(query).asString().getBody();
8691
System.out.println(">"+jsonTED);
8792
Set<String> neighbours = new HashSet<String>();
8893
// production CERTH
89-
neighbours.add("c8269833-578d-42c0-814c-1b24d644b350");
94+
/*neighbours.add("c8269833-578d-42c0-814c-1b24d644b350");
9095
neighbours.add("6967e210-e1e8-4a1d-9fd8-4a40cd8df41b");
9196
neighbours.add("3d3bcd90-27cc-4f07-91d6-f76d36c789c1");
9297
// Dev
@@ -119,7 +124,7 @@ public static void main(String[] args) throws UnirestException {
119124
neighbours.add("34730b62-097a-4bde-a298-e0bcbcab2bd1");
120125
neighbours.add("6f7b08b2-fd41-4037-870a-a530cf14b9ae");
121126
neighbours.add("4f75dd67-9bc1-41db-be2c-7e1829dd4d48");
122-
neighbours.add("636c2fde-50d4-4fb2-9fa0-d758591d19b0");
127+
neighbours.add("636c2fde-50d4-4fb2-9fa0-d758591d19b0");*/
123128
// Our vas
124129
neighbours.add("dXBtLXd-lYXRoZX-Itc2VydmljZQ");
125130
// -- Init the client
0 Bytes
Binary file not shown.
6 Bytes
Binary file not shown.
-55 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
-990 Bytes
Binary file not shown.
84 Bytes
Binary file not shown.
-41 Bytes
Binary file not shown.
-6 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)