Skip to content

Setting up IntelliJ IDEA

Ted Thibodeau Jr edited this page Apr 5, 2022 · 1 revision

For developing DBpedia extraction-framework on Ubuntu. (The guide below was created using version 15.0 of IDEA.)

Download IDEA

  1. From http://www.jetbrains.com/idea/download/index.html download the Community version available for Ubuntu(Linux).
  2. Go the the downloaded path
  3. Unpack the idea-12.0.tar.gz file using the following command: tar -zxvf idea-12.0.tar.gz
  4. Go to the /bin sub-directory (if needed, change permission of the of idea.sh file using command chmod +x idea.sh)
  5. Run idea.sh from the bin sub-directory using command ./idea.sh

Install the Scala Plugin

On the start screen, at the top left corner: Go to Open > Settings > IDE Settings > Plugins > Browse Repositories > search for Scala > right-click on Scala > Download and install > Restart

Set up Maven

Please install Maven3. Builds with Maven2 are no longer supported.

You will need to set up M2_HOME (yes, even if it is Maven3) as an environment variable in your ~/.bashrc and/or ~/.profile, or the path to your Maven home directory in IDEA under File > Settings > Maven > Maven home directory

Checkout Code

VCS > Checkout from version control > Git > https://github.com/dbpedia/extraction-framework.git

Create project

File > New project... > Import project from external model > Maven > Root directory: $PATH_TO_DBPEDIA_EXTRACTION_FRAMEWORK_CODE

Tick "Import maven projects automatically"

Next > Next >

Please select project SDK: add Java JDK (1.7)

-> Finish

Set Run/Debug configurations

  • Run -> Edit Configurations... ->

  • click "+" -> Application -> Set the parameters for download:

    • Name: Download
    • Main class: org.dbpedia.extraction.dump.download.Download (type it yourself)
    • Program arguments: config = "your config file name" (config=download.minimal.properties for example)
    • Working directory: path-to-your-extraction-framework/extraction-framework/dump
    • Use classpath of module: dump
  • click "+" -> Application -> Set the following parameters:

    • Name: Extraction
    • Main class: org.dbpedia.extraction.dump.extract.Extraction (type it yourself)
    • Program arguments : your config file name (extraction.default.properties for example)
    • Working directory : path-to-your-extraction-framework/extraction-framework/dump
    • Use classpath of module : dump
  • click "+" -> Application -> Set the following:

    • Name: Server
    • Main class: org.dbpedia.extraction.server.Server
    • VM options: -XX:+UseConcMarkSweepGC
    • Program arguments: server configuration file (for example server.default.properties)
    • Working directory: path-to-your-extraction-framework/extraction-framework/server
    • Use classpath of module: server
  • click OK

  • Save this configuration , select it when running run or Debug from the interface next time (next to the run green button above).

Avoiding missing file errors

  • Make sure you update your paths inside your configuration files, for example, in download.minimal.properties, replace base-dir by your target folder. This step is mandatory in order to avoid errors when running the project.

  • Another step to avoid missing mapping file errors is to download those missing files. You can get them following these steps (in your extraction-framework path):

    1. cd core
    2. ../run download-mappings
    
  • Also, you could try limiting the languages to one only e.g. en instead of @mappings in your language configuration file:

    # List of languages, e.g. 'en,de,fr' or '@mappings'
    languages=@mappings
    
  • Or change the mappingsDir to something that does not exists to force downloading from the server:

    # ontology file. if it doesn't exist, load from server
    ontologyFile=../doesnotexists/ontology.xml
    
    # mappings dir. if it doesn't exist, load from server
    mappingsDir=../doesnotexists/mappings
    

Now, you are good to go!

Clone this wiki locally