text-graph-generalization

Code for our paper Compositional Generalization with Grounded Language Models
git clone https://esimon.eu/repos/text-graph-generalization.git
Log | Files | Refs | README | LICENSE

download_data.md (1966B)


      1 # Download and process data
      2 
      3 This document how to download, compile and run the LUBM UBA Generator in
      4 order to generate the graph data used in this paper.
      5 
      6 ### Requirements
      7 
      8 The UBA requires a valid Java installation. To check for availability, you
      9 can run: `javac --version`. If not available, please download the
     10 [JDK](https://www.oracle.com/java/technologies/downloads/).
     11 
     12 ### Step 1
     13 
     14 Download the generator from the official [LUBM website](https://swat.cse.lehigh.edu/projects/lubm/).
     15 The results in this paper used the UBA 1.7.
     16 
     17 Make a folder in the project root, `uba`, and deflate the zip there.
     18 
     19 As an option, we provide a script that downloads and extracts UBA 1.7 into
     20 the correct folder structure in `download_data.sh`. However, we cannot
     21 guarantee that this will work indefinitely.
     22 
     23 ### Step 2
     24 
     25 The next step is to compile the UBA.
     26 
     27 `cd` into `/uba/src/edu/lehigh/swat/bench/uba`
     28 
     29 The `Generator.java` uses backslashes, \\, when generating the files. If
     30 your OS does not, you have to open this file and replace these with forward
     31 slashes. There are two occurences that you need to swap. Failure to do so
     32 does not really cause any errors right away but may cause great mental pain
     33 later down the line.
     34 
     35 After this replacement, you can compile the program with:
     36 
     37 `javac -d ../../../../../../ *.java`
     38 
     39 This will create the folder `edu` inside `project_root/uba`.
     40 
     41 ### Step 3
     42 
     43 Now it is time to generate the graphs.
     44 
     45 `cd` into `project_root/uba`.
     46 
     47 The generator can be run using:
     48 
     49 `java edu.lehigh.swat.bench.uba.Generator -univ <value> -index <value> -seed <value> -daml -onto <value>`
     50 
     51 To reproduce our settings, run:
     52 
     53 `java edu.lehigh.swat.bench.uba.Generator -univ 360 -index 0 -seed 0 -onto http://swat.cse.lehigh.edu/onto/univ-bench.owl`
     54 
     55 This will generate approximately 14k `.owl` graphs in the `uba` folder.
     56 
     57 Organize them using:
     58 
     59 ```
     60 cd project_root/uba/
     61 mkdir ../raw_graphs/
     62 mv *.owl ../raw_graphs/
     63 ```
     64 
     65 Now you have all the raw graphs available.