Skip to content

Commit f8218bc

Browse files
committed
update.
1 parent d758c2f commit f8218bc

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

demo/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ pip3 install -r requirements.txt
77
python3 app.py
88
```
99

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+
1018
## gStore Connection Config
1119

1220
Please modify the `gStore_config` variable to connect to your gStore database.
@@ -48,7 +56,7 @@ python3 app.py
4856

4957
Example SPARQL
5058
```sparql
51-
SELECT ?img ?x ?y ?h ?w ?dog_obj WHERE {
59+
SELECT ?img ?x ?y ?h ?w ?dog_obj WHERE {
5260
?dog_obj <hasName> "dog"^^<http://www.w3.org/2001/XMLSchema#string>.
5361
?cat_obj <hasName> "cat"^^<http://www.w3.org/2001/XMLSchema#string>.
5462
?dog_obj ?mm.sim ?cat_obj.
@@ -64,7 +72,7 @@ SELECT ?img ?x ?y ?h ?w ?dog_obj WHERE {
6472

6573
Converted SPARQL
6674
```sparql
67-
SELECT ?img ?x ?y ?h ?w ?dog_obj WHERE {
75+
SELECT ?img ?x ?y ?h ?w ?dog_obj WHERE {
6876
?dog_obj <hasName> "dog"^^<http://www.w3.org/2001/XMLSchema#string>.
6977
?img <hasObject> ?dog_obj.
7078
?dog_obj <x> ?x.

parser/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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+

rdf-vg/README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
11
# RDF-VG Builder
22

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).

0 commit comments

Comments
 (0)