Table of Contents

Game Design Patterns ontology

If you would like to use the ontology for your research, please contact Barbara Giżycka.

Based on "Patterns In Game Design" handbook by Staffan Bjork and Jussi Holopainen

Ontology in .OWL

Description

Ontology has only one class: GDP (Game Design Pattern). All patterns are instances of this class.

Following properties are used in ontology:

Use Cases

UC.1. Check for conflicts in given set of patterns

List of patterns to check have to be specified in IN() clauses. It must be given twice (for `?subject` and for `?object`).

Query 1.A

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX gdp: <https://geist.re/gdp#>
ASK {
    ?subject  gdp:potentially_conflicting_with  ?object .
    FILTER(?subject  IN(gdp:conflict, gdp:uncertainty_of_information, gdp:alignment) )
    FILTER(?object  IN(gdp:conflict, gdp:uncertainty_of_information, gdp:alignment) )
}

Result: *TRUE* *(= Yes, there are conflicts in given set)* To see actual conflicts, change `ASK` into `SELECT *`}

Query 1.B

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX gdp: <https://geist.re/gdp#>
ASK {
    ?subject  gdp:potentially_conflicting_with  ?object .
    FILTER(?subject  IN(gdp:conflict, gdp:self-facilitated_games, gdp:ability_losses) )
    FILTER(?object  IN(gdp:conflict, gdp:self-facilitated_games, gdp:ability_losses) )
}

Result: *FALSE* *(= No, there are no conflicts in given set)*

UC.2. Check for conflicts in given set of patterns (using `instantiated_by` relation)

Query 2.A

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX gdp: <https://geist.re/gdp#>
ASK {
    {
        ?subject  gdp:instantiated_by  ?instantiated_by_object .
        ?instantiated_by_object  gdp:potentially_conflicting_with  ?object
    } UNION {  
        ?subject  gdp:potentially_conflicting_with  ?object
    }

    FILTER(?subject  IN(gdp:conflict, gdp:self-facilitated_games, gdp:ability_losses) )
    FILTER(?instantiated_by_object  NOT IN(gdp:conflict, gdp:self-facilitated_games, gdp:ability_losses) )
    FILTER(?object  IN(gdp:conflict, gdp:self-facilitated_games, gdp:ability_losses) )
}

Result: *TRUE* *(= Yes, there are conflicts in given set)*

UC.3. Select all items that are in given relation with our set of patterns

Query 3.A `instantiates`

Note: The query is looking for everything that is in the `instantiates` relationship. But for us enough is just one such thing for each of our patterns.

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX gdp: <https://geist.re/gdp#>
SELECT ?subject
WHERE {
    ?subject  gdp:instantiates  ?object.
    FILTER( ?object IN(gdp:conflict, gdp:uncertainty_of_information, gdp:alignment, gdp:preventing_goals) )
    FILTER( ?subject NOT IN(gdp:conflict, gdp:uncertainty_of_information, gdp:alignment, gdp:preventing_goals) )
}
GROUP BY (?subject)

Query 3.B other relations

Note: as above…

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX gdp: <https://geist.re/gdp#>
SELECT ?subject
WHERE {
    ?subject  gdp:instantiated_by | gdp:modulated_by | gdp:modulates  ?object.
    FILTER( ?object IN(gdp:conflict, gdp:uncertainty_of_information, gdp:alignment, gdp:preventing_goals) )
    FILTER( ?subject NOT IN(gdp:conflict, gdp:uncertainty_of_information, gdp:alignment, gdp:preventing_goals) )
}
GROUP BY (?subject)

Query 3.C other relations AND checked in two ways (?sub ?rel ?obj AND ?obj ?rel ?subj)

Note: as above…

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX gdp: <https://geist.re/gdp#>
SELECT ?subject
WHERE {
    {
        ?subject  gdp:instantiated_by | gdp:modulated_by | gdp:modulates  ?object.
    } UNION {
        ?object  gdp:instantiates | gdp:modulated_by | gdp:modulates  ?subject.
    }
    FILTER( ?object IN(gdp:conflict, gdp:uncertainty_of_information, gdp:alignment, gdp:preventing_goals) )
    FILTER( ?subject NOT IN(gdp:conflict, gdp:uncertainty_of_information, gdp:alignment, gdp:preventing_goals) )
}
GROUP BY (?subject)