[tracker/wip/carlosg/json-ld-serialization: 163/165] tests: Add tests for JSON-LD serialization and deserialization
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/json-ld-serialization: 163/165] tests: Add tests for JSON-LD serialization and deserialization
- Date: Mon, 17 Oct 2022 21:50:23 +0000 (UTC)
commit 9f35fafb344925ebfa11e758166536e3f50be15a
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jul 11 20:33:21 2022 +0200
tests: Add tests for JSON-LD serialization and deserialization
tests/libtracker-sparql/deserialize/json-ld-1.jsonld | 1 +
tests/libtracker-sparql/deserialize/json-ld-1.out | 1 +
tests/libtracker-sparql/deserialize/json-ld-1.rq | 1 +
tests/libtracker-sparql/tracker-deserialize-test.c | 1 +
4 files changed, 4 insertions(+)
---
diff --git a/tests/libtracker-sparql/deserialize/json-ld-1.jsonld
b/tests/libtracker-sparql/deserialize/json-ld-1.jsonld
new file mode 100644
index 000000000..f9d5df350
--- /dev/null
+++ b/tests/libtracker-sparql/deserialize/json-ld-1.jsonld
@@ -0,0 +1 @@
+{"@context":{"nao":"http://tracker.api.gnome.org/ontology/v3/nao#","rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","nrl":"http://tracker.api.gnome.org/ontology/v3/nrl#","mfo":"http://tracker.api.gnome.org/ontology/v3/mfo#","fts":"http://tracker.api.gnome.org/ontology/v3/fts#","nmm":"http://tracker.api.gnome.org/ontology/v3/nmm#","rdfs":"http://www.w3.org/2000/01/rdf-schema#","slo":"http://tracker.api.gnome.org/ontology/v3/slo#","osinfo":"http://tracker.api.gnome.org/ontology/v3/osinfo#","nfo":"http://tracker.api.gnome.org/ontology/v3/nfo#","tracker":"http://tracker.api.gnome.org/ontology/v3/tracker#","dc":"http://purl.org/dc/elements/1.1/","nco":"http://tracker.api.gnome.org/ontology/v3/nco#","nie":"http://tracker.api.gnome.org/ontology/v3/nie#","xsd":"http://www.w3.org/2001/XMLSchema#"},"@graph":[{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Pictures","@graph":[{"@id":"file:///home/carlos","@type":"http://tracker.api.gnome.org/ontology/v3/nfo#FileDataObject"}]},{"@id
":"http://tracker.api.gnome.org/ontology/v3/tracker#Software","@graph":[{"@id":"file:///home/carlos","@type":"http://tracker.api.gnome.org/ontology/v3/nfo#FileDataObject"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Audio","@graph":[{"@id":"file:///home/carlos","@type":"http://tracker.api.gnome.org/ontology/v3/nfo#FileDataObject"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Documents","@graph":[{"@id":"file:///home/carlos","@type":"http://tracker.api.gnome.org/ontology/v3/nfo#FileDataObject"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#FileSystem","@graph":[{"@id":"file:///home/carlos","@type":"http://tracker.api.gnome.org/ontology/v3/nfo#FileDataObject"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Video","@graph":[{"@id":"file:///home/carlos","@type":"http://tracker.api.gnome.org/ontology/v3/nfo#FileDataObject"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#FileSystem","@graph":[{"@id":"file:///home/carlos","t
racker:extractorHash":"bcfdf10209a8dd3c2031a00fc8d7e4aa8f13992f0eee7321b69311e024db3c07"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Pictures","@graph":[{"@id":"file:///home/carlos","nrl:modified":"2"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Software","@graph":[{"@id":"file:///home/carlos","nrl:modified":"2"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Audio","@graph":[{"@id":"file:///home/carlos","nrl:modified":"2"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Documents","@graph":[{"@id":"file:///home/carlos","nrl:modified":"2"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#FileSystem","@graph":[{"@id":"file:///home/carlos","nrl:modified":"509"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Video","@graph":[{"@id":"file:///home/carlos","nrl:modified":"2"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Pictures","@graph":[{"@id":"file:///home/carlos","nrl:added":"2022-07-04T14:12:08
Z"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Software","@graph":[{"@id":"file:///home/carlos","nrl:added":"2022-07-04T14:12:08Z"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Audio","@graph":[{"@id":"file:///home/carlos","nrl:added":"2022-07-04T14:12:08Z"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Documents","@graph":[{"@id":"file:///home/carlos","nrl:added":"2022-07-04T14:12:08Z"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#FileSystem","@graph":[{"@id":"file:///home/carlos","nrl:added":"2022-07-04T14:12:08Z"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Video","@graph":[{"@id":"file:///home/carlos","nrl:added":"2022-07-04T14:12:08Z"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#FileSystem","@graph":[{"@id":"file:///home/carlos","nie:url":"file:///home/carlos"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Pictures","@graph":[{"@id":"file:///home/carlos","nie:interpretedAs":"urn:
fileid:/dev/mapper/luks-6fbd7095-44f6-4829-9760-fa1380f37947:5373953"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Software","@graph":[{"@id":"file:///home/carlos","nie:interpretedAs":"urn:fileid:/dev/mapper/luks-6fbd7095-44f6-4829-9760-fa1380f37947:5373953"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Audio","@graph":[{"@id":"file:///home/carlos","nie:interpretedAs":"urn:fileid:/dev/mapper/luks-6fbd7095-44f6-4829-9760-fa1380f37947:5373953"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Documents","@graph":[{"@id":"file:///home/carlos","nie:interpretedAs":"urn:fileid:/dev/mapper/luks-6fbd7095-44f6-4829-9760-fa1380f37947:5373953"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#FileSystem","@graph":[{"@id":"file:///home/carlos","nie:interpretedAs":"urn:fileid:/dev/mapper/luks-6fbd7095-44f6-4829-9760-fa1380f37947:5373953"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#Video","@graph":[{"@id":"file:///home/carlos","nie:
interpretedAs":"urn:fileid:/dev/mapper/luks-6fbd7095-44f6-4829-9760-fa1380f37947:5373953"}]},{"@id":"http://tracker.api.gnome.org/ontology/v3/tracker#FileSystem","@graph":[{"@id":"file:///home/carlos","nie:dataSource":"urn:fileid:/dev/mapper/luks-6fbd7095-44f6-4829-9760-fa1380f37947:5373953","nie:created":"2019-05-10T20:52:03Z","nie:byteSize":"28672","nfo:fileSize":"28672","nfo:fileName":"carlos","nfo:fileLastModified":"2022-06-29T17:01:08Z","nfo:fileLastAccessed":"2022-06-29T17:01:09Z","nfo:fileCreated":"2019-05-10T20:52:03Z","dc:source":"urn:fileid:/dev/mapper/luks-6fbd7095-44f6-4829-9760-fa1380f37947:5373953","dc:date":"2022-06-29T17:01:08Z"}]}]}
diff --git a/tests/libtracker-sparql/deserialize/json-ld-1.out
b/tests/libtracker-sparql/deserialize/json-ld-1.out
new file mode 100644
index 000000000..4f49c887e
--- /dev/null
+++ b/tests/libtracker-sparql/deserialize/json-ld-1.out
@@ -0,0 +1 @@
+"file:///home/carlos"
diff --git a/tests/libtracker-sparql/deserialize/json-ld-1.rq
b/tests/libtracker-sparql/deserialize/json-ld-1.rq
new file mode 100644
index 000000000..a69e8cbde
--- /dev/null
+++ b/tests/libtracker-sparql/deserialize/json-ld-1.rq
@@ -0,0 +1 @@
+SELECT ?u { GRAPH tracker:FileSystem { ?u a nfo:FileDataObject } }
diff --git a/tests/libtracker-sparql/tracker-deserialize-test.c
b/tests/libtracker-sparql/tracker-deserialize-test.c
index b378567bd..c71caa234 100644
--- a/tests/libtracker-sparql/tracker-deserialize-test.c
+++ b/tests/libtracker-sparql/tracker-deserialize-test.c
@@ -36,6 +36,7 @@ typedef struct {
TestInfo tests[] = {
{ "ttl/ttl-1", "deserialize/ttl-1.ttl", "deserialize/ttl-1.rq", "deserialize/ttl-1.out",
TRACKER_RDF_FORMAT_TURTLE },
{ "trig/trig-1", "deserialize/trig-1.trig", "deserialize/trig-1.rq", "deserialize/trig-1.out",
TRACKER_RDF_FORMAT_TRIG },
+ { "json-ld/json-ld-1", "deserialize/json-ld-1.jsonld", "deserialize/json-ld-1.rq",
"deserialize/json-ld-1.out", TRACKER_RDF_FORMAT_JSON_LD },
};
typedef struct {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]