Wolfram Language

Compare Pet Types with SPARQL

The Wolfram Knowledgebase has detailed data on over one million species. A subset of this data includes pets, such as dogs, cats, turtles and more. By curating an entity store of some common pet types and aligning them to the species data available in the Wolfram Language, it becomes easier to analyze a larger dataset involving pets, such as pets.stackexchange.com.

Create and register an EntityStore of pet types that is aligned to species entities, with computed properties to leverage the alignment to gather images and produce a list of possible names of how they may be mentioned in raw text.

show complete Wolfram Language input

The alignment to species entities can be seen by using properties for images and possible names.

show complete Wolfram Language input

Import and register an EntityStore created from an archive of pets.stackexchange.com.

Add a property for posts in the Pets Stack Exchange to find pet types that are mentioned in their post contents.

show complete Wolfram Language input

Find all pet types mentioned in all of the posts.

Store this data by introducing it as a property in the "PetType" EntityStore.

Find how often the top 10 pets are mentioned on the site, using ExtendedEntityClass to introduce an EntityFunction to compute the count and SortedEntityClass to sort by it and keep only the top 10.

show complete Wolfram Language input

Write a symbolic SPARQL query to compare how often cats and dogs are mentioned in posts with specific tags.

show complete Wolfram Language input

Create a weighted network of pet types that are mentioned together.

show complete Wolfram Language input

Visualize the network.

show complete Wolfram Language input

Related Examples

ja