Knowledge engineering and representation - Semantic Web and Ontology development

This project was entirely made using Protege Open Source Ontology Editor and Knowledge-base Framework.
You can download the project files here.

The chosen subject of my ontology, is the game of chess and more specifically chess openings and variants. We tried to build this concept in a way that information and knowledge would be represented better and our ontology could find practical use in the semantic web. This ontology could be used as an opening explorer for general purpose, containing information about openings (sequence of moves, variants, literature information, etc.). Even though various databases exist, none of them uses semantic reasoning to present its bytes of knowledge and most of them are closed to public or sold as a software.
In this effort, we tried to include all the principal elements that could help us to define a chess game and its openings. For this purpose we used the example of French Defense (opening and variants).
Therefore defining a chess move (class) as a part of (property) a sequence (class) of moves and vice versa (sequence consists (property) of at least 2 moves) we made the first step into the game. Afterwards, i set a relationship between openings and variations saying that a chess opening (class), may lead (property) to some variation (class) of it. Followed the two above definitions we defined Openings and Variations as a recognized (property), in the meaning of documented, named sequence of moves. Also an opening has been played by (property), played for the first or "invented" by some chess player (class), usually a grand master. In this case we gave the examples of two individuals, S. Tarrasch and S. Winawer by settings their competitive years as datatype properties. My concept at this time needed some basic information concerning the Algebraic Notation (class) system that is used to describe (property) a chess move (therefore a chess move is described by Algebraic notation) and the ECO Code (class) system that is used functional (maximum 1) to classify (property) the numerous chess openings and variations. So every move, move sequence, opening and variation could be described (property) by the Algebraic notation, that is similar to a recognized (property) named sequence of moves. To end we have added some alternative (sub-class) to the name (class) of some openings and variations. In order to demonstrate our ontology's capabilities we used French Defense opening.
Even though my ontology's structure may seem simple enough, we have managed to create a complete knowledge system by matching Openings with possible Variations followed by ECO Codes and providing for each one of them the proper move Sequence, as pointed out in figure 1.




OntoViz Graph Figure 1.


We also tested with success our ontology's consistency with Pellet 1.5.2 reasoning tool and launched some SPARQL request with success.  Furthermore, inside the ontology we provided additional text written information on almost each one of the basic elements of the studied concept. This project was implemented in English with the excuse that logic, knowledge representation and acquisition systems, are similar and independent of natural language constraints, even though best results were achieved by this choice.

Here is an example of the XML/RDF source code illustrating some basic elements of this Ontology.


<owl:Class rdf:ID="ECO_Code">
        <rdfs:comment xml:lang="en"
            >ECO stands for Encyclopedia of Chesss Openings, a reference work containing theory tables, opening trees and algebraic notation.</rdfs:comment>
    </owl:Class>
    <Variation rdf:ID="French_Advance_Variation">
        <is_classified rdf:resource="#C02"/>
        <is_described rdf:resource="#Sequence_1.e4_e6_2.d4_d5_3.e5_c5_4.c3_Nc6_5.Nf3_Qb6_6.a3"/>
    </Variation>
    <Opening rdf:ID="French_Classical">
        <is_classified rdf:resource="#C13"/>
        <may_lead rdf:resource="#French_Classical_Variation"/>
    </Opening>
    <Variation rdf:ID="French_Classical_Variation">
        <is_classified rdf:resource="#C14"/>
    </Variation>
    <Opening rdf:ID="French_Defense">
        <is_classified rdf:resource="#C11"/>
        <is_described rdf:resource="#Sequence_1e4_e6"/>
        <may_lead rdf:resource="#French_Exchange_Variation"/>
        <may_lead rdf:resource="#French_MacCutcheon_Variation"/>
        <may_lead rdf:resource="#French_Paulsen_Variation"/>
    </Opening>
    <Name rdf:ID="French_Defense_System">
        <is_classified rdf:resource="#C00"/>
        <rdfs:comment xml:lang="en"
            >French Defense System is a general value and C00 also is
.</rdfs:comment>
    </Name>
    <Variation rdf:ID="French_Exchange_Variation">
        <is_classified rdf:resource="#C01"/>
        <is_described rdf:resource="#Sequence_1.e4_e6_2.d4_d5_3.exd5"/>
    </Variation>
    <Alternative_name rdf:ID="French_Kingston_Defense">
        <is_classified rdf:resource="#C01"/>
    </Alternative_name>
    <Variation rdf:ID="French_MacCutcheon_Variation">
        <is_classified rdf:resource="#C12"/>
    </Variation>
    <Alternative_name rdf:ID="French_Nimzovich_Variation">
        <is_classified rdf:resource="#C15"/>
    </Alternative_name>
    <Variation rdf:ID="French_Paulsen_Variation">
        <is_classified rdf:resource="#C10"/>
        <is_described rdf:resource="#Sequence_1.e4_e6_2.d4_d5_3.e5_c5_4.c3_Nc6_5.Nf3"/>
    </Variation>
    <Opening rdf:ID="French_Tarrasch">
        <is_classified rdf:resource="#C03"/>
        <is_described rdf:resource="#Sequence_1.e4_e6_2.d4_d5_3.Nd2"/>
        <may_lead rdf:resource="#French_Tarrasch_Closed_Variation"/>
        <may_lead rdf:resource="#French_Tarrasch_Closed_Variation_Main_line"/>
    </Opening>
    <Variation rdf:ID="French_Tarrasch_Closed_Variation">
        <is_classified rdf:resource="#C05"/>
        <is_described rdf:resource="#Sequence_1.e4_e6_2.d4_d5_3.Nd2_Nf6"/>
    </Variation>
    <Variation rdf:ID="French_Tarrasch_Closed_Variation_Main_line">
        <is_classified rdf:resource="#C06"/>
        <is_described rdf:resource="#Sequence_1.e4_e6_2.d4_d5_3.Nd2_Nf6_4.e5_Nfd7_5.Bd3_c5_6.c3_Nc6_7.Ne2_cxd4_8.cxd4"/>
    </Variation>
    <Opening rdf:ID="French_Tarrasch_Guimar_Main_line">
        <is_classified rdf:resource="#C04"/>
    </Opening>
    <Opening rdf:ID="French_Tarrasch_Open_4.exd4_exd5">
        <is_classified rdf:resource="#C08"/>
        <may_lead rdf:resource="#French_Tarrasch_Open_Variation"/>
        <may_lead rdf:resource="#French_Tarrasch_Open_Variation_Main_line"/>
    </Opening>
    <Variation rdf:ID="French_Tarrasch_Open_Variation">
        <is_classified rdf:resource="#C07"/>
    </Variation>
    <Variation rdf:ID="French_Tarrasch_Open_Variation_Main_line">
        <is_classified rdf:resource="#C09"/>
    </Variation>
    <Opening rdf:ID="French_Winawer_Advance_6...Ne7">
        <is_classified rdf:resource="#C19"/>
        <may_lead rdf:resource="#French_Winawer_Advance_Variation"/>
        <may_lead rdf:resource="#French_Winawer_Advance_Variation1"/>
        <may_lead rdf:resource="#French_Winawer_Advance_Variation2"/>
        <may_lead rdf:resource="#French_Winawer_Variation"/>
    </Opening>
    <Variation rdf:ID="French_Winawer_Advance_Variation">
        <is_classified rdf:resource="#C18"/>
        <is_described rdf:resource="#Sequence_1.e4_e6_2.d4_d5_3.Nc3_Bb4_4.e5"/>
    </Variation>
    <Variation rdf:ID="French_Winawer_Advance_Variation1">
        <is_classified rdf:resource="#C16"/>
    </Variation>
    <Variation rdf:ID="French_Winawer_Advance_Variation2">
        <is_classified rdf:resource="#C17"/>
    </Variation>
    <Variation rdf:ID="French_Winawer_Variation">
        <is_classified rdf:resource="#C15"/>
        <is_described rdf:resource="#Sequence_1.e4_e6_2.d4_d5_3.Nc3_Bb4_4.e5_c5_5.a3_Bxc3check_6.bxc3_Ne7_7.Qg4"/>
    </Variation>
    <owl:ObjectProperty rdf:ID="is_classified">
        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
        <rdfs:domain>
            <owl:Class>
                <owl:unionOf rdf:parseType="Collection">
                    <owl:Class rdf:about="#Name"/>
                    <owl:Class rdf:about="#Opening"/>
                    <owl:Class rdf:about="#Variation"/>
                </owl:unionOf>
            </owl:Class>
        </rdfs:domain>
        <rdfs:range rdf:resource="#ECO_Code"/>
    </owl:ObjectProperty>
    <owl:ObjectProperty rdf:ID="is_considered">
        <rdfs:domain rdf:resource="#Move"/>
        <rdfs:range rdf:resource="#Opening"/>
    </owl:ObjectProperty>
    <owl:ObjectProperty rdf:ID="is_described">
        <rdfs:domain>
            <owl:Class>
                <owl:unionOf rdf:parseType="Collection">
                    <owl:Class rdf:about="#Move"/>
                    <owl:Class rdf:about="#Opening"/>
                    <owl:Class rdf:about="#Sequence"/>
                    <owl:Class rdf:about="#Variation"/>
                </owl:unionOf>
            </owl:Class>
        </rdfs:domain>
        <owl:inverseOf rdf:resource="#describes"/>
        <rdfs:range rdf:resource="#Algebraic_notation"/>
    </owl:ObjectProperty>
    <owl:ObjectProperty rdf:ID="is_part">
        <rdfs:domain rdf:resource="#Move"/>
        <rdfs:range rdf:resource="#Sequence"/>
    </owl:ObjectProperty>
    <owl:ObjectProperty rdf:ID="is_recognized">
        <rdfs:domain>
            <owl:Class>
                <owl:unionOf rdf:parseType="Collection">
                    <owl:Class rdf:about="#Opening"/>
                    <owl:Class rdf:about="#Variation"/>
                </owl:unionOf>
            </owl:Class>
        </rdfs:domain>
        <rdfs:range rdf:resource="#Sequence"/>
    </owl:ObjectProperty>
    <owl:ObjectProperty rdf:ID="may_lead">
        <rdfs:domain rdf:resource="#Opening"/>
        <rdfs:range rdf:resource="#Variation"/>
    </owl:ObjectProperty>
    <owl:Class rdf:ID="Move">
        <rdfs:comment xml:lang="en"
            >A move in chess, practically means that both players (black&amp;white) are 
obliged to move pieces on board, their goal is to win and to do so they 
have to capture opponents pieces and pawns.</rdfs:comment>
    </owl:Class>
    <owl:Class rdf:ID="Name">
        <rdfs:comment rdf:datatype="&xsd;string"></rdfs:comment>
    </owl:Class>
    <owl:Class rdf:ID="Opening">
        <rdfs:comment xml:lang="en"
            >Similar to sequence, an opening is a group of initial moves of a chess game. Oxford Companion to Chess lists  approximately 1,330 known openings and variants. Openings have names (ex. Ruy Lopez), are recognized move sequences and may lead to other openings named &quot;Variants&quot;.</rdfs:comment>
    </owl:Class>




1 comment:

  1. Blogs are so informative where we get lots of information on any topic. Nice job keep it up!!Spoken English Pakistan

    ReplyDelete


Free online chess

View Kapellas Nick's profile on LinkedIn
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License