semantics: Semantic

semanticsR Documentation

Semantic

Description

The Semantic API complements the Articles API. With the Semantic API, you get access to the long list of people, places, organizations and other locations, entities and descriptors that make up the controlled vocabulary used as metadata by The New York Times (sometimes referred to as Times Tags and used for Times Topics pages.

Usage

ny_semantic_search(q, pages = 1, fields = "all")

ny_semantic_concept(
  concept,
  q = NULL,
  type = c("nytd_geo", "nytd_per", "nytd_org", "nytd_des"),
  fields = "all"
)

Arguments

q

Precedes the search term string. Used in a Search Query. Except for specific_concept_name, Search Query will take the required parameters listed above (concept_type, concept_uri, article_uri) as an optional_parameter in addition to the query set to a query_term.

pages

Number of pages of results to collect.

fields

all or a vector of specific optional fields (see fields section).

concept

The name of the concept, used for Constructing a Semantic API Request by Concept Type and Specific Concept Name, i.e.: baseball.

type

The type of the concept, used for Constructing a Semantic API Request by Concept Type and Specific Concept Name.

Fields

Valid values for the fields argument and they explanation.

  • all - All values.

  • pages - A list of topic pages associated with a specific concept.

  • ticker_symbol - If this concept is a publicly traded company, this field contains the ticker symbol.

  • links - A list of links from this concept to external data resources.

  • taxonomy - For descriptor concepts, this field returns a list of taxonomic relations to other concepts.

  • combinations - For descriptor concepts, this field returns a list of the specific meanings tis concept takes on when combined with other concepts.

  • geocodes - For geographic concepts, the full GIS record from geonames.

  • article_list - A list of up to 10 articles associated with this concept.

  • scope_notes - Scope notes contains clarifications and meaning definitions that explicate the relationship between the concept and an article.

  • search_api_query - Returns the request one would need to submit to the Article Search API to obtain a list of articles annotated with this concept.

Examples

## Not run: 
nytimes_key("xXXxxXxXxXXx")
war <- ny_semantic_search("war")
war <- ny_semantic_concept("baseball", type = "nytd_des")

## End(Not run)


news-r/nytimes documentation built on Sept. 7, 2024, 1:02 a.m.