... | ... | @@ -18,7 +18,7 @@ For this lab, we will only use the SPARQL part. |
|
|
The following command will start the database (you should add it to your screen):
|
|
|
|
|
|
```bash
|
|
|
ros2 run ros2_kdb kdb_server --ros-args -p db_port:=101XX
|
|
|
ros2 run ros_kdb kdb_server --ros-args -p db_port:=101XX
|
|
|
```
|
|
|
|
|
|
Replace XX with your group number. The database server is very verbose, you can generally ignore what is printed in the terminal.
|
... | ... | @@ -34,7 +34,7 @@ rm -rf $HOME/.lrs_kdb/stores/ |
|
|
The following service call will insert two objects in the graph named **salientpoints**, one human (with identifier 1) at coordinates `(8,10)` and one table (with identifier 2) at coordinates `(10,12)`:
|
|
|
|
|
|
```bash
|
|
|
ros2 service call /kdb_server/insert_triples ros2_kdb_interfaces/srv/InsertTriples "
|
|
|
ros2 service call /kdb_server/insert_triples ros_kdb_interfaces/srv/InsertTriples "
|
|
|
graphname: 'salientpoints'
|
|
|
format: 'ttl'
|
|
|
content: '@prefix gis: <http://www.ida.liu.se/~TDDE05/gis>
|
... | ... | @@ -52,7 +52,7 @@ This will insert two objects, the first has uuid `id1`, coordinate `(8,10)` and |
|
|
The following query can be used to retrieve all the elements in the database:
|
|
|
|
|
|
```bash
|
|
|
ros2 service call /kdb_server/sparql_query ros2_kdb_interfaces/srv/QueryDatabase "queries:
|
|
|
ros2 service call /kdb_server/sparql_query ros_kdb_interfaces/srv/QueryDatabase "queries:
|
|
|
- graphnames: [salientpoints]
|
|
|
format: 'json'
|
|
|
query: 'SELECT ?subject ?predicate ?object WHERE { ?subject ?predicate ?object }'"
|
... | ... | @@ -64,7 +64,7 @@ ros2 service call /kdb_server/sparql_query ros2_kdb_interfaces/srv/QueryDatabase |
|
|
The following query can be used to retrieve all the object with their class that are near the point of coordinate `(10, 12)`:
|
|
|
|
|
|
```bash
|
|
|
ros2 service call /kdb_server/sparql_query ros2_kdb_interfaces/srv/QueryDatabase "queries:
|
|
|
ros2 service call /kdb_server/sparql_query ros_kdb_interfaces/srv/QueryDatabase "queries:
|
|
|
- graphnames: ['salientpoints']
|
|
|
format: 'json'
|
|
|
query: '
|
... | ... | |