Article Tags and Categories

DQL has special handling for Article tags and categories for convenience.

Article Tags

Article tags can be searched by:

  • Tag diffbotUri or diffbotId
  • Tag label
  • Tag type

If you know the diffbotUri or diffbotId of an entity and want to search for Articles mentioning the entity (also referred to as: tagged with that entity), you can issue a query that looks like this:

type:Article tags.uri:"https://diffbot.com/entity/EUFq-3WlpNsq0pvfUYWXOEA"

type:Article tags.uri:'EUFq-3WlpNsq0pvfUYWXOEA'

You can also use the entity name to specify a tag using the tags.label or simply tags field. Here are some examples:

type:Article tags.label:'Google'

type:Article tags:'Google'

type:Article tags.{label:'Google' sentiment>0}

type:Article tags:OR('Google', 'Apple')

📘

When using tag names to specify tag queries, note that while surface forms resolve to the entity with that name with the highest importance. So, "Apple" would resolve to the company and not to the fruit.

You can also search by tag type like this:

type:Article tags.{types:'Organization' label:'Google'}

type:Article language:'de' tags.types:'Organization'

Article Categories

Article categories can be searched by:

  • Category ID
  • Category name

If you know the category ID of an article category, you can issue a query that looks like this:

type:Article categories.id:'iabv2-52'

type:Article categories.id:OR('iabv2-52', 'diffbot-11')

You can also use the category name to specify a category using the categories.name or simply categories field. Category names are case-insensitive. Here are some examples:

type:Article categories.name:'Business and Finance'

type:Article categories:'Business and Finance'

type:Article categories.name:OR('Business and Finance', 'Funding')

type:Article categories:'business and finance'

Refer to the Article Categories taxonomy for a list of Article Categories.

Combining Article Tags and Categories

Here's an example combining both Article tags and categories in a single query

type:Article 
  categories.name:OR(
      'Funding', 'Personnel Changes',
      'Products and Services Announcements')
  tags.{
    uri:OR('Eg08yHNmgNRiif5mB-LHAyQ', 'EUFq-3WlpNsq0pvfUYWXOEA') 
    sentiment > 0.95}

Faceting by Article Tags and Categories

You can facet by Article tags or categories. Here are some examples:

type:Article date<8d
  tags.label:OR('Natalie Portman', 'Serena Williams', 
                'Beyonce', 'Joaquin Phoenix', 'Benedict Cumberbatch')
  facet:tags
  
 
type:Article date<8d
  categories.name:OR(
      'Funding', 'Personnel Changes',
      'Products and Services Announcements')
  facet:categories