File tree Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,14 @@ pip3 install -r requirements.txt
7
7
python3 app.py
8
8
```
9
9
10
+ ## Installation Preconditions
11
+
12
+ Before starting-up this demo, please make sure the gStore has been installed and started.
13
+
14
+ The gStore can be installed by following the instructions in [ gStore Installation] ( https://github.com/pkumod/gStore ) .
15
+
16
+ Besides, the RDF-VG dataset should be loaded into database before running this demo (refer to RDF-VG Builder).
17
+
10
18
## gStore Connection Config
11
19
12
20
Please modify the ` gStore_config ` variable to connect to your gStore database.
@@ -48,7 +56,7 @@ python3 app.py
48
56
49
57
Example SPARQL
50
58
``` sparql
51
- SELECT ?img ?x ?y ?h ?w ?dog_obj WHERE {
59
+ SELECT ?img ?x ?y ?h ?w ?dog_obj WHERE {
52
60
?dog_obj <hasName> "dog"^^<http://www.w3.org/2001/XMLSchema#string>.
53
61
?cat_obj <hasName> "cat"^^<http://www.w3.org/2001/XMLSchema#string>.
54
62
?dog_obj ?mm.sim ?cat_obj.
@@ -64,7 +72,7 @@ SELECT ?img ?x ?y ?h ?w ?dog_obj WHERE {
64
72
65
73
Converted SPARQL
66
74
``` sparql
67
- SELECT ?img ?x ?y ?h ?w ?dog_obj WHERE {
75
+ SELECT ?img ?x ?y ?h ?w ?dog_obj WHERE {
68
76
?dog_obj <hasName> "dog"^^<http://www.w3.org/2001/XMLSchema#string>.
69
77
?img <hasObject> ?dog_obj.
70
78
?dog_obj <x> ?x.
Original file line number Diff line number Diff line change
1
+ # VGStore parser
2
+
3
+ This is a simple implementation of a parser for the VGStore.
4
+
5
+ By this parser you can parse custom predicates and restore the standard SPARQL queries.
6
+
7
+
Original file line number Diff line number Diff line change 1
1
# RDF-VG Builder
2
2
3
- WIP
3
+ ## Introduction
4
+
5
+ This is a tool for building a RDF-stored Visual Genome dataset.
6
+
7
+ The data structure of Visual Genome is refer to [ Visual Genome Python Driver] ( https://github.com/ranjaykrishna/visual_genome_python_driver ) .
8
+
9
+ The ontology of RDF-VG is described in our paper and this repo.
10
+
11
+
12
+ ## Usage
13
+
14
+ 1 . Download the [ Visual Genome] ( https://visualgenome.org/ ) dataset and unzip it.
15
+ 2 . Install requirements: ` pip install -r requirements.txt `
16
+ 3 . Run rdf-vg builder by ` python3 process.py `
17
+ 4 . Deduplicate the triples by ` python3 clean_dup.py `
18
+
19
+ Now you are supposed to get a series of ` .nt ` files which contain the RDF triples of Visual Genome.
20
+
21
+ ## Import RDF-VG into gStore
22
+
23
+ 1 . Install gStore (refer to [ gStore] ( https://github.com/pkumod/gStore ) ).
24
+ 2 . run ` ./bin/gbuild -db vg -f xxxxx.nt ` to import RDF-VG nt triples into gStore.
25
+ 3 . Serve RDF-VG by ` ./bin/grpc -db vg -p 5001 ` .
26
+
27
+ Now you can use the RDF-VG dataset by gStore query interface (SPARQL).
You can’t perform that action at this time.
0 commit comments