Question: What is the most specific category that both Afghanistan and the Tōhoku region belong to?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?common WHERE {
  wd:Q6256 wdt:P279 * ?common .
  wd:Q207520 wdt:P279 * ?common .
  FILTER NOT EXISTS {
    ?other wdt:P279 * ?common .
    wd:Q6256 wdt:P279 * ?other .
    wd:Q207520 wdt:P279 * ?other .
    FILTER(?other != ?common)
  }
}

What common geographic classification includes both Afghanistan and the Tōhoku region?

What is the shared superclass in the Wikidata hierarchy for Afghanistan and the Tōhoku region?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q889> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q129465> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What properties are most commonly associated with Berat, and how many items are linked via each?

SELECT ?property (COUNT(?item) AS ?count) WHERE { ?item ?property wd:Q170244 . } GROUP BY ?property HAVING (?count > 1) ORDER BY DESC(?count)

Which properties connect the most entities to the city of Berat, and how many entities are connected through each?

Show me the properties that link other items to Berat, excluding those used only once, ordered by how frequently they’re used.

SELECT ?var1 ( COUNT ( ?var2 ) AS ?var3 ) WHERE { ?var2 ?var1 <http://www.wikidata.org/entity/Q170244> . OPTIONAL { ?var2 <http://www.w3.org/2000/01/rdf-schema#label> ?var4 . FILTER ( ( ( LANG ( ?var4 ) = "en" ) ) ) . } } GROUP BY ?var1 HAVING ( ( ?var3 > "1"^^<http://www.w3.org/2001/XMLSchema#integer> ) ) ORDER BY DESC( ?var3 )


Question: What is the most specific category that both Mazar-i-Sharif and Sioux Falls belong to?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?ancestor WHERE {
  wd:Q130469 wdt:P31 ?type1 .
  wd:Q131335 wdt:P31 ?type2 .
  ?type1 wdt:P279 * ?ancestor .
  ?type2 wdt:P279 * ?ancestor .
}
ORDER BY ?ancestor
LIMIT 1

What is the common superclass of the types of Mazar-i-Sharif and Sioux Falls in the Wikidata hierarchy?

What category do Mazar-i-Sharif and Sioux Falls have in common in terms of their classification?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q130469> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q131335> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What are the weigh houses labeled 'Waag' in Dutch?

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT DISTINCT ?waag WHERE {
  ?waag rdfs:label "Waag" @nl .
  ?waag wdt:P31 wd:Q1407236 .
}

Which buildings called 'Waag' in Dutch are classified as weigh houses?

List all Dutch-labeled 'Waag' buildings that are weigh houses.

SELECT DISTINCT ?var1 WHERE { ?var1 <http://www.w3.org/2000/01/rdf-schema#label> "Waag"@fr . ?var1 <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q5> . }


Question: What class do Christian Horner and Kimi Räikkönen both belong to?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?commonAncestor WHERE {
  wd:Q173472 wdt:P31 ?commonAncestor .
  wd:Q11192 wdt:P31 ?commonAncestor .
}
LIMIT 1

What is the most specific category that both Christian Horner and Kimi Räikkönen are instances of?

Find the shared type (class) of Christian Horner and Kimi Räikkönen in Wikidata.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q173472> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q11192> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most specific category that both a human and a metropolitan statistical area belong to?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?commonAncestor ( ?dist1 + ?dist2 AS ?totalDistance ) WHERE {
  {
    SELECT ?commonAncestor ( COUNT( ?mid ) AS ?dist1 ) WHERE {
      wd:Q5 wdt:P279 + ?mid .
      ?mid wdt:P279 * ?commonAncestor .
    }
    GROUP BY ?commonAncestor
  }
  {
    SELECT ?commonAncestor ( COUNT( ?mid ) AS ?dist2 ) WHERE {
      wd:Q1768043 wdt:P279 + ?mid .
      ?mid wdt:P279 * ?commonAncestor .
    }
    GROUP BY ?commonAncestor
  }
}
ORDER BY ASC ( ?totalDistance )
LIMIT 1

Which Wikidata class is the closest common ancestor of a person like Christian Horner and a place like Las Vegas Valley?

Find the highest-level concept that unifies humans and geographic regions like Las Vegas Valley, based on their classification hierarchy.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q173472> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q2624848> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: Microsoft-related entities with logo images

SELECT ?entity ?entityLabel WHERE { ?entity ?p wd:Q2283 . ?entity wdt:P154 ?logo . ?entity rdfs:label ?entityLabel . FILTER(LANG(?entityLabel) = "en") }

Which companies or products related to Microsoft have their own logo images?

List all entities connected to Microsoft that have a logo.

SELECT ?var1 ?var1Label WHERE { ?var1 ( <http://www.wikidata.org/prop/direct/> */ <http://www.wikidata.org/prop/direct/P154> *) <http://www.wikidata.org/entity/Q2283> . SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en". } }


Question: What is the most specific shared category that both Seattle and Tokyo belong to, based on their hierarchical classifications in Wikidata?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?ancestor(?distSeattle + ?distTokyo AS ?totalDistance) WHERE {
  {
    SELECT ?ancestor(COUNT(?mid) AS ?distSeattle) WHERE {
      wd:Q5083 wdt:P31 ?classSeattle .
      ?classSeattle wdt:P279 + ?mid .
      ?mid wdt:P279 * ?ancestor .
      FILTER(?ancestor != ?classSeattle)
    }
    GROUP BY ?ancestor
  }
  {
    SELECT ?ancestor(COUNT(?mid) AS ?distTokyo) WHERE {
      wd:Q1490 wdt:P31 ?classTokyo .
      ?classTokyo wdt:P279 + ?mid .
      ?mid wdt:P279 * ?ancestor .
      FILTER(?ancestor != ?classTokyo)
    }
    GROUP BY ?ancestor
  }
}
ORDER BY ASC(?totalDistance)
LIMIT 1

Which administrative category is closest to both Seattle and Tokyo when tracing their subclass relationships?

Find the common ancestor class with the minimum total distance from both Seattle and Tokyo through subclass hierarchies.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q5083> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q1490> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most specific shared superclass of Felipe Massa and Boko Haram in the Wikidata taxonomy, based on their subclass relationships?

SELECT ?commonAncestor (?dist1 + ?dist2 AS ?totalDistance)
WHERE {
  wd:Q82652 wdt:P31 ?class1 .
  wd:Q212372 wdt:P31 ?class2 .

  ?class1 wdt:P279* ?commonAncestor .
  ?class2 wdt:P279* ?commonAncestor .

  ?class1 wdt:P279 ?step1 .
  OPTIONAL { ?step1 wdt:P279 ?step2 . }
  OPTIONAL { ?step2 wdt:P279 ?step3 . }
  OPTIONAL { ?step3 wdt:P279 ?step4 . }
  OPTIONAL { ?step4 wdt:P279 ?step5 . }

  ?class2 wdt:P279 ?step1b .
  OPTIONAL { ?step1b wdt:P279 ?step2b . }
  OPTIONAL { ?step2b wdt:P279 ?step3b . }
  OPTIONAL { ?step3b wdt:P279 ?step4b . }
  OPTIONAL { ?step4b wdt:P279 ?step5b . }

  BIND(IF(BOUND(?step5), 5, IF(BOUND(?step4), 4, IF(BOUND(?step3), 3, IF(BOUND(?step2), 2, 1)))) AS ?dist1)
  BIND(IF(BOUND(?step5b), 5, IF(BOUND(?step4b), 4, IF(BOUND(?step3b), 3, IF(BOUND(?step2b), 2, 1)))) AS ?dist2)

  FILTER(BOUND(?commonAncestor))
}
GROUP BY ?commonAncestor ?dist1 ?dist2
ORDER BY ASC(?dist1 + ?dist2)
LIMIT 1

Find the entity that is the least common ancestor of Felipe Massa and Boko Haram when traversing the 'subclass of' hierarchy, and return the sum of the path lengths from each.

Which common ancestor in the Wikidata hierarchy has the shortest combined distance from both Felipe Massa and Boko Haram, considering only 'subclass of' relationships?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q82652> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q212372> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most specific common superclass of Croydon and Angela Merkel in the Wikidata ontology?

SELECT ?label WHERE { wd:Q53617407 rdfs:label ?label . FILTER(LANG(?label) = "en") }

What entity do Croydon and Angela Merkel share as their lowest common ancestor in the subclass hierarchy?

What is the common category that both Croydon (a town) and Angela Merkel (a human) belong to at the highest level of specificity?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q2213391> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q567> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most specific category that both South Korea and the Chicago Cubs belong to?

SELECT ?commonType WHERE { wd:Q884 wdt:P31 ?type1 . ?type1 wdt:P279* ?commonType . wd:Q246782 wdt:P31 ?type2 . ?type2 wdt:P279* ?commonType . } LIMIT 1

What is the common type in the hierarchy that connects South Korea and the Chicago Cubs?

What is the shared superclass of South Korea and the Chicago Cubs in Wikidata's classification system?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q884> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q246782> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: Most common types of items with freely licensed images on Wikimedia Commons

SELECT ?type ?typeLabel ?count WHERE { { SELECT ?type (COUNT(*) AS ?count) WHERE { ?item wdt:P4765 ?image ; wdt:P31 ?type . } GROUP BY ?type ORDER BY DESC(?count) LIMIT 50 } UNION { SELECT ?type (COUNT(*) AS ?count) WHERE { ?item wdt:P4765 ?image ; wdt:P279 ?type . } GROUP BY ?type ORDER BY DESC(?count) LIMIT 50 } OPTIONAL { ?type rdfs:label ?typeLabel . FILTER(LANG(?typeLabel) = "en") } } ORDER BY DESC(?count) ASC(?type)

What are the most frequent categories (instances or subclasses) of items that have a Commons-compatible image?

Show me the top 50 types of items (either instances or subclasses) that have freely usable images on Wikimedia Commons, ranked by how many such items exist.

SELECT ?var1 ?var1Label ?var2 ?var3Label WHERE { { SELECT ?var1 ( COUNT (* ) AS ?var2 )( <http://www.wikidata.org/entity/P31> AS ?var3 ) WHERE { ?var4 <http://www.wikidata.org/prop/direct/P4765> ?var5 ; <http://www.wikidata.org/prop/direct/P31> ?var1 . } GROUP BY ?var1 ORDER BY DESC( ?var2 ) LIMIT 50 } UNION { SELECT ?var1 ( COUNT (* ) AS ?var2 )( <http://www.wikidata.org/entity/P279> AS ?var3 ) WHERE { ?var4 <http://www.wikidata.org/prop/direct/P4765> ?var5 ; <http://www.wikidata.org/prop/direct/P279> ?var1 . } GROUP BY ?var1 ORDER BY DESC( ?var2 ) LIMIT 50 } SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "de,en". } } ORDER BY DESC( ?var2 )ASC( ?var1 )


Question: What is the most specific category that both Berlin and New South Wales belong to?

SELECT ?label
WHERE {
  wd:Q64 wdt:P31 ?type1 .
  wd:Q3224 wdt:P31 ?type2 .

  ?type1 wdt:P279* wd:Q107390 .
  ?type2 wdt:P279* wd:Q107390 .

  wd:Q107390 rdfs:label ?label .
  FILTER(LANG(?label) = "en")
}
LIMIT 1

What do Berlin and New South Wales have in common in terms of administrative classification?

What is the common administrative type shared by Berlin and New South Wales?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q64> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q3224> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most specific category that both Karl Marx and Ben Zobrist belong to?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?class WHERE {
  wd:Q9061 wdt:P31 ?class .
  wd:Q1061268 wdt:P31 ?class
}
LIMIT 1

Which class do Karl Marx and Ben Zobrist have in common as instances?

Find the shared type (instance of) for Karl Marx and Ben Zobrist.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q9061> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q1061268> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the least common ancestor of Karl Marx and Iceland in the Wikidata ontology, based on their class hierarchies?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?common WHERE {
  wd:Q5 wdt:P279 * ?common .
  ?i wdt:P279 * ?common .
  VALUES ?i {
    wd:Q6256 wd:Q3624078 wd:Q112099
  }
}
ORDER BY ASC(?common)
LIMIT 1

Which entity is a common superclass of both the class of Karl Marx and the class of Iceland?

Find the entity that is reachable from both Karl Marx's class and Iceland's classes via transitive subclass-of relationships.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q9061> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q189> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What categories do France and Russia have in common?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?commonClass ?label WHERE {
  wd:Q142 wdt:P31 ?commonClass .
  wd:Q159 wdt:P31 ?commonClass .
  ?commonClass rdfs:label ?label .
  FILTER ( LANG( ?label ) = "en" )
}
ORDER BY ?label

Which classes are both France and Russia instances of?

What is the most specific category that applies to both France and Russia?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q142> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q159> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most general category that both Angela Merkel and Goldman Sachs belong to?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?common WHERE {
  wd:Q567 wdt:P31 ?instance1 .
  wd:Q193326 wdt:P31 ?instance2 .
  ?instance1 wdt:P279 * ?common .
  ?instance2 wdt:P279 * ?common .
}
ORDER BY ?common
LIMIT 1

Find the highest-level class that is a superclass of any class that Angela Merkel or Goldman Sachs is an instance of.

What do Angela Merkel and Goldman Sachs have in common in terms of their Wikidata classification?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q193326> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q567> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What are the birth and death dates of Rajiv Gandhi?

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?label ?birthDate ?deathDate WHERE {
  BIND( wd:Q4593 AS ?person ) .
  ?person rdfs:label ?label .
  FILTER ( LANG( ?label ) = "en" ) .
  OPTIONAL {
    ?person wdt:P569 ?birthDate .
  }
  OPTIONAL {
    ?person wdt:P570 ?deathDate .
  }
}

When was Rajiv Gandhi born and when did he die?

Can you tell me the full name, birth date, and death date of the former Indian Prime Minister Rajiv Gandhi?

SELECT ?var1Label ?var2 ?var3 ?var4 WHERE { BIND ( <http://www.wikidata.org/entity/Q4593> AS ?var1 ). ?var1 <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q5> . OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P569> ?var3 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P570> ?var4 . } SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en". } }


Question: Walter Buch birth and death dates

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?personLabel ?birthDate ?deathDate WHERE {
  wd:Q65372 rdfs:label ?personLabel .
  FILTER(LANG(?personLabel) = "en")
  OPTIONAL {
    wd:Q65372 wdt:P569 ?birthDate .
  }
  OPTIONAL {
    wd:Q65372 wdt:P570 ?deathDate .
  }
}

When was Walter Buch born and when did he die?

Can you tell me the full name, birth date, and death date of Walter Buch?

SELECT ?var1Label ?var2 ?var3 ?var4 WHERE { BIND ( <http://www.wikidata.org/entity/Q65372> AS ?var1 ). ?var1 <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q5> . OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P569> ?var3 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P570> ?var4 . } SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en". } }


Question: What categories do Pyongyang and Brasília have in common?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?commonCategory WHERE {
  wd:Q18808 wdt:P31 ?commonCategory .
  wd:Q2844 wdt:P31 ?commonCategory .
}
ORDER BY ?commonCategory

What is the most specific category shared by Pyongyang and Brasília?

Which categories describe both Pyongyang and Brasília as instances?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q18808> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q54429> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most common administrative category shared by Pyongyang and New York City, based on their hierarchical class relationships in Wikidata?

SELECT ?class (MIN(?dist1) + MIN(?dist2) AS ?sumDist) WHERE { { SELECT ?class (COUNT(?mid1) AS ?dist1) WHERE { wd:Q18808 wdt:P31 ?start1 . ?start1 wdt:P279* ?mid1 . ?mid1 wdt:P279* ?class . } GROUP BY ?class } { SELECT ?class (COUNT(?mid2) AS ?dist2) WHERE { wd:Q60 wdt:P31 ?start2 . ?start2 wdt:P279* ?mid2 . ?mid2 wdt:P279* ?class . } GROUP BY ?class } } GROUP BY ?class ORDER BY ASC(?sumDist) LIMIT 1

Which class is the closest common ancestor in the subclass hierarchy between Pyongyang and New York City, and what is the sum of their shortest path distances to it?

Find the class that both Pyongyang and New York City are most closely related to through their instance-of and subclass relationships, ranked by total distance.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q18808> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q60> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most specific category that both Pyongyang and Paris belong to?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?commonClass ( 2 AS ?totalDistance ) WHERE {
  wd:Q18808 wdt:P31 ?commonClass .
  wd:Q90 wdt:P31 ?commonClass .
}
LIMIT 1

Which entity is the closest common ancestor in type between Pyongyang and Paris, and what is the combined distance?

What do Pyongyang and Paris have in common in terms of their classification in Wikidata?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q18808> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q90> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What are the birth and death dates of William Craven?

SELECT ?label ?birthDate ?deathDate WHERE { wd:Q8007263 wdt:P31 wd:Q5 . OPTIONAL { wd:Q8007263 wdt:P569 ?birthDate . } OPTIONAL { wd:Q8007263 wdt:P570 ?deathDate . } wd:Q8007263 rdfs:label ?label . FILTER(LANG(?label) = "en") }

Can you tell me the full name, birth date, and death date of Sir William Craven?

Who is William Craven, and when was he born and died?

SELECT ?var1Label ?var2 ?var3 ?var4 WHERE { BIND ( <http://www.wikidata.org/entity/Q8007263> AS ?var1 ). ?var1 <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q5> . OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P569> ?var3 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P570> ?var4 . } SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en". } }


Question: Birth and death dates of Ananias Dekke

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?label ?birthDate ?deathDate WHERE {
  wd:Q16062279 rdfs:label ?label .
  FILTER ( LANG( ?label ) = "en" ) OPTIONAL {
    wd:Q16062279 wdt:P569 ?birthDate .
  }
  OPTIONAL {
    wd:Q16062279 wdt:P570 ?deathDate .
  }
}

When was Ananias Dekke born and when did he die?

Please provide the birth and death dates of Ananias Dekke.

SELECT ?var1Label ?var2 ?var3 ?var4 WHERE { BIND ( <http://www.wikidata.org/entity/Q16062279> AS ?var1 ). ?var1 <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q5> . OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P569> ?var3 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P570> ?var4 . } SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en". } }


Question: What is the most specific common category (in the subclass hierarchy) shared by FC Energiya Volzhsky and Hawaiian Airlines?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?ancestor ( ?dist1 + ?dist2 AS ?total_distance ) WHERE {
  {
    SELECT ?ancestor ( COUNT( ?mid ) AS ?dist1 ) WHERE {
      wd:Q1975949 wdt:P31 ?class1 .
      ?class1 wdt:P279 + ?mid .
      ?mid wdt:P279 * ?ancestor .
    }
    GROUP BY ?ancestor
  }
  {
    SELECT ?ancestor ( COUNT( ?mid ) AS ?dist2 ) WHERE {
      wd:Q642610 wdt:P31 ?class2 .
      ?class2 wdt:P279 + ?mid .
      ?mid wdt:P279 * ?ancestor .
    }
    GROUP BY ?ancestor
  }
}
ORDER BY ASC ( ?total_distance )
LIMIT 1

Which legal entity class is the closest common ancestor of FC Energiya Volzhsky and Hawaiian Airlines when tracing their subclass relationships?

Find the entity that is the lowest common superclass of a football club and an airline, based on their Wikidata classifications.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q1975949> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q642610> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What are the most specific types shared by Brazil and Russia?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?commonClass ?label WHERE {
  wd:Q155 wdt:P31 ?commonClass .
  wd:Q159 wdt:P31 ?commonClass .
  ?commonClass rdfs:label ?label .
  FILTER(LANG(?label) = "en")
  FILTER NOT EXISTS {
    ?otherCommonClass wdt:P279 * ?commonClass .
    FILTER(?otherCommonClass != ?commonClass)
    .
    wd:Q155 wdt:P31 ?otherCommonClass .
    wd:Q159 wdt:P31 ?otherCommonClass .
  }
}
ORDER BY ?label

What classes are both Brazil and Russia instances of, and which of these are the most specific?

List the lowest-level categories that both Brazil and Russia belong to.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q159> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q155> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What are the categories (types) that Angola and South Wales belong to in Wikidata?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?entity ?type ?typeLabel WHERE {
  VALUES ?entity {
    wd:Q916 wd:Q1286223
  }
  ?entity wdt:P31 ?type .
  ?type rdfs:label ?typeLabel .
  FILTER ( LANG( ?typeLabel ) = "en" )
}
ORDER BY ?entity ?typeLabel

Can you list the types associated with Angola and South Wales?

Do Angola and South Wales share any category in Wikidata’s classification system?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q916> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q1286223> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: Early Modern Letters Online (EMLO) persons with birthplace coordinates, birth year, and images.

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?label ?bornYear ?image(SAMPLE(?coord_temp) AS ?coord) ?emloUri WHERE {
  ?person wdt:P1802 ?emloId ; wdt:P19 ?birthPlace ; rdfs:label ?label .
  FILTER(LANGMATCHES(LANG(?label) , "en"))
  .
  ?birthPlace wdt:P625 ?coord_temp .
  OPTIONAL {
    ?person wdt:P569 ?birthDate .
    BIND(CONCAT("Born " , STR(YEAR(?birthDate))) AS ?bornYear)
  }
  OPTIONAL {
    ?person wdt:P18 ?image .
  }
  BIND(IRI(CONCAT("https://emlo.bodleian.ox.ac.uk/person/" , ?emloId)) AS ?emloUri)
}
GROUP BY ?label ?image ?emloId ?bornYear ?emloUri

Who are the people listed in the Early Modern Letters Online project, where were they born, when were they born, and do they have images or birthplace coordinates?

Provide a list of individuals from the Early Modern Letters Online database with their English names, birth years (if known), birthplace coordinates, images (if available), and links to their EMLO profiles.

SELECT ?var1 ?var2 ?var3 ( SAMPLE ( ?var4 ) AS ?var4 )( IRI ( CONCAT ( "string1", ?var5 ) ) AS ?var6 ) WHERE { ?var7 <http://www.wikidata.org/prop/direct/P1802> ?var5 ; <http://www.wikidata.org/prop/direct/P19> ?var8 ; <http://www.w3.org/2000/01/rdf-schema#label> ?var1 . FILTER ( ( ( LANG ( ?var1 ) = "en" ) ) ) . ?var8 <http://www.wikidata.org/prop/direct/P625> ?var4 . OPTIONAL { ?var7 <http://www.wikidata.org/prop/direct/P569> ?var9 . } BIND ( CONCAT ( "Born ", STR ( YEAR ( ?var9 ) ) ) AS ?var2 ). OPTIONAL { ?var7 <http://www.wikidata.org/prop/direct/P18> ?var3 . } } GROUP BY ?var1 ?var3 ?var5 ?var2


Question: Birth and death dates of William Cavendish-Bentinck, 7th Duke of Portland

SELECT ?personLabel ?birthDate ?deathDate WHERE { BIND( wd:Q335583 AS ?person ) . OPTIONAL { ?person wdt:P569 ?birthDate . } OPTIONAL { ?person wdt:P570 ?deathDate . } ?person rdfs:label ?personLabel . FILTER(LANG(?personLabel) = "en") }

When was William Cavendish-Bentinck, 7th Duke of Portland, born and when did he die?

Can you tell me the birth and death dates of the 7th Duke of Portland, along with his full name?

SELECT ?var1Label ?var2 ?var3 ?var4 WHERE { BIND ( <http://www.wikidata.org/entity/Q335583> AS ?var1 ). ?var1 <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q5> . OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P569> ?var3 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P570> ?var4 . } SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en". } }


Question: What country is both Berlin and Angela Merkel associated with?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?country WHERE {
  wd:Q64 wdt:P17 ?country .
  wd:Q567 wdt:P39 ?position .
  ?position wdt:P17 ?country .
}

Which country is the capital city of Berlin and the former chancellor Angela Merkel linked to?

Find the country that Angela Merkel served as chancellor of and that Berlin is the capital of.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q64> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q567> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most general category that both Equifax and Matthew C. Perry belong to?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?commonSuperclass WHERE {
  BIND( wd:Q35120 AS ?commonSuperclass ) wd:Q5384453 wdt:P31 ?type1 .
  wd:Q61855 wdt:P31 ?type2 .
  ?type1 wdt:P279 * ?commonSuperclass .
  ?type2 wdt:P279 * ?commonSuperclass .
}

What is the common superclass in the Wikidata hierarchy between Equifax Inc. and Commodore Matthew Perry?

Are there any shared categories in the subclass hierarchy connecting Equifax and Matthew C. Perry?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q5384453> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q61855> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most general category that both SpaceX and Kimi Räikkönen belong to, based on their types and their hierarchical relationships?

SELECT ?common (?dist1 + ?dist2 AS ?totalDist) WHERE { { SELECT ?common (MIN(?steps1) AS ?dist1) WHERE { { wd:Q193701 wdt:P31 ?common . BIND(0 AS ?steps1) } UNION { wd:Q193701 wdt:P31 ?t1 . ?t1 wdt:P279 ?common . BIND(1 AS ?steps1) } UNION { wd:Q193701 wdt:P31 ?t1 . ?t1 wdt:P279 ?t2 . ?t2 wdt:P279 ?common . BIND(2 AS ?steps1) } UNION { wd:Q193701 wdt:P31 ?t1 . ?t1 wdt:P279 ?t2 . ?t2 wdt:P279 ?t3 . ?t3 wdt:P279 ?common . BIND(3 AS ?steps1) } UNION { wd:Q193701 wdt:P31 ?t1 . ?t1 wdt:P279 ?t2 . ?t2 wdt:P279 ?t3 . ?t3 wdt:P279 ?t4 . ?t4 wdt:P279 ?common . BIND(4 AS ?steps1) } } GROUP BY ?common } { SELECT ?common (MIN(?steps2) AS ?dist2) WHERE { { wd:Q11192 wdt:P31 ?common . BIND(0 AS ?steps2) } UNION { wd:Q11192 wdt:P31 ?t1 . ?t1 wdt:P279 ?common . BIND(1 AS ?steps2) } UNION { wd:Q11192 wdt:P31 ?t1 . ?t1 wdt:P279 ?t2 . ?t2 wdt:P279 ?common . BIND(2 AS ?steps2) } UNION { wd:Q11192 wdt:P31 ?t1 . ?t1 wdt:P279 ?t2 . ?t2 wdt:P279 ?t3 . ?t3 wdt:P279 ?common . BIND(3 AS ?steps2) } UNION { wd:Q11192 wdt:P31 ?t1 . ?t1 wdt:P279 ?t2 . ?t2 wdt:P279 ?t3 . ?t3 wdt:P279 ?t4 . ?t4 wdt:P279 ?common . BIND(4 AS ?steps2) } } GROUP BY ?common } } ORDER BY ?totalDist LIMIT 1

Which entity in Wikidata's type hierarchy is closest to both SpaceX and Kimi Räikkönen when measuring the sum of shortest paths through subclass relationships?

Find the common superclass with the minimum total distance from both SpaceX and Kimi Räikkönen, traversing from their types up the subclass hierarchy.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q193701> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q11192> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most general category that includes both Angola and business oligarch in the Wikidata hierarchy?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?commonSuperclass WHERE {
  wd:Q916 wdt:P31 ?type1 .
  ?type1 wdt:P279 * ?commonSuperclass .
  wd:Q2006045 wdt:P279 * ?commonSuperclass .
}
ORDER BY ?commonSuperclass
LIMIT 1

What is the highest-level class that both Angola (as a country) and business oligarch (as an occupation) belong to?

What do Angola and business oligarch have in common in terms of their classification in Wikidata?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q916> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q2006045> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is Ed Sheeran's date of birth and when did he die?

SELECT ?personLabel ?birthDate ?deathDate WHERE { BIND( wd:Q47447 AS ?person ) . OPTIONAL { ?person wdt:P569 ?birthDate . } OPTIONAL { ?person wdt:P570 ?deathDate . } ?person rdfs:label ?personLabel . FILTER(LANG(?personLabel) = "en") }

Can you tell me Ed Sheeran's full name, when he was born, and if he has passed away?

SELECT ?var1Label ?var2 ?var3 ?var4 WHERE { BIND ( <http://www.wikidata.org/entity/Q17332387> AS ?var1 ). ?var1 <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q5> . OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P569> ?var3 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P570> ?var4 . } SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en". } }


Question: What is the most specific shared category that both London and Houston belong to, based on their hierarchical classification in Wikidata?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?ancestor ( ?distLondon + ?distHouston AS ?totalDistance ) WHERE {
  {
    SELECT ?ancestor ( COUNT( ?mid ) AS ?distLondon ) WHERE {
      wd:Q84 wdt:P31 ?classLondon .
      ?classLondon wdt:P279 + ?mid .
      ?mid wdt:P279 * ?ancestor .
    }
    GROUP BY ?ancestor
  }
  {
    SELECT ?ancestor ( COUNT( ?mid ) AS ?distHouston ) WHERE {
      wd:Q16555 wdt:P31 ?classHouston .
      ?classHouston wdt:P279 + ?mid .
      ?mid wdt:P279 * ?ancestor .
    }
    GROUP BY ?ancestor
  }
}
ORDER BY ASC ( ?totalDistance )
LIMIT 1

Which administrative classification is closest to both London and Houston when tracing their subclass relationships?

Find the common ancestor in the subclass hierarchy of London and Houston with the smallest total distance from both.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q84> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q16555> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most specific shared superclass in the Wikidata ontology between the human Hannah Arendt and the airline Hawaiian Airlines?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?common ?commonLabel WHERE {
  wd:Q5 wdt:P279 * ?common .
  wd:Q46970 wdt:P279 * ?common .
  ?common rdfs:label ?commonLabel .
  FILTER(LANG(?commonLabel) = "en")
}
ORDER BY ?commonLabel
LIMIT 1

What category do Hannah Arendt and Hawaiian Airlines both belong to in the Wikidata hierarchy?

Find the closest common ancestor in the subclass tree for Hannah Arendt and Hawaiian Airlines.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q60025> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q642610> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most general category that both Hannah Arendt and the Arizona Cardinals belong to?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?common ?commonLabel WHERE {
  wd:Q60025 wdt:P31 ?type1 .
  wd:Q224164 wdt:P31 ?type2 .
  ?type1 wdt:P279 * ?common .
  ?type2 wdt:P279 * ?common .
  ?common rdfs:label ?commonLabel .
  FILTER(LANG(?commonLabel) = "en")
}
ORDER BY ASC(STRLEN(STR(?common)))
LIMIT 1

Which entity is the common superclass in the taxonomy of Hannah Arendt and the Arizona Cardinals?

Find the least specific shared category between the philosopher Hannah Arendt and the American football team Arizona Cardinals.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q60025> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q224164> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most specific category that both Hannah Arendt and Croydon belong to, based on their classifications in Wikidata?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?commonSuperclass WHERE {
  wd:Q60025 wdt:P31 ?class1 .
  wd:Q2213391 wdt:P31 ?class2 .
  ?class1 wdt:P279 * ?commonSuperclass .
  ?class2 wdt:P279 * ?commonSuperclass .
  FILTER ( ?commonSuperclass != wd:Q35120 )
}
ORDER BY ASC ( ?commonSuperclass )
LIMIT 1

What do Hannah Arendt and the town of Croydon have in common in terms of their ontological class hierarchy?

Find the lowest common superclass in the Wikidata ontology for the human Hannah Arendt and the town Croydon.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q60025> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q2213391> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What are the birth and death dates of the Canadian writer Austin Clarke?

SELECT ?label ?birthDate ?deathDate WHERE { wd:Q320358 rdfs:label ?label . FILTER(LANG(?label) = "en") . OPTIONAL { wd:Q320358 wdt:P569 ?birthDate . } OPTIONAL { wd:Q320358 wdt:P570 ?deathDate . } }

Can you tell me when Austin Clarke was born and when he died?

Provide the full name, date of birth, and date of death for Austin Clarke.

SELECT ?var1Label ?var2 ?var3 ?var4 WHERE { BIND ( <http://www.wikidata.org/entity/Q320358> AS ?var1 ). ?var1 <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q5> . OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P569> ?var3 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P570> ?var4 . } SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en". } }


Question: What is the most specific administrative category that both Tokyo and Louisiana belong to?

SELECT ?commonAncestor (?distTokyoType + ?distLouisianaType AS ?totalDist)
WHERE {
  {
    SELECT ?commonAncestor (COUNT(?mid) AS ?distTokyoType)
    WHERE {
      wd:Q1490 wdt:P31 ?typeTokyo .
      ?typeTokyo wdt:P279+ ?mid .
      ?mid wdt:P279* ?commonAncestor .
    }
    GROUP BY ?commonAncestor
  }
  {
    SELECT ?commonAncestor (COUNT(?mid) AS ?distLouisianaType)
    WHERE {
      wd:Q1588 wdt:P31 ?typeLouisiana .
      ?typeLouisiana wdt:P279+ ?mid .
      ?mid wdt:P279* ?commonAncestor .
    }
    GROUP BY ?commonAncestor
  }
}
ORDER BY ?totalDist
LIMIT 1

How many subclass steps away is the closest shared category between Tokyo and Louisiana, and what is it?

Find the common superclass in the Wikidata hierarchy with the smallest total distance from both Tokyo and Louisiana.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q1490> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q1588> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the shared category between John Legend and Bruce Arians?

SELECT ?common ?commonLabel WHERE { wd:Q44857 wdt:P31 ?common . wd:Q4046340 wdt:P31 ?common . ?common rdfs:label ?commonLabel . FILTER(LANG(?commonLabel) = "en") }

What is the most specific class that both John Legend and Bruce Arians belong to?

What do John Legend and Bruce Arians have in common in terms of their Wikidata classification?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q44857> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q4046340> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What country is both Bruce Arians a citizen of and Louisiana a part of?

SELECT ?country WHERE { wd:Q4046340 wdt:P27 ?country . wd:Q1588 wdt:P17 ?country . }

Which country links Bruce Arians and Louisiana through citizenship and territorial affiliation?

What is the common country associated with American football coach Bruce Arians and the state of Louisiana?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q4046340> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q1588> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What are the hierarchical categories of Islamism and the organizational types of the Taliban?

SELECT ?category ?type WHERE { { wd:Q189746 wdt:P279 ?category . BIND("superclass of Islamism" AS ?type) } UNION { wd:Q42418 wdt:P31 ?category . BIND("type of Taliban" AS ?type) } } ORDER BY ?category

Are Islamism and the Taliban related through shared categories in Wikidata?

Show the superclass relationships of Islamism and the instance types of the Taliban.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q189746> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q42418> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most specific category that both Barbados and France belong to?

SELECT ?commonType ?commonTypeLabel WHERE { wd:Q244 wdt:P31 ?commonType . wd:Q142 wdt:P31 ?commonType . ?commonType rdfs:label ?commonTypeLabel . FILTER(LANG(?commonTypeLabel) = "en") } ORDER BY ?commonTypeLabel LIMIT 1

What type do Barbados and France have in common?

What is the shared classification of Barbados and France in Wikidata?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q244> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q142> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most specific category that both Rihanna and Likud belong to?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?commonClass ?commonClassLabel WHERE {
  wd:Q36844 wdt:P31 ?type1 .
  ?type1 wdt:P279 * ?commonClass .
  wd:Q187009 wdt:P31 ?type2 .
  ?type2 wdt:P279 * ?commonClass .
  ?commonClass rdfs:label ?commonClassLabel .
  FILTER(LANG(?commonClassLabel) = "en")
}
ORDER BY ?commonClassLabel
LIMIT 1

What is the highest-level classification that includes both Rihanna and the Likud political party?

Find the common superclass in the Wikidata hierarchy that connects Rihanna and Likud.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q36844> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q187009> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What categories do both a human and a sovereign state belong to in the Wikidata ontology?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?commonSuperclass WHERE {
  wd:Q5 wdt:P279 * ?commonSuperclass .
  wd:Q3624078 wdt:P279 * ?commonSuperclass .
}
ORDER BY ?commonSuperclass

What is the most specific shared superclass between a person like Rihanna and a country like Panama?

Which ontological class includes both humans and sovereign states as subclasses?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q36844> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q804> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most specific category that both Honolulu and Seoul belong to in the Wikidata taxonomy?

SELECT ?ancestor ?ancestorLabel WHERE { wd:Q18094 wdt:P31 ?hType1 . ?hType1 wdt:P279 ?hType2 . ?hType2 wdt:P279 ?ancestor . wd:Q8684 wdt:P31 ?sType1 . ?sType1 wdt:P279 ?sType2 . ?sType2 wdt:P279 ?ancestor . ?ancestor rdfs:label ?ancestorLabel . FILTER(LANG(?ancestorLabel) = "en") }

What do Honolulu and Seoul have in common in terms of their type hierarchy?

Find the shared superclass of Honolulu and Seoul by tracing their instance-of relationships up two levels.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q18094> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q8684> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most specific category that both Honolulu and Cologne belong to?

SELECT ?class WHERE { wd:Q18094 wdt:P31 ?class . wd:Q365 wdt:P31 ?class . } LIMIT 1

Which class is shared by both Honolulu and Cologne as their instance?

Find the common type (category) that includes both Honolulu and Cologne.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q18094> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q365> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: Cities within 100 km of latitude 31, longitude -88 with their counties, states, images, and Wikipedia links.

PREFIX schema: <http://schema.org/>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
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#>
SELECT DISTINCT ?city ?cityLabel ?districtLabel ?regionLabel ?image ?wikipediaUrl ?latitude ?longitude WHERE {
  ?city ( wdt:P31 / wdt:P279 * ) wd:Q515 .
  ?city wdt:P625 ?coord .
  BIND( geof:latitude ( ?coord ) AS ?latitude ) BIND( geof:longitude ( ?coord ) AS ?longitude ) FILTER ( ?latitude >= 30.1 && ?latitude <= 31.9 ) FILTER ( ?longitude >= -89.05 && ?longitude <= -86.95 ) ?city wdt:P18 ?image .
  ?city wdt:P131 ?district .
  ?district wdt:P131 ?region .
  OPTIONAL {
    ?city rdfs:label ?cityLabel .
    FILTER ( LANG( ?cityLabel ) = "en" )
  }
  OPTIONAL {
    ?district rdfs:label ?districtLabel .
    FILTER ( LANG( ?districtLabel ) = "en" )
  }
  OPTIONAL {
    ?region rdfs:label ?regionLabel .
    FILTER ( LANG( ?regionLabel ) = "en" )
  }
  ?wikipediaUrl schema:about ?city ; schema:inLanguage "en" ; schema:isPartOf <https://en.wikipedia.org/> .
}
ORDER BY ASC ( ?city )
LIMIT 5

What are the cities near Mobile, Alabama (around 31°N, 88°W), and what are their administrative regions, images, and English Wikipedia pages?

Show me up to five cities within 100 kilometers of the coordinates 31°N, 88°W, including their district, state, image, and English Wikipedia link.

SELECT DISTINCT ?var1 ?var1Label ?var2Label ?var3Label ?var4 ?var5 ?var6 ?var7 ?var8 ?var9 WHERE { SERVICE <http://wikiba.se/ontology#around> { ?var1 <http://www.wikidata.org/prop/direct/P625> ?var10 . <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#center> "POINT(-88 31)"^^<http://www.opengis.net/ont/geosparql#wktLiteral> . <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#radius> "100". <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#distance> ?var9 . } FILTER ( ( ( ?var9 > "2"^^<http://www.w3.org/2001/XMLSchema#integer> ) ) ) . { ?var1 ( <http://www.wikidata.org/prop/direct/P31> / <http://www.wikidata.org/prop/direct/P279> *) <http://www.wikidata.org/entity/Q515> . } { ?var1 <http://www.wikidata.org/prop/direct/P18> ?var4 . } { ?var1 <http://www.wikidata.org/prop/direct/P131> ?var3 . } { ?var3 <http://www.wikidata.org/prop/direct/P131> ?var2 . } SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en". } OPTIONAL { ?var5 <http://schema.org/about> ?var1 . ?var5 <http://schema.org/inLanguage> "en". ?var5 <http://schema.org/isPartOf> <https://en.wikipedia.org/> . } ?var1 <http://www.wikidata.org/prop/direct/P625> ?var8 . ?var1 <http://www.wikidata.org/prop/P625> ?var11 . ?var11 <http://www.wikidata.org/prop/statement/value/P625> ?var12 . ?var12 <http://wikiba.se/ontology#geoLatitude> ?var6 . ?var12 <http://wikiba.se/ontology#geoLongitude> ?var7 . } ORDER BY ASC( ?var1 ) LIMIT 5


Question: What are the Wikipedia pages about GNU Bash in different languages, and what are their language codes?

SELECT ?page ?language WHERE { BIND( wd:Q189248 AS ?bash ) . ?page schema:about ?bash . FILTER( STRSTARTS( STR(?page), "https://" ) ) . FILTER( CONTAINS( STR(?page), ".wikipedia.org" ) ) . BIND( SUBSTR( STR(?page), 9, 2 ) AS ?language ) }

List the language codes of all Wikipedia articles related to the Bash shell.

Show me the URLs and languages of Wikipedia pages that discuss GNU Bash.

SELECT ?var1 ?var2 WHERE { BIND ( <http://www.wikidata.org/entity/Q189248> AS ?var3 ). ?var1 <http://schema.org/about> ?var3 . ?var2 <http://wikiba.se/ontology#propertyType> <http://schema.org/inLanguage> . FILTER ( ( REGEX ( STR ( ?var1 ) , "string1" ) ) ) . }


Question: What is the most specific common superclass of Florida and American Airlines?

SELECT ?commonAncestor ?label WHERE { wd:Q35657 wdt:P279* wd:Q155076 . wd:Q46970 wdt:P279* wd:Q155076 . wd:Q155076 rdfs:label ?label . FILTER (LANG(?label) = "en") }

What category do both Florida and American Airlines belong to in the Wikidata taxonomy?

What is the least common ancestor in the subclass hierarchy between the U.S. state of Florida and the airline American Airlines?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q812> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q32396> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the most specific shared category between Seattle and Texas in the Wikidata hierarchy?

SELECT ?ancestor (?dist1 + ?dist2 AS ?total) ?label WHERE { wd:Q5083 wdt:P31 ?class1 . wd:Q1439 wdt:P31 ?class2 . ?class1 wdt:P279* ?ancestor . ?class2 wdt:P279* ?ancestor . OPTIONAL { ?class1 wdt:P279 ?a1 . ?a1 wdt:P279 ?a2 . ?a2 wdt:P279 ?a3 . ?a3 wdt:P279 ?a4 . ?a4 wdt:P279 ?a5 } BIND( IF(?ancestor = ?class1, 0, IF(?ancestor = ?a1, 1, IF(?ancestor = ?a2, 2, IF(?ancestor = ?a3, 3, IF(?ancestor = ?a4, 4, IF(?ancestor = ?a5, 5, 5) ) ) ) ) ) AS ?dist1 ) OPTIONAL { ?class2 wdt:P279 ?b1 . ?b1 wdt:P279 ?b2 . ?b2 wdt:P279 ?b3 . ?b3 wdt:P279 ?b4 . ?b4 wdt:P279 ?b5 } BIND( IF(?ancestor = ?class2, 0, IF(?ancestor = ?b1, 1, IF(?ancestor = ?b2, 2, IF(?ancestor = ?b3, 3, IF(?ancestor = ?b4, 4, IF(?ancestor = ?b5, 5, 5) ) ) ) ) ) AS ?dist2 ) FILTER(BOUND(?ancestor)) FILTER(?dist1 <= 5 && ?dist2 <= 5) ?ancestor rdfs:label ?label . FILTER(LANG(?label) = "en") } ORDER BY ASC(?total) LIMIT 1

Which administrative classification do both Seattle and Texas belong to, and how many steps away are they from it in the subclass tree?

Find the lowest common ancestor in the subclass hierarchy for the classes of Seattle and Texas, and compute the total distance from each to that ancestor.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q5083> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q1439> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What category do Slidell and Sioux Falls both belong to?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?commonType ?label WHERE {
  wd:Q988156 wdt:P31 ?commonType .
  wd:Q131335 wdt:P31 ?commonType .
  ?commonType rdfs:label ?label .
  FILTER(LANG(?label) = "en")
}

What is the most specific shared category that includes both Slidell and Sioux Falls?

Find the common type that both Slidell, Louisiana, and Sioux Falls, South Dakota, are instances of.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q988156> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q131335> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What country is associated with both Mike Neu and York County, Maine?

SELECT ?country WHERE { { wd:Q6848177 wdt:P27 ?country . } UNION { wd:Q6848177 wdt:P17 ?country . } { wd:Q390141 wdt:P17 ?country . } }

In which country is Mike Neu a citizen and York County located?

Which country do Mike Neu and York County, Maine, have in common?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q6848177> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q390141> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What country do Slidell and the Las Vegas Strip have in common?

SELECT ?country WHERE { wd:Q988156 wdt:P17 ?country . wd:Q745608 wdt:P17 ?country . }

In which country are both Slidell and the Las Vegas Strip located?

What is the shared country of the city of Slidell and the Las Vegas Strip?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q988156> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q745608> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: What is the common category that both Kim Jong and Palestinians belong to?

SELECT ?label
WHERE {
  wd:Q6408963 wdt:P31 wd:Q5 .
  wd:Q5 rdfs:label ?label .
  FILTER(LANG(?label) = "en")
}

What human category do Kim Jong and the Palestinian people share?

Are Kim Jong and Palestinians both considered human?

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q6408963> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q201190> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: Most specific category shared by Ben Roethlisberger and Kim Jong

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?commonClass WHERE {
  wd:Q537679 wdt:P31 ?cls1 .
  ?cls1 wdt:P279 * ?commonClass .
  wd:Q6408963 wdt:P31 ?cls2 .
  ?cls2 wdt:P279 * ?commonClass .
}
ORDER BY ?commonClass

What is the most specific type that both Ben Roethlisberger and Kim Jong belong to?

Find the most specific subclass that includes both Ben Roethlisberger and Kim Jong as instances.

SELECT ?var1 ( ( ?var2 + ?var3 ) AS ?var4 ) WHERE { SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q6408963> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var2 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } SERVICE <http://www.bigdata.com/rdf/gas#service> { <http://www.bigdata.com/rdf/gas#program> <http://www.bigdata.com/rdf/gas#gasClass> "com.bigdata.rdf.graph.analytics.SSSP"; <http://www.bigdata.com/rdf/gas#in> <http://www.wikidata.org/entity/Q537679> ; <http://www.bigdata.com/rdf/gas#traversalDirection> "Forward"; <http://www.bigdata.com/rdf/gas#out> ?var1 ; <http://www.bigdata.com/rdf/gas#out1> ?var3 ; <http://www.bigdata.com/rdf/gas#maxIterations> "10"^^<http://www.w3.org/2001/XMLSchema#integer> ; <http://www.bigdata.com/rdf/gas#linkType> <http://www.wikidata.org/prop/direct/P279> . } } ORDER BY ASC( ?var4 ) LIMIT 1


Question: List 10 humans with their English names.

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?human ?humanLabel WHERE {
  ?human wdt:P31 wd:Q5 .
  ?human rdfs:label ?humanLabel .
  FILTER ( LANG( ?humanLabel ) = "en" )
}
LIMIT 10

Who are some humans and what are their English names?

Show me 10 people along with their names in English.

SELECT ?var1 ?var1Label WHERE { ?var1 <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q5> . ?var2 <http://www.wikidata.org/prop/direct/p31> <http://www.wikidata.org/entity/Q82799> . SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en,en". } }