query-978030469108775cc573618a11280dca

rq turtle/ttl

My solution. (P1687)Wikidata property and the nodes are colored if the item uses (P10568)maintains linking to or any of its subclasses, edges between nodes exist if the nodes are linked through (Q55341040)video game database The following query is my solution for the user. This query shows a graph where the nodes are instances of (i.e. under the terminology of subject-predicate-object, the starting node is the subject and the ending node is the object). (P10568)maintains linking to or any of its subclasses. Also, the edges have the same direction of the uses of (Q55341040)video game database The difference between the logic of this query and that of the query shared by the user is that this query omit those items that are not instances of

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Graph
SELECT ?item ?itemLabel ?linkTo ?linkToLabel ?rgb
{
   {
  SELECT * {
     {
  SELECT DISTINCT ?item ?linkTo {
    ?item
      wdt:P31/wdt:P279* wd:Q55341040;
      wdt:P10568 ?linkTo.
    ?linkTo wdt:P31/wdt:P279* wd:Q55341040.
  }
}
    # By using OPTIONAL, we make sure that this query also return
    # those rows that don't have a value for ?rgb. That is, those
    # items that don't use Wikidata property (P1687).
    #
    # If optional weren't used, then we would be finding the
    # intersection between %0 and %1, which would be only video game
    # databases that have Wikidata property (P1687)
    OPTIONAL{ {
  SELECT DISTINCT ?item ("FFA500" AS ?rgb) {
    INCLUDE %0.
    ?item wdt:P1687 [].
  }
}}.
  }
}
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en".
    ?item rdfs:label ?itemLabel.
    ?linkTo rdfs:label ?linkToLabel.
  }
}

Query found at