Truly Tabular RDF

From BITPlan Wiki
Revision as of 15:45, 14 March 2022 by Wf (talk | contribs)
Jump to navigation Jump to search

Example Scientific Events and locations

# location ( https://www.wikidata.org/wiki/Property:P276 ):7244
# Count all items with the given location ( https://www.wikidata.org/wiki/Property:P276 ):
# and type academic conference(Q2020153):https://www.wikidata.org/wiki/Q2020153
SELECT ?item (COUNT (?value) AS ?count)
WHERE
{
  # instance of academic conference
  ?item wdt:P31 wd:Q2020153.
  # location
  ?item wdt:P276 ?value.
} GROUP by ?item
HAVING (COUNT (?value) > 1)
ORDER BY DESC(?count)

try it!

non tabular entries for academic conference(Q2020153) https://www.wikidata.org/wiki/Q2020153

query

# Count all academic conference(Q2020153) https://www.wikidata.org/wiki/Q2020153 items
# with the given location(P276) https://www.wikidata.org/wiki/Property:P276 
SELECT ?item (COUNT (?value) AS ?count)
WHERE
{
  # instance of academic conference
  ?item wdt:P31 wd:Q2020153.
  # location
  ?item wdt:P276 ?value.
} GROUP by ?item
HAVING (COUNT (?value) > 1)
ORDER BY DESC(?count)


result

item count
http://www.wikidata.org/entity/Q8035745 14
http://www.wikidata.org/entity/Q107185833 4
http://www.wikidata.org/entity/Q107185835 4
http://www.wikidata.org/entity/Q1654334 3
http://www.wikidata.org/entity/Q28052808 3
http://www.wikidata.org/entity/Q47912910 3
http://www.wikidata.org/entity/Q94182434 3
http://www.wikidata.org/entity/Q59558053 2
http://www.wikidata.org/entity/Q47455387 2
http://www.wikidata.org/entity/Q47501061 2
http://www.wikidata.org/entity/Q48025514 2
http://www.wikidata.org/entity/Q48025934 2
http://www.wikidata.org/entity/Q48026643 2
http://www.wikidata.org/entity/Q48026807 2
http://www.wikidata.org/entity/Q48026926 2
http://www.wikidata.org/entity/Q56683535 2
http://www.wikidata.org/entity/Q56872346 2
http://www.wikidata.org/entity/Q59555142 2
http://www.wikidata.org/entity/Q59555499 2
http://www.wikidata.org/entity/Q59558038 2
http://www.wikidata.org/entity/Q76721517 2
http://www.wikidata.org/entity/Q90027034 2
http://www.wikidata.org/entity/Q64955764 2
http://www.wikidata.org/entity/Q73025763 2
http://www.wikidata.org/entity/Q96749264 2
http://www.wikidata.org/entity/Q104866279 2
http://www.wikidata.org/entity/Q104903952 2
http://www.wikidata.org/entity/Q106068709 2
http://www.wikidata.org/entity/Q106443465 2
http://www.wikidata.org/entity/Q107162308 2
http://www.wikidata.org/entity/Q107162375 2
http://www.wikidata.org/entity/Q107185828 2
http://www.wikidata.org/entity/Q107185830 2
http://www.wikidata.org/entity/Q106336297 2
http://www.wikidata.org/entity/Q108282854 2

non tabular entries for academic conference(Q2020153) https://www.wikidata.org/wiki/Q2020153

query

# Count all academic conference(Q2020153) https://www.wikidata.org/wiki/Q2020153 items
# with the given proceedings(P4745) https://www.wikidata.org/wiki/Property:P4745 
SELECT ?item (COUNT (?value) AS ?count)
WHERE
{
  # instance of academic conference
  ?item wdt:P31 wd:Q2020153.
  # proceedings
  ?item ^wdt:P4745 ?value.
} GROUP by ?item
HAVING (COUNT (?value) > 1)
ORDER BY DESC(?count)


result

item count
http://www.wikidata.org/entity/Q48027931 4
http://www.wikidata.org/entity/Q47912910 3
http://www.wikidata.org/entity/Q48025514 3
http://www.wikidata.org/entity/Q77250365 3
http://www.wikidata.org/entity/Q30090453 2
http://www.wikidata.org/entity/Q47455387 2
http://www.wikidata.org/entity/Q48025651 2
http://www.wikidata.org/entity/Q48025840 2
http://www.wikidata.org/entity/Q48025934 2
http://www.wikidata.org/entity/Q48026033 2
http://www.wikidata.org/entity/Q48612170 2
http://www.wikidata.org/entity/Q48619834 2
http://www.wikidata.org/entity/Q48910401 2
http://www.wikidata.org/entity/Q50290385 2
http://www.wikidata.org/entity/Q55497473 2
http://www.wikidata.org/entity/Q59620529 2
http://www.wikidata.org/entity/Q59917009 2
http://www.wikidata.org/entity/Q82290350 2
http://www.wikidata.org/entity/Q59917887 2
http://www.wikidata.org/entity/Q68277652 2