项目作者: joerndigital

项目描述 :
Question Answering System for Chess Games
高级语言: Java
项目地址: git://github.com/joerndigital/semanticchess.git
创建时间: 2017-06-02T12:35:57Z
项目社区:https://github.com/joerndigital/semanticchess

开源协议:GNU General Public License v3.0

下载


Semantic Chess

A question answering system for chess games. The engine will try to answer all chess questions, if the information can be found in a PGN file. Therefore, the questions must include players, events, locations, (annual) dates, ECO, openings, ELO ratings, results and/or moves. In the benchmark you find some sample questions.




Example gif




Prerequisite


You need:



  • Java 8

  • Docker (for the database)

  • Maven



Installing



  • download the project

  • run Docker

  • start the database



sh $ cd src/main/database $ docker-compose up

The next commands must be executed in the folder with the pom.xml. If you already loaded data to the database just start the engine with the 4th command. At the first launch perform the following steps.

1. Convert the PGN file to RDF data (in this project you can find 1610-1899.pgn as an example):

  1. $ mvn spring-boot:run -Drun.arguments="pgn"

2. Map the chess openings to the games (optional! the mapping files already exist for 1610-1899.pgn):

  1. $ mvn spring-boot:run -Drun.arguments="eco"

Virtuoso is not stable when running the mapping process.
It crashes randomly. Therefore, you can manually split the mapping process.
If Virtuoso crashes, first load the mapping you already have with step 3. Then start again at the point where the program stopped.

For example, if it stopped in the ECO group starting with the letter ‘A’, start again with:

  1. $ mvn spring-boot:run -Drun.arguments="eco,A"

You can choose a letter from A to E. You have to start the process for every letter after the crash. So, if it crashes at ‘C’, you have to manually start ‘C’, ‘D’ and ‘E’. Don’t forget to load (Step 3) at first after the crash.

3. Load the RDF files to the Virtuoso database:

  1. $ mvn spring-boot:run -Drun.arguments="load"

4. Start the engine:

  1. $ mvn spring-boot:run

Note

The conversion from PGN to RDF and the mapping of the chess openings to the chess games take some time.

Use

Prefixes


If you want to use the SPARQL editor on http://localhost/8080, note that the following prefixes are already in use:

sh PREFIX ex: <http://example.com> PREFIX res: <http://example.com/res></http:> PREFIX prop: <http://example.com/prop></http:> PREFIX cres: <http://pcai042.informatik.uni-leipzig.de/~swp13-sc/ChessOntology/Resources></http:> PREFIX cont: <http://pcai042.informatik.uni-leipzig.de/~swp13-sc/ChessOntology#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

PGN Viewer

PgnViewerJS by mliebelt

The PGN viewer is embedded by links from cdn.rawgit.com:

If you want to include the files directly into the Semantic Chess project, go to http://mliebelt.github.io/PgnViewerJS/docu/index.html
and download the current version. After that insert the unzipped directory to

  1. /semanticchess/src/main/webapp/static

and uncomment line 13 and 35 in

  1. /semanticchess/src/main/webapp/public/index.html

Credits

Frontend:

Backend: