Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pub:ontology [2019/09/19 19:27] (current)
kkutt created
Line 1: Line 1:
 +====== Game Design Patterns ontology ======
 +
 +If you would like to use the ontology for your research, please contact [[bgc@agh.edu.pl|Barbara Gi┼╝ycka]].
 +
 +==== Based on "​Patterns In Game Design"​ handbook by Staffan Bjork and Jussi Holopainen ====
 +
 +[[https://​drive.google.com/​open?​id=1iLQ-plTexMF6lNwbqQtngNK81kTU3gfp|Ontology in .OWL]]
 +
 +===== Description =====
 +
 +Ontology has only one class: **GDP** (**G**ame **D**esign **P**attern). All patterns are instances of this class.
 +
 +Following properties are used in ontology:
 +  * **rdfs:​label** -- name of the pattern
 +  * **rdfs:​comment** -- description of the pattern
 +  * **:​example** -- usage of the pattern taken from real game
 +  * **:​instantiated_by**,​ **:​instantiates** -- relations between two patterns
 +  * **:​modulated_by**,​ **:​modulates** -- relations between two patterns
 +  * **:​potentially_conflicting_with** -- relations between two patterns
 +
 +=====  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 ====
 +
 +<​code>​
 +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) )
 +}
 +</​code>​
 +**Result:** *TRUE* *(= Yes, there are conflicts in given set)*  ​
 +To see actual conflicts, change `ASK` into `SELECT *`}
 +
 +==== Query 1.B ====
 +
 +
 +<​code>​
 +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) )
 +}
 +</​code>​
 +
 +**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 ====
 +
 +<​code>​
 +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) )
 +}
 +</​code>​
 +
 +**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.
 +
 +<​code>​
 +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)
 +</​code>​
 +
 +==== Query 3.B other relations ====
 +
 +Note: as above...
 +
 +<​code>​
 +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)
 +</​code>​
 +
 +==== Query 3.C other relations AND checked in two ways (?sub ?rel ?obj AND ?obj ?rel ?subj) ====
 +
 +
 +Note: as above...
 +
 +<​code>​
 +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)
 +</​code>​
  
  • pub/ontology.txt
  • Last modified: 2019/09/19 19:27
  • by kkutt