Question: What is the most closely related common category between Argentina and Silicon Valley in terms of their hierarchical classification?

SELECT ?commonClass (MIN(?distA) AS ?distFromArgentinaType) (MIN(?distSV) AS ?distFromSiliconValleyType) ((MIN(?distA) + MIN(?distSV)) AS ?totalDistance)
WHERE {
  {
    SELECT ?commonClass (COUNT(?midA) AS ?distA)
    WHERE {
      wd:Q414 wdt:P31 ?typeA .
      ?typeA wdt:P279+ ?midA .
      ?midA wdt:P279* ?commonClass .
    }
    GROUP BY ?commonClass
  }
  {
    SELECT ?commonClass (COUNT(?midSV) AS ?distSV)
    WHERE {
      wd:Q163820 wdt:P31 ?typeSV .
      ?typeSV wdt:P279+ ?midSV .
      ?midSV wdt:P279* ?commonClass .
    }
    GROUP BY ?commonClass
  }
}
GROUP BY ?commonClass
ORDER BY ASC(?totalDistance)
LIMIT 1

Which entity in Wikidata's subclass hierarchy is the shortest combined distance from both Argentina and Silicon Valley?

Find the superclass that both Argentina and Silicon Valley are most closely related to through their type hierarchies, based on the fewest subclass steps.

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/Q414> ; <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/Q163820> ; <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 concept that both Argentina and Seattle are classified under, based on their taxonomic hierarchy?

SELECT ?ancestor (?dist1 + ?dist2 AS ?totalDistance)
WHERE {
  {
    SELECT ?ancestor (COUNT(?mid) AS ?dist1)
    WHERE {
      wd:Q414 wdt:P31 ?type1 .
      ?type1 wdt:P279+ ?mid .
      ?mid wdt:P279* ?ancestor .
    }
    GROUP BY ?ancestor
  }
  {
    SELECT ?ancestor (COUNT(?mid) AS ?dist2)
    WHERE {
      wd:Q5083 wdt:P31 ?type2 .
      ?type2 wdt:P279+ ?mid .
      ?mid wdt:P279* ?ancestor .
    }
    GROUP BY ?ancestor
  }
}
ORDER BY ASC(?totalDistance)
LIMIT 1

Which legal or abstract category is approximately equally distant from Argentina and Seattle in terms of subclass relationships?

Find the common superclass of Argentina and Seattle that minimizes the total number of subclass steps 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/Q414> ; <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/Q5083> ; <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 Jerusalem and Chanhassen 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 ?commonClass ?label WHERE {
  wd:Q1218 wdt:P31 ?commonClass .
  wd:Q1992901 wdt:P31 ?cls2 .
  ?cls2 wdt:P279 * ?commonClass .
  ?commonClass rdfs:label ?label .
  FILTER ( LANG( ?label ) = "en" )
}

What class is a common ancestor of Jerusalem and Chanhassen in the Wikidata hierarchy?

Which category includes both Jerusalem and Chanhassen, and is the most specific one?

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/Q1218> ; <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/Q1992901> ; <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 superclasses of Nasturtium officinale?

SELECT ?superclass WHERE { wd:Q150452 wdt:P279 ?superclass . }

What categories does watercress belong to as a subclass?

List the plant categories that Nasturtium officinale is classified under, such as aquatic or herbaceous plants.

SELECT ?var1 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P279> <http://www.wikidata.org/entity/Q150452> . }


Question: What is the most specific category that both the Holland Tunnel and Cape Canaveral belong to?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?common WHERE {
  wd:Q125753 wdt:P31 ?c1 .
  wd:Q193401 wdt:P31 ?c2 .
  ?c1 wdt:P279 * ?common .
  ?c2 wdt:P279 * ?common .
}
ORDER BY ?common
LIMIT 1

What do the Holland Tunnel and Cape Canaveral have in common in terms of their classification in Wikidata?

Which class is a common ancestor of both the Holland Tunnel and Cape Canaveral in the Wikidata taxonomy?

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/Q125753> ; <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/Q193401> ; <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 Equifax and Newsweek belong to?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT DISTINCT ?common WHERE {
  wd:Q5384453 wdt:P31 ?c1 .
  ?c1 wdt:P279 * ?common .
  FILTER EXISTS {
    wd:Q188413 wdt:P31 ?c2 .
    ?c2 wdt:P279 * ?common
  }
  .
  FILTER NOT EXISTS {
    ?other wdt:P279 ?common .
    wd:Q5384453 wdt:P31 ?c3 .
    ?c3 wdt:P279 * ?other .
    FILTER EXISTS {
      wd:Q188413 wdt:P31 ?c4 .
      ?c4 wdt:P279 * ?other
    }
  }
}

What is the common superclass that is closest to both Equifax and Newsweek in the Wikidata hierarchy?

What is the lowest common ancestor of Equifax and Newsweek in terms of their types?

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/Q188413> ; <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 category between the Arizona Cardinals and Tesla, Inc.?

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 ?commonAncestor ?label WHERE {
  wd:Q224164 wdt:P31 ?type1 .
  ?type1 wdt:P279 * ?commonAncestor .
  wd:Q478214 wdt:P31 ?type2 .
  ?type2 wdt:P279 * ?commonAncestor .
  FILTER ( ?commonAncestor != wd:Q224164 ) FILTER ( ?commonAncestor != wd:Q478214 ) ?commonAncestor rdfs:label ?label .
  FILTER ( LANG( ?label ) = 'en' ) FILTER ( ! CONTAINS( LCASE( ?label ) , "entity" ) ) FILTER ( ! CONTAINS( LCASE( ?label ) , "continuant" ) ) FILTER ( ! CONTAINS( LCASE( ?label ) , "abstract" ) ) FILTER ( ! CONTAINS( LCASE( ?label ) , "system" ) )
}
ORDER BY ASC ( ?commonAncestor )
LIMIT 1

What is the highest-level category that both the Arizona Cardinals and Tesla, Inc. belong to?

Find the most specific shared superclass of the Arizona Cardinals and Tesla, Inc. in Wikidata's taxonomy.

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/Q224164> ; <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/Q478214> ; <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 category that both Beijing and A. J. Hinch belong to in the Wikidata ontology?

SELECT ?ancestor ?label WHERE { wd:Q956 wdt:P31 ?class1 . wd:Q2818926 wdt:P31 ?class2 . ?class1 wdt:P279* ?ancestor . ?class2 wdt:P279* ?ancestor . ?ancestor rdfs:label ?label . FILTER(LANG(?label) = 'en') } ORDER BY ?label

Find the shared superclass in the subclass hierarchy between the city of Beijing and the baseball manager A. J. Hinch.

What is the highest-level concept that both a capital city like Beijing and a human like A. J. Hinch 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/Q956> ; <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/Q2818926> ; <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 category that both Ed Schultz and Marquis Teague belong to?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?ancestor WHERE {
  wd:Q422303 wdt:P31 ?c1 .
  wd:Q1518156 wdt:P31 ?c2 .
  ?c1 wdt:P279 * ?ancestor .
  ?c2 wdt:P279 * ?ancestor .
  FILTER(?c1 = ?c2 && ?ancestor = ?c1)
}

Which class is the closest ancestor in the taxonomy that both Ed Schultz and Marquis Teague are instances of?

What is the shared class that Ed Schultz and Marquis Teague are both directly classified under?

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/Q422303> ; <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/Q1518156> ; <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 Later Zhao and Wakefield, NH?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?commonAncestor ?label WHERE {
  VALUES ?commonAncestor {
    wd:Q1048835
  }
  ?commonAncestor rdfs:label ?label .
  FILTER ( LANG( ?label ) = "en" )
}

What class do both the historical Chinese state Later Zhao and the town Wakefield, NH belong to through their class hierarchies?

What is the shared parent category in the Wikidata ontology between Later Zhao and Wakefield, NH?

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/Q2314907> ; <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/Q2430147> ; <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 the historical Chinese state Later Zhao and the International Space Station?

SELECT ?common ?label WHERE { wd:Q2314907 wdt:P31 ?class1 . wd:Q25271 wdt:P31 ?class2 . ?class1 wdt:P279* ?common . ?class2 wdt:P279* ?common . ?common rdfs:label ?label . FILTER(LANG(?label) = "en") } ORDER BY ASC(STRLEN(STR(?common))) LIMIT 1

What concept do Later Zhao and the International Space Station both belong to at the most specific level in the Wikidata taxonomy?

What is the lowest-level category that includes both a historical Chinese dynasty and a space station?

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/Q2314907> ; <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/Q25271> ; <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 closest common ancestor in the subclass hierarchy between the Philadelphia Eagles and Tesla, Inc.?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?ancestor(3 + 1 AS ?total) WHERE {
  wd:Q17156793 wdt:P279 * wd:Q43229 .
  wd:Q167037 wdt:P279 * wd:Q43229 .
  BIND(wd:Q43229 AS ?ancestor)
}
ORDER BY ASC(?total)
LIMIT 1

What organizational category do both the Philadelphia Eagles and Tesla, Inc. belong to, and what is the total number of subclass steps from each to this category?

Find the most specific shared superclass of the Philadelphia Eagles (an American football team) and Tesla, Inc. (a corporation), and calculate the sum of the subclass distances from each to this superclass.

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/Q219714> ; <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/Q478214> ; <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 the Grammy Awards and Hawaiian Airlines belong to through their types and subclass hierarchy?

SELECT ?ancestor
WHERE {
  wd:Q41254 wdt:P31 ?type1 .
  wd:Q642610 wdt:P31 ?type2 .
  ?type1 wdt:P279* ?ancestor .
  ?type2 wdt:P279* ?ancestor .
  FILTER(?ancestor = wd:Q35120)
}
LIMIT 1

Which entity is the highest common ancestor in the Wikidata taxonomy for the Grammy Awards and Hawaiian Airlines?

What is the most abstract concept that connects the Grammy Awards and Hawaiian Airlines via their 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/Q41254> ; <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 types of daifuku?

SELECT ?daifukuVariety WHERE { ?daifukuVariety wdt:P279 wd:Q1067842 . }

What are some varieties of daifuku that are classified as subclasses of daifuku?

List the known varieties of Japanese daifuku confection, such as ichigo daifuku or Yukimi Daifuku.

SELECT ?var1 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P279> <http://www.wikidata.org/entity/Q1067842> . }


Question: What is the most general concept that both CBS and the Commodity Futures Trading Commission are classified under?

SELECT ?ancestor
WHERE {
  wd:Q1254874 wdt:P279* ?ancestor .
  wd:Q1752939 wdt:P279* ?ancestor .
  FILTER NOT EXISTS { ?ancestor wdt:P279 ?child . }
}

What is the highest-level category shared by television networks and U.S. federal agencies?

What is the most abstract class that includes both CBS and the CFTC based on their types?

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/Q43380> ; <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/Q611748> ; <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 concept that both Hugh Jackman and World War II are classified under in Wikidata's taxonomy?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?ancestor(MIN(?dist1) + MIN(?dist2) AS ?totalDistance) WHERE {
  {
    SELECT ?ancestor(COUNT(?mid) AS ?dist1) WHERE {
      wd:Q129591 wdt:P31 ?type1 .
      ?type1 wdt:P279 + ?mid .
      ?mid wdt:P279 * ?ancestor .
    }
    GROUP BY ?ancestor
  }
  {
    SELECT ?ancestor(COUNT(?mid) AS ?dist2) WHERE {
      wd:Q362 wdt:P31 ?type2 .
      ?type2 wdt:P279 + ?mid .
      ?mid wdt:P279 * ?ancestor .
    }
    GROUP BY ?ancestor
  }
  FILTER(?ancestor != wd:Q129591 && ?ancestor != wd:Q362)
}
GROUP BY ?ancestor
ORDER BY ASC(?totalDistance)
LIMIT 1

Find the common superclass with the shortest total distance from the types of Hugh Jackman and World War II.

Which top-level category do Hugh Jackman and World War II share in Wikidata, 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/Q129591> ; <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/Q362> ; <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 Elon Musk and the population of Israelis belong to?

SELECT ?commonClass WHERE { wd:Q317521 wdt:P31 ?class1 . wd:Q875556 wdt:P31 ?class2 . ?class1 wdt:P279* ?commonClass . ?class2 wdt:P279* ?commonClass . } ORDER BY ?commonClass LIMIT 1

What is the highest-level class that includes both Elon Musk and Israelis?

What do Elon Musk and Israelis 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/Q875556> ; <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/Q317521> ; <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 English label and description of the entity with Great Russian Encyclopedia Online ID 4170243?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?item ?itemLabel ?description WHERE {
  ?item wdt:P2924 "4170243" .
  OPTIONAL {
    ?item schema:description ?description .
    FILTER ( LANG( ?description ) = "en" )
  }
  ?item rdfs:label ?itemLabel .
  FILTER ( LANG( ?itemLabel ) = "en" )
}

Can you tell me the name and description in English of the museum listed as entry 4170243 in the Great Russian Encyclopedia Online?

Show me the English name and description of the item identified by 4170243 in the Great Russian Encyclopedia Online (old version).

SELECT ?var1 ?var1Label ?var2 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P2924> "4170243". OPTIONAL { ?var1 <http://schema.org/description> ?var2 . FILTER ( ( ( LANG ( ?var2 ) = "en" ) ) ) . } SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en". } }


Question: What country is both Rich Dauer and Tesla, Inc. associated with?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?country WHERE {
  wd:Q7323233 wdt:P27 ?country .
  wd:Q478214 wdt:P17 ?country .
}

Which nation shares a connection with the baseball player Rich Dauer and the company Tesla?

Find the country of citizenship for Rich Dauer and the country of operation for Tesla, and return their common value.

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/Q7323233> ; <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/Q478214> ; <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 shared by Formula One and Intel?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?commonType WHERE {
  wd:Q1968 wdt:P31 ?type1 .
  wd:Q248 wdt:P31 ?type2 .
  ?type2 wdt:P279 * ?commonType .
  FILTER(?type1 = ?commonType)
}
ORDER BY ASC(?commonType)
LIMIT 1

Which organizational category do both Formula One and Intel belong to, directly or indirectly?

Find the highest-level common type that includes both Formula One and Intel in 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/Q1968> ; <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/Q248> ; <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 in the hierarchy that connects the metropolitan statistical area of Las Vegas Valley and the human Phil Dawson, based on their subclass relationships?

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

Which superclass is reached with the smallest total number of steps from both the type of Phil Dawson and the type of Las Vegas Valley when traversing upward through subclass-of relationships?

Find the common superclass with the minimum combined distance from the types of Phil Dawson and Las Vegas Valley in the Wikidata taxonomy.

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/Q2624848> ; <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/Q3378763> ; <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 class do Phil Dawson and Rihanna both belong to?

SELECT ?ancestor (0 AS ?totalDistance) WHERE { wd:Q3378763 wdt:P31 ?ancestor . wd:Q36844 wdt:P31 ?ancestor . } LIMIT 1

What is the most specific category that both Phil Dawson and Rihanna are instances of?

Which human category is shared by both the American football player Phil Dawson and the singer Rihanna?

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/Q3378763> ; <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/Q36844> ; <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 class (category) that both Phil Dawson and Robert Thurman belong to?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?ancestor WHERE {
  wd:Q3378763 wdt:P31 ?c1 .
  wd:Q1377791 wdt:P31 ?c2 .
  ?c1 wdt:P279 * ?ancestor .
  ?c2 wdt:P279 * ?ancestor .
  FILTER ( ?ancestor = ?c1 || ?ancestor = ?c2 )
}
ORDER BY ASC ( ?ancestor )
LIMIT 1

Which human category is the closest common ancestor in the ontology for both Phil Dawson and Robert Thurman?

Find the most specific class that both Phil Dawson and Robert Thurman are instances of, considering their class 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/Q3378763> ; <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/Q1377791> ; <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 broader categories that polenta belongs to?

SELECT ?superclass ?superclassLabel WHERE { wd:Q131607 wdt:P279 ?superclass . ?superclass rdfs:label ?superclassLabel . FILTER(LANG(?superclassLabel) = "en")}

Is polenta a type of porridge or dish?
What classes is polenta a subclass of?

SELECT ?var1 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P279> <http://www.wikidata.org/entity/Q131607> . }


Question: What is the most specific category that both A.J. Hinch and Panama City belong to?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?commonAncestor WHERE {
  wd:Q2818926 wdt:P31 ?type1 .
  wd:Q3306 wdt:P31 ?type2 .
  ?type1 wdt:P279 * ?commonAncestor .
  ?type2 wdt:P279 * ?commonAncestor .
}
LIMIT 1

What is the common superclass in the Wikidata hierarchy shared by the human A.J. Hinch and the city Panama City?

What is the lowest-level entity type that includes both A.J. Hinch and Panama City?

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/Q2818926> ; <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/Q3306> ; <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: Subclasses of stimulant foodstuff

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?stimulantFood WHERE {
  ?stimulantFood wdt:P279 wd:Q1365365 .
}

What are some examples of food items that are subclasses of stimulant foodstuff?

List all known food and drink items that are classified as subclasses of stimulant foodstuff, such as those containing caffeine or other psychoactive stimulants.

SELECT ?var1 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P279> <http://www.wikidata.org/entity/Q1365365> . }


Question: Subclasses of logarithmic unit and their immediate and grandparent classes in the hierarchy.

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 DISTINCT ?subclass ?subclassLabel ?parent ?parentLabel ?grandparent ?grandparentLabel WHERE {
  wd:Q17342348 wdt:P279 * ?subclass .
  ?subclass wdt:P279 ?parent .
  ?parent wdt:P279 ?grandparent .
  ?subclass rdfs:label ?subclassLabel .
  ?parent rdfs:label ?parentLabel .
  ?grandparent rdfs:label ?grandparentLabel .
  FILTER ( LANG( ?subclassLabel ) = "en" ) FILTER ( LANG( ?parentLabel ) = "en" ) FILTER ( LANG( ?grandparentLabel ) = "en" )
}
LIMIT 20

What are the subclasses of logarithmic unit, along with their direct superclasses and the superclasses of those superclasses?

List all subclasses of logarithmic unit, their parent classes, and their grandparent classes, including their English labels.

SELECT DISTINCT ?var1 ?var1Label ?var2 ?var2Label ?var3 ?var3Label WHERE { VALUES ( ?var4 ) { ( <http://www.wikidata.org/entity/Q47574> ) ( <http://www.wikidata.org/entity/Q309314> ) } BIND ( <http://www.wikidata.org/entity/Q17342348> AS ?var5 ). ?var5 ( <http://www.wikidata.org/prop/direct/P31> | <http://www.wikidata.org/prop/direct/P279> ) ?var1 . ?var1 <http://www.wikidata.org/prop/direct/P279> * ?var4 . ?var2 ^ <http://www.wikidata.org/prop/direct/P279> * ?var6 . ?var3 ^ <http://www.wikidata.org/prop/direct/P279> ?var2 . ?var3 <http://www.wikidata.org/prop/direct/P279> * ?var4 . SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "de, en". } }


Question: What properties are commonly used to describe organizations that are part of the same parent organization as the Zionist Federation of Germany?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT DISTINCT ?property WHERE {
  wd:Q205369 wdt:P361 ?parent .
  ?organization wdt:P361 ?parent .
  ?organization ?property ?value .
  FILTER ( isIRI( ?property ) )
}

List all the attributes (properties) associated with organizations that belong to the World Zionist Organization, including the Zionist Federation of Germany.

Which types of information are recorded about other groups related to the Zionist Federation of Germany through their shared membership in the World Zionist Organization?

SELECT DISTINCT ?var1 WHERE { ?var2 <http://www.wikidata.org/entity/Q6422240> ? <http://www.wikidata.org/entity/Q205369> . ?var2 ?var1 ?var3 . <http://www.bigdata.com/queryHints#Query> <http://www.bigdata.com/queryHints#optimizer> "None". ?var4 <http://wikiba.se/ontology#directClaim> ?var1 . SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en". } }


Question: What is the most specific category that both Jeff Teague and Stanley Crouch belong to?

SELECT ?commonClass ?commonClassLabel WHERE { wd:Q552935 wdt:P31 ?commonClass . wd:Q355531 wdt:P31 ?commonClass . ?commonClass rdfs:label ?commonClassLabel . FILTER(LANG(?commonClassLabel) = "en") } LIMIT 1

What do Jeff Teague and Stanley Crouch have in common in terms of their classification in Wikidata?

What class is shared by both the basketball player Jeff Teague and the writer Stanley Crouch?

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/Q552935> ; <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/Q355531> ; <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 NATO and the App Store 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 DISTINCT ?commonClass ?commonClassLabel WHERE {
  wd:Q7184 wdt:P31 ?natoClass .
  wd:Q368215 wdt:P31 ?appClass .
  ?natoClass wdt:P279 * wd:Q35120 .
  ?appClass wdt:P279 * wd:Q35120 .
  wd:Q35120 rdfs:label ?commonClassLabel .
  FILTER(LANG(?commonClassLabel) = "en")
}

Is there any shared classification between NATO and the App Store in Wikidata’s hierarchy?

What is the highest-level class that includes both NATO and the App Store 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/Q7184> ; <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/Q368215> ; <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 Maine and Israelis belong to, based on their types in Wikidata?

PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?ancestor ( ?dist1 + ?dist2 AS ?totalDist ) WHERE {
  VALUES ?ancestor {
    wd:Q35120
  }
  BIND( 6 AS ?dist1 ) BIND( 4 AS ?dist2 )
}
ORDER BY ASC ( ?totalDist )
LIMIT 1

What is the common superclass of the type of Maine and the type of Israelis, and what is the total distance in the subclass hierarchy?

Find the least specific common ancestor in the Wikidata taxonomy between the state of Maine and the population of Israelis.

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/Q724> ; <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/Q875556> ; <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 category that both Earth and Israelis belong to?

SELECT ?commonAncestor WHERE { wd:Q2 wdt:P31 ?earthType . wd:Q875556 wdt:P31 ?israeliType . ?earthType wdt:P279* ?commonAncestor . ?israeliType wdt:P279* ?commonAncestor . FILTER (?commonAncestor != wd:Q17442446) } ORDER BY ASC(STR(?commonAncestor)) LIMIT 1

What is the lowest-level class that includes both the planet Earth and the population of Israelis?

What do Earth and the people of Israel have in common in terms of their ontological 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/Q2> ; <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/Q875556> ; <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: Who are some Israeli citizens who were born in or live in Los Angeles?

SELECT ?person ?personLabel ?birthPlace ?residence WHERE { ?person wdt:P31 wd:Q5 ; wdt:P27 wd:Q79 . OPTIONAL { ?person wdt:P19 ?birthPlace . } OPTIONAL { ?person wdt:P551 ?residence . } FILTER(?birthPlace = wd:Q65 || ?residence = wd:Q65) . ?person rdfs:label ?personLabel . FILTER(LANG(?personLabel) = "en") } ORDER BY ?personLabel LIMIT 10

List people from Israel associated with Los Angeles, including their birthplace or residence.

Find individuals who are citizens of Israel and have a connection to Los Angeles, such as being born there or residing there.

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/Q875556> ; <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/Q8731> ; <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 common higher-level categories that include both Christian Estrosi and the National Football League?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?common WHERE {
  wd:Q749029 wdt:P31 ?type1 .
  wd:Q1215884 wdt:P31 ?type2 .
  ?type1 wdt:P279 * ?common .
  ?type2 wdt:P279 * ?common .
}
ORDER BY ?common

Which ontological classes are shared by the types of Christian Estrosi and the NFL?

What is the most abstract category that both Christian Estrosi (as a human) and the NFL (as a sports league) 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/Q749029> ; <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/Q1215884> ; <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 ancestor class (in the subclass hierarchy) of the types of Christian Estrosi and Angola, and what is the sum of the shortest path distances from each to that ancestor?

SELECT ?ancestor ?label ?dist1 ?dist2 (?dist1 + ?dist2 AS ?total)
WHERE {
  {
    SELECT ?ancestor (COUNT(?mid) AS ?dist1)
    WHERE {
      wd:Q749029 wdt:P31 ?type1 .
      ?type1 wdt:P279+ ?mid .
      ?mid wdt:P279* ?ancestor .
    }
    GROUP BY ?ancestor
  }
  {
    SELECT ?ancestor (COUNT(?mid) AS ?dist2)
    WHERE {
      wd:Q916 wdt:P31 ?type2 .
      ?type2 wdt:P279+ ?mid .
      ?mid wdt:P279* ?ancestor .
    }
    GROUP BY ?ancestor
  }
  ?ancestor rdfs:label ?label .
  FILTER(LANG(?label) = "en")
}
ORDER BY ASC(?total)
LIMIT 1

Which class is the closest common superclass of both a human (like Christian Estrosi) and a sovereign state (like Angola), measured by the total number of subclass steps?

Find the entity that minimizes the sum of shortest path distances via subclass relationships from the types of Christian Estrosi and Angola — what is that entity and the 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/Q749029> ; <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/Q916> ; <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 an airline and a human belong to?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?ancestor(COUNT(?instance) AS ?instanceCount) WHERE {
  wd:Q46970 wdt:P279 * ?ancestor .
  wd:Q5 wdt:P279 * ?ancestor .
  ?instance wdt:P31 ?ancestor .
}
GROUP BY ?ancestor
ORDER BY ASC(?instanceCount)
LIMIT 1

Which subclass is shared by both Gina Torres and Nature Air, and has the fewest instances?

Find the most specific common ancestor in the subclass hierarchy between a human and an airline.

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/Q980781> ; <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/Q241471> ; <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 (via subclass hierarchy) between The New York Times and Angela Merkel?

SELECT ?commonAncestor (?dist1 + ?dist2 AS ?totalDistance)
WHERE {
  {
    SELECT ?ancestor (COUNT(?mid1) AS ?dist1)
    WHERE {
      wd:Q9684 wdt:P31 ?type1 .
      ?type1 wdt:P279* ?mid1 .
      ?mid1 wdt:P279* ?ancestor .
    }
    GROUP BY ?ancestor
  }
  {
    SELECT ?ancestor (COUNT(?mid2) AS ?dist2)
    WHERE {
      wd:Q567 wdt:P31 ?type2 .
      ?type2 wdt:P279* ?mid2 .
      ?mid2 wdt:P279* ?ancestor .
    }
    GROUP BY ?ancestor
  }
  FILTER(?ancestor != wd:Q9684 && ?ancestor != wd:Q567)
}
ORDER BY ASC(?totalDistance)
LIMIT 1

Is there any common superclass in Wikidata’s ontology that connects The New York Times and Angela Merkel?

What is the shortest combined path through subclass relationships from The New York Times to Angela Merkel?

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/Q9684> ; <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 occupation category that Gina Torres belongs to?

SELECT ?superClass ?superClassLabel WHERE { wd:Q241471 wdt:P106 ?occupation . ?occupation wdt:P279+ ?superClass . ?superClass wdt:P279* wd:Q12737077 . ?superClass rdfs:label ?superClassLabel . FILTER(LANG(?superClassLabel) = "en") } ORDER BY ASC(STRLEN(STR(?superClass))) LIMIT 1

What class do all of Gina Torres’s occupations fall under in the hierarchy?

What is the highest-level occupation type shared by Gina Torres’s jobs like television actor and film actor?

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/Q45606191> ; <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/Q241471> ; <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 ancestor of "botanical garden" and "garden" in the Wikidata subclass hierarchy?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?commonAncestor ( COUNT( ?path1 ) + COUNT( ?path2 ) AS ?totalDistance ) WHERE {
  wd:Q167346 wdt:P279 + ?path1 .
  ?path1 wdt:P279 * ?commonAncestor .
  wd:Q1107656 wdt:P279 + ?path2 .
  ?path2 wdt:P279 * ?commonAncestor .
  FILTER ( ?commonAncestor != wd:Q167346 ) FILTER ( ?commonAncestor != wd:Q1107656 )
}
GROUP BY ?commonAncestor
ORDER BY ?totalDistance
LIMIT 1

Which concept is the lowest shared superclass of botanical gardens and general gardens, based on their hierarchical relationships?

Find the closest common parent class in the taxonomy between botanical garden and garden.

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/Q45606191> ; <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/Q167346> ; <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 Pavel Durov and the Houston Texans belong to?

SELECT ?commonClass ?commonClassLabel (COUNT(?instance) AS ?instanceCount) WHERE { wd:Q149067 wdt:P31 ?class1 . ?class1 wdt:P279* ?commonClass . wd:Q223514 wdt:P31 ?class2 . ?class2 wdt:P279* ?commonClass . ?commonClass rdfs:label ?commonClassLabel . ?instance wdt:P31 ?commonClass . FILTER(LANG(?commonClassLabel) = "en") . FILTER(?commonClass != wd:Q149067 && ?commonClass != wd:Q223514) } GROUP BY ?commonClass ?commonClassLabel ORDER BY ASC(?instanceCount) LIMIT 1

Find the shared classification with the fewest instances that includes both Pavel Durov and the Houston Texans.

What is the narrowest common category in Wikidata that links Pavel Durov (a person) and the Houston Texans (a sports team)?

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/Q149067> ; <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/Q223514> ; <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 occupations of Harvey Weinstein and the head coach of the Houston Texans?

SELECT ?weinsteinOccupation ?coachOccupation WHERE { wd:Q531599 wdt:P106 ?weinsteinOccupation . wd:Q223514 wdt:P286 ?coach . ?coach wdt:P106 ?coachOccupation . }

Show me the job titles of Harvey Weinstein and the head coach of the Houston Texans side by side.

Which occupations does Harvey Weinstein have, and what are the occupations of the Houston Texans' head coach?

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/Q531599> ; <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/Q223514> ; <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: Subclasses of unnatural death

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 DISTINCT ?subclass ?subclassLabel WHERE {
  ?subclass wdt:P279 * wd:Q855919 .
  ?subclass rdfs:label ?subclassLabel .
  FILTER(LANG(?subclassLabel) = "en")
}

What are all the types of unnatural death, including subcategories like judicial murder or capital punishment?

List all known subclasses of unnatural death in English.

SELECT DISTINCT ?var1 ?var1Label WHERE { ?var1 <http://www.wikidata.org/prop/direct/P279> * <http://www.wikidata.org/entity/Q855919> . 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 superclass of Donald Trump and Chadwick Boseman?

SELECT ?commonClass WHERE { wd:Q22686 wdt:P31 ?class1 . wd:Q5066520 wdt:P31 ?class2 . ?class1 rdfs:subClassOf* ?commonClass . ?class2 rdfs:subClassOf* ?commonClass . } ORDER BY ?commonClass LIMIT 1

What human category do Donald Trump and Chadwick Boseman both belong to at the most specific level?

Find the most specific class that is a superclass of both Donald Trump and Chadwick Boseman in the Wikidata ontology.

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/Q5066520> ; <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/Q22686> ; <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: Spanish labels of Wikidata properties used for authority control

SELECT ?property ?label WHERE { ?property wdt:P31 wd:Q18614948 . ?property rdfs:label ?label . FILTER (LANG(?label) = "es") }

What are the Spanish labels for Wikidata properties that serve as authority control identifiers?

List all Wikidata properties that are instances of authority control properties, along with their Spanish labels.

SELECT ?var1 ?var2 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q18614948> . ?var1 <http://www.w3.org/2000/01/rdf-schema#label> ?var2 . FILTER ( ( ( LANG ( ?var2 ) = "es" ) ) ) . }


Question: Is there a Wikipedia category with The Orb as its main topic?

ASK WHERE { ?category wdt:P301 wd:Q924993 . }

Does Wikipedia have a category that has The Orb as its primary subject?

Show me if The Orb is the main topic of any Wikimedia category.

ASK WHERE { ?var1 <http://www.wikidata.org/prop/direct/P301> <http://www.wikidata.org/entity/Q924993> . }


Question: Wikimedia category for Academy Award for Best Actor winners

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?category WHERE {
  ?category wdt:P301 wd:Q103916 .
}

Which Wikimedia category has the Academy Award for Best Actor as its main topic?

Show me the Wikimedia category that is about the Academy Award for Best Actor.

SELECT ?var1 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P301> <http://www.wikidata.org/entity/Q103916> . } LIMIT 1


Question: Which entities on Wikidata have the Twitter handles 'drose', 'TowsonU', 'wbaltv11', 'wojespn', or '923TheFan'?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?item ?twitterHandle WHERE {
  ?item wdt:P2002 ?twitterHandle .
  VALUES ?twitterHandle {
    "drose" "TowsonU" "wbaltv11" "wojespn" "923TheFan"
  }
}

Who are the people or organizations on Wikidata associated with the Twitter usernames drose, TowsonU, wbaltv11, wojespn, and 923TheFan?

Please list the Wikidata items and their corresponding Twitter usernames for the handles: drose, TowsonU, wbaltv11, wojespn, and 923TheFan.

SELECT ?var1 ?var2 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P2002> ?var2 ; <http://wikiba.se/ontology#sitelinks> ?var3 . VALUES ( ?var2 ) { ( "drose" ) ( "string1" ) ( "TowsonU" ) ( "wbaltv11" ) ( "string2" ) ( "RTNBA" ) ( "string3" ) ( "string4" ) ( "string5" ) ( "string6" ) ( "wojespn" ) ( "string7" ) ( "string8" ) ( "string9" ) ( "string10" ) ( "string11" ) ( "string12" ) ( "string13" ) ( "string14" ) ( "Dj51425539" ) ( "string15" ) ( "string16" ) ( "string17" ) ( "923TheFan" ) } } ORDER BY ASC( ?var3 )


Question: People who have philosopher as a position held with qualifiers

PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
SELECT ?person ?statement ( SAMPLE( ?qualifier ) AS ?qualifierProperty ) WHERE {
  ?statement ps:P39 wd:Q4964182 .
  ?person p:P39 ?statement .
  OPTIONAL {
    ?qualifier wikibase:qualifier p:P39 .
    ?statement ?qualifier ?qualifierValue .
  }
}
GROUP BY ?person ?statement

Who are the people in Wikidata that have "philosopher" listed as a position they held, and what qualifiers are attached to those statements?

List all individuals whose position held statement is incorrectly set to "philosopher", along with any associated qualifiers.

SELECT ?var1 ?var2 ( SAMPLE ( ?var3 ) AS ?var4 ) WHERE { { SELECT DISTINCT ?var1 ?var2 WHERE { ?var2 <http://www.wikidata.org/prop/statement/P39> <http://www.wikidata.org/entity/Q4964182> . ?var1 <http://www.wikidata.org/prop/P39> ?var2 . } LIMIT 101 } OPTIONAL { ?var2 ?var3 ?var5 . ?var6 <http://wikiba.se/ontology#qualifier> ?var3 . } } GROUP BY ?var1 ?var2


Question: Which organizations on Wikidata have Twitter usernames CityOfBoston, melroserugby, or deventergem?

SELECT ?entity ?twitterUsername WHERE { ?entity wdt:P2002 ?twitterUsername . VALUES ?twitterUsername { "CityOfBoston" "melroserugby" "deventergem" } } ORDER BY DESC(?sitelinks)

What entities in Wikidata are associated with the Twitter handles CityOfBoston, melroserugby, and deventergem?

List the Wikidata items for the Twitter accounts CityOfBoston, melroserugby, and deventergem, sorted by how many Wikipedia pages they have.

SELECT ?var1 ?var2 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P2002> ?var2 ; <http://wikiba.se/ontology#sitelinks> ?var3 . VALUES ( ?var2 ) { ( "string1" ) ( "string2" ) ( "string3" ) ( "string4" ) ( "Axe_Tayler" ) ( "Wadihoff" ) } } ORDER BY ASC( ?var3 )


Question: Wikidata items with their Commons category names, URLs, cleaned category titles, and full page titles.

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
SELECT ?item ?categoryName ?categoryPage(REPLACE(REPLACE(STR(?categoryPage) , "https://commons.wikimedia.org/wiki/Category:" , "") , "_" , " ") AS ?cleanedCategory) ?pageTitle WHERE {
  ?item wdt:P373 ?categoryName .
  ?categoryPage schema:about ?item ; schema:isPartOf <https://commons.wikimedia.org/> ; schema:name ?pageTitle .
  FILTER(CONTAINS(STR(?categoryPage) , "Category:"))
}
LIMIT 20

What are the Wikimedia Commons category pages for items that have a Commons category defined, and what are the cleaned versions of those category names?

Show me the Wikidata items, their Commons category names from P373, the corresponding category page URLs, the human-readable version of those URLs (without "Category:" and with spaces instead of underscores), and the full page titles including language tags.

SELECT ?var1 ?var2 ?var3 ( REPLACE ( STR ( REPLACE ( STR ( ?var3 ) , "string1", "" ) ) , "_", " " ) AS ?var4 ) ?var5 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P373> ?var2 . ?var3 <http://schema.org/about> ?var1 ; <http://schema.org/isPartOf> <https://commons.wikimedia.org/> ; <http://schema.org/name> ?var5 . FILTER ( ( CONTAINS ( STR ( ?var3 ) , "Category:" ) ) ) . FILTER ( ( ( ?var2 != SUBSTR ( STR ( ?var5 ) ,"10"^^<http://www.w3.org/2001/XMLSchema#integer> ) ) ) ) . } LIMIT 20


Question: Films released in 2017 with their box office earnings and English titles, sorted by lowest earnings first.

SELECT DISTINCT ?film ?title ?boxOffice WHERE { ?film wdt:P31 wd:Q11424 . ?film wdt:P577 ?releaseDate . ?film wdt:P2142 ?boxOffice . FILTER ( ?releaseDate >= "2017-01-01T00:00:00Z"^^xsd:dateTime && ?releaseDate <= "2017-12-31T00:00:00Z"^^xsd:dateTime ) FILTER ( ?boxOffice >= 0 ) ?film rdfs:label ?title . FILTER ( lang(?title) = "en" ) } ORDER BY ASC(?boxOffice)

What are the 2017 films with the lowest box office earnings, along with their English titles?

List all films released in 2017 that have recorded box office numbers, showing their English titles and earnings in ascending order of revenue.

SELECT DISTINCT ?var1 ?var1Label ?var2 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q11424> . ?var1 <http://www.wikidata.org/prop/direct/P577> ?var3 . ?var1 <http://www.wikidata.org/prop/direct/P2142> ?var2 . FILTER ( ( ( ?var4 >= "0"^^<http://www.w3.org/2001/XMLSchema#integer> ) ) ) . FILTER ( ( ( ?var3 >= "2017-01-01T00:00:00Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ) && ( ?var3 <= "2017-12-31T00:00:00Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ) ) ) . SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en,en". } } ORDER BY ASC( ?var2 )


Question: What is the English label for the Wikidata item about the glossary of Hinduism terms?

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

Show the English name of the glossary of Hinduism terms on Wikidata.

What does the English-language label say for the entity representing a Hinduism terminology glossary?

SELECT DISTINCT * WHERE { <http://www.wikidata.org/entity/Q3350979> <http://www.w3.org/2000/01/rdf-schema#label> ?var1Label . FILTER ( ( LANGMATCHES ( LANG ( ?var1Label ) , "EN" ) ) ) . } LIMIT 1


Question: Image of José Pancetti with SNAC ARK ID w6qr6p2c

SELECT ?image WHERE { ?person wdt:P3430 "w6qr6p2c" . OPTIONAL { ?person wdt:P18 ?image . } }

What is the image associated with the person having the SNAC ARK ID w6qr6p2c?

Show me the Wikimedia Commons image of José Pancetti, identified by the SNAC ARK ID w6qr6p2c.

SELECT ?var1 WHERE { ?var2 <http://www.wikidata.org/prop/direct/P3430> "w6qr6p2c". OPTIONAL { ?var2 <http://www.wikidata.org/prop/direct/P18> ?var1 . } }


Question: Main subjects of works by John Stewart Dugdale

SELECT ?subjectLabel WHERE { ?work wdt:P50 wd:Q22113468 . ?work wdt:P921 ?subject . ?subject rdfs:label ?subjectLabel . FILTER(LANG(?subjectLabel) = "en") } ORDER BY ?subjectLabel

What topics are covered in the scientific publications authored by John Stewart Dugdale?

List the English labels of all main subjects of works written by the New Zealand entomologist John Stewart Dugdale.

SELECT ?var1 ?var2Label ?var3Label WHERE { { SELECT ?var4 ( COUNT ( ?var5 ) AS ?var1 ) WHERE { ?var5 <http://www.wikidata.org/prop/direct/P50> <http://www.wikidata.org/entity/Q22113468> . ?var5 <http://www.wikidata.org/prop/direct/P921> ?var4 . } GROUP BY ?var4 ORDER BY DESC( ?var1 ) } BIND ( SUBSTR ( ?var6Label ,"1"^^<http://www.w3.org/2001/XMLSchema#integer> ,"60"^^<http://www.w3.org/2001/XMLSchema#integer> ) AS ?var3Label ). ?var5 <http://www.wikidata.org/prop/direct/P50> <http://www.wikidata.org/entity/Q22113468> . ?var5 <http://www.wikidata.org/prop/direct/P921> ?var4 . ?var4 <http://www.w3.org/2000/01/rdf-schema#label> ?var2Label . FILTER ( ( ( LANG ( ?var2Label ) = "en" ) ) ) . ?var5 <http://www.w3.org/2000/01/rdf-schema#label> ?var6Label . FILTER ( ( ( LANG ( ?var6Label ) = "en" ) ) ) . }


Question: Which Twitter accounts (netanyahu, lemondefr, kumailn, etc.) are linked to Wikidata items, and how many Wikipedia pages are associated with each?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
SELECT ?item ?twitterHandle(COUNT(?site) AS ?sitelinks) WHERE {
  ?item wdt:P2002 ?twitterHandle .
  ?site schema:about ?item ; schema:isPartOf ?siteItem .
  VALUES ?twitterHandle {
    "netanyahu" "lemondefr" "kumailn" "nantesfr" "libe" "fitouss" "DuDetour" "chdelporte" "Authueil" "DEADLINE"
  }
}
GROUP BY ?item ?twitterHandle
ORDER BY ASC(?sitelinks)

What are the Wikipedia sitelink counts for Wikidata items with Twitter handles like netanyahu, lemondefr, and kumailn?

List the Wikidata entities with Twitter usernames including netanyahu, lemondefr, and kumailn, along with the number of Wikipedia pages linked to each, ordered by least to most links.

SELECT ?var1 ?var2 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P2002> ?var2 ; <http://wikiba.se/ontology#sitelinks> ?var3 . VALUES ( ?var2 ) { ( "string1" ) ( "string2" ) ( "string3" ) ( "Authueil" ) ( "lemondefr" ) ( "chdelporte" ) ( "string4" ) ( "string5" ) ( "string6" ) ( "string7" ) ( "string8" ) ( "string9" ) ( "libe" ) ( "string10" ) ( "fitouss" ) ( "string11" ) ( "DuDetour" ) ( "string12" ) ( "netanyahu" ) ( "string13" ) ( "DEADLINE" ) ( "string14" ) ( "string15" ) ( "nantesfr" ) ( "kumailn" ) ( "string16" ) ( "string17" ) ( "string18" ) ( "string19" ) } } ORDER BY ASC( ?var3 )


Question: What fictional entities are based on paintings, and what additional details are known about those relationships?

SELECT ?fictionalEntity ?statement (SAMPLE(?qualifierValue) AS ?qualifierValueSample)
WHERE {
  {
    SELECT DISTINCT ?fictionalEntity ?statement WHERE {
      ?statement ps:P1074 wd:Q3305213 .
      ?fictionalEntity p:P1074 ?statement .
    }
    LIMIT 101
  }
  OPTIONAL {
    ?statement ?qualifierProperty ?qualifierValue .
    wdt:P1074 wikibase:qualifier ?qualifierProperty .
  }
}
GROUP BY ?fictionalEntity ?statement

Which works of fiction have paintings as their real-world analogs?

Can you list entities in fiction that are modeled after paintings, along with any qualifiers like titles or creators?

SELECT ?var1 ?var2 ( SAMPLE ( ?var3 ) AS ?var4 ) WHERE { { SELECT DISTINCT ?var1 ?var2 WHERE { ?var2 <http://www.wikidata.org/prop/statement/P1074> <http://www.wikidata.org/entity/Q3305213> . ?var1 <http://www.wikidata.org/prop/P1074> ?var2 . } LIMIT 101 } OPTIONAL { ?var2 ?var3 ?var5 . ?var6 <http://wikiba.se/ontology#qualifier> ?var3 . } } GROUP BY ?var1 ?var2


Question: Is there a person in Wikidata with GND ID 1152066625?

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
ASK WHERE {
  ?item wdt:P227 "1152066625" .
}

Does the German National Library ID 1152066625 correspond to any entity in Wikidata?

Confirm whether the GND ID 1152066625 is registered in Wikidata.

ASK WHERE { ?var1 <http://www.wikidata.org/prop/direct/P227> "1152066625". }


Question: Image of the person with SNAC ARK ID w6012fp8

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?image WHERE {
  ?item wdt:P3430 "w6012fp8" .
  OPTIONAL {
    ?item wdt:P18 ?image .
  }
}

What is the image associated with Marsha Mason in Wikidata?

Can you show me the Wikimedia Commons image for the individual identified by the SNAC ARK ID w6012fp8?

SELECT ?var1 WHERE { ?var2 <http://www.wikidata.org/prop/direct/P3430> "w6012fp8". OPTIONAL { ?var2 <http://www.wikidata.org/prop/direct/P18> ?var1 . } }


Question: People born in December 1900

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?person WHERE {
  ?person wdt:P569 ?birthDate .
  FILTER ( ?birthDate >= "1900-12-01T00:00:00Z" ^^ xsd:dateTime && ?birthDate <= "1900-12-31T23:59:59Z" ^^ xsd:dateTime )
}

List all individuals whose date of birth falls within December 1900.

SELECT DISTINCT ?var1 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P569> ?var2 . FILTER ( ( ( ?var2 >= "1900-12-01T00:00:00Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ) && ( ?var2 <= "1900-12-31T23:59:59Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ) ) ) . }


Question: Who has the Twitter/X username "MeilerLab"?

SELECT ?item ?username WHERE { ?item wdt:P2002 ?username . VALUES ?username { "MeilerLab" } }

Twitter/X handle "MeilerLab" → which person or entity?

Find the Wikidata item for the Twitter username MeilerLab.

SELECT ?var1 ?var2 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P2002> ?var2 . VALUES ( ?var2 ) { ( "string1" ) ( "MeilerLab" ) } }


Question: Politicians from Gabon and their countries of citizenship

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 ?politician ?politicianLabel ?country ?countryLabel WHERE {
  ?politician wdt:P106 wd:Q82955 .
  ?politician wdt:P27 ?country .
  ?politician rdfs:label ?politicianLabel .
  ?country rdfs:label ?countryLabel .
  FILTER(LANG(?politicianLabel) = "en")
  FILTER(LANG(?countryLabel) = "en")
}
LIMIT 100

Who are the politicians and what countries do they hold citizenship in?

List the names of politicians and their countries of citizenship, limited to English labels.

SELECT ?var1 ?var2 ?var2Label WHERE { SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en,en". } ?var1 <http://www.wikidata.org/prop/direct/P106> <http://www.wikidata.org/entity/Q82955> . OPTIONAL { } OPTIONAL { } OPTIONAL { } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P17> ?var2 . } } LIMIT 100


Question: Politicians and their countries and positions held

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 ?person ?personLabel ?country ?countryLabel ?position ?positionLabel WHERE {
  ?person wdt:P106 wd:Q82955 .
  OPTIONAL {
    ?person wdt:P27 ?country .
    ?country rdfs:label ?countryLabel .
    FILTER ( LANG( ?countryLabel ) = "en" )
  }
  OPTIONAL {
    ?person wdt:P39 ?position .
    ?position rdfs:label ?positionLabel .
    FILTER ( LANG( ?positionLabel ) = "en" )
  }
  ?person rdfs:label ?personLabel .
  FILTER ( LANG( ?personLabel ) = "en" )
}
LIMIT 1000

Who are the politicians, what countries are they citizens of, and what positions have they held?

List politicians along with their country of citizenship and the public offices they have held, using English labels.

SELECT ?var1 ?var1Label ?var2 ?var2Label ?var3 ?var3Label WHERE { SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en,en". } ?var1 <http://www.wikidata.org/prop/direct/P106> <http://www.wikidata.org/entity/Q82955> . OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P39> ?var3 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P27> ?var2 . } } LIMIT 1000


Question: Names of people who have an employer in Wikidata.

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?person ?personLabel WHERE {
  ?person wdt:P108 ?employer .
  ?person rdfs:label ?personLabel .
  FILTER ( LANG( ?personLabel ) = "en" )
}

Who are the people listed as employees in Wikidata, and what are their names?

List the English names of individuals who are employed by an organization according to Wikidata.

CONSTRUCT { ?var1 <http://xmlns.com/foaf/0.1/name> ?var2 } WHERE { ?var1 <http://example.com/ns#employeeName> ?var2 . }


Question: What properties are associated with Mapo tofu in Wikidata?

SELECT DISTINCT ?property WHERE { wd:Q1298577 ?property ?value . } LIMIT 100

Which properties describe the dish Mapo tofu in Wikidata?

List all the properties used to describe Mapo tofu on Wikidata.

SELECT DISTINCT ?var1 WHERE { <http://www.wikidata.org/entity/Q1298577> ?var1 ?var2 . } LIMIT 100


Question: What are all the language versions of the name "BMW" as listed in Wikidata?

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?label WHERE {
  wd:Q26678 rdfs:label ?label .
}
LIMIT 100

Show me the labels for the company BMW in different languages.

How is BMW referred to in various languages according to Wikidata?

SELECT DISTINCT ?var1 WHERE { <http://www.wikidata.org/entity/Q26678> <http://www.w3.org/2000/01/rdf-schema#label> ?var1 . FILTER ( ( REGEX ( ?var1 , "BMW" ) ) ) . } LIMIT 100


Question: What is the title of the Dream Theater album released on October 28, 2004 in Tokyo, Japan?

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT DISTINCT ?label WHERE {
  wd:Q3992283 rdfs:label ?label .
}
LIMIT 100

What are the different language versions of the album title for Dream Theater's 2004 release?

Can you show me the labels for the Dream Theater album from 2004?

SELECT DISTINCT ?var1 WHERE { <http://www.wikidata.org/entity/Q3992283> <http://www.w3.org/2000/01/rdf-schema#label> ?var1 . FILTER ( ( ( LANG ( ?var1 ) = "album" ) ) ) . } LIMIT 100


Question: What type of media is Dr. Slump?

SELECT ?type WHERE { wd:Q3038453 wdt:P31 ?type .}

What class does the anime series Dr. Slump belong to?

Can you tell me the instance type of Dr. Slump, the 1981 Japanese anime series?

SELECT ?var1 WHERE { <http://www.wikidata.org/entity/Q3038453> <http://www.wikidata.org/prop/direct/P31> ?var1 . }


Question: Common names of organisms in Wikidata

SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q502895 . OPTIONAL { ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = 'en') } } LIMIT 100

What are some common names used for animals and plants in Wikidata?

List the English common names of biological taxa stored in Wikidata.

SELECT ?var1 ?var2 WHERE { ?var1 ?var2 <http://www.wikidata.org/entity/Q502895> . } LIMIT 100


Question: Japanese names of automobile manufacturers

SELECT ?manufacturer ?label WHERE { ?manufacturer wdt:P31 wd:Q786820 . ?manufacturer rdfs:label ?label . FILTER (LANG(?label) = "ja") } LIMIT 100

What are the Japanese-language labels for companies that manufacture automobiles?

List up to 100 automobile manufacturers with their Japanese names.

SELECT ?var1 ?var2 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q786820> . ?var1 <http://www.w3.org/2000/01/rdf-schema#label> ?var2 . FILTER ( ( ( LANG ( ?var2 ) = "ja" ) ) ) . } LIMIT 100


Question: People who are actors and their other occupations

SELECT ?person ?personLabel ?occupation ?occupationLabel WHERE { ?person wdt:P106 wd:Q33999 . OPTIONAL { ?person wdt:P106 ?occupation . } OPTIONAL { ?person rdfs:label ?personLabel . FILTER(LANG(?personLabel) = "en") } OPTIONAL { ?occupation rdfs:label ?occupationLabel . FILTER(LANG(?occupationLabel) = "en") } } LIMIT 100

Who are the actors on Wikidata, and what other jobs do they have?

List all actors along with all their occupations, including their English labels.

SELECT ?var1 ?var1Label ?var2 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P106> * <http://www.wikidata.org/entity/Q33999> . OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P106> ?var2 . } SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en". } } LIMIT 100


Question: Politicians and their countries, positions held, and dates of birth

SELECT ?politician ?country ?position ?birthDate WHERE { ?politician wdt:P106 wd:Q82955 . OPTIONAL { ?politician wdt:P27 ?country . } OPTIONAL { ?politician wdt:P39 ?position . } OPTIONAL { ?politician wdt:P569 ?birthDate . } } LIMIT 5

Who are some politicians, what countries are they citizens of, what positions have they held, and when were they born?

List five politicians along with their citizenship, positions held, and birth dates.

SELECT ?var1 ?var2 ?var2Label ?var3 ?var3Label ?var4 ?var4Label ?var5 ?var5Label ?var6 ?var6Label ?var7 ?var7Label ?var8 ?var8Label ?var9 ?var1Label WHERE { SERVICE <http://wikiba.se/ontology#label> { <http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/ontology#language> "en,en". } ?var1 <http://www.wikidata.org/prop/direct/P106> <http://www.wikidata.org/entity/Q82955> . OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P39> ?var3 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P27> ?var2 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P1038> ?var4 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P3373> ?var5 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P22> ?var6 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P25> ?var7 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P40> ?var8 . } OPTIONAL { ?var1 <http://www.wikidata.org/prop/direct/P569> ?var9 . } } LIMIT 5


Question: People who died in August 1957

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT DISTINCT ?person WHERE {
  ?person wdt:P570 ?deathDate .
  FILTER(?deathDate >= "1957-08-01T00:00:00Z" ^^ xsd:dateTime && ?deathDate <= "1957-08-31T23:59:59Z" ^^ xsd:dateTime)
}

List all individuals who passed away between August 1 and August 31, 1957.

SELECT DISTINCT ?var1 WHERE { ?var1 <http://www.wikidata.org/prop/direct/P570> ?var2 . FILTER ( ( ( ?var2 >= "1957-08-01T00:00:00Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ) && ( ?var2 <= "1957-08-31T23:59:59Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ) ) ) . }