Ontology

Ontology Overview

The Ontology API provides access to the JARVIS knowledge graph -- a structured representation of entities and relationships extracted from financial events such as earnings calls, investor days, and conferences. Data is stored in Amazon Neptune as an RDF graph and queried using SPARQL.


SPARQL Fundamentals

SPARQL (SPARQL Protocol and RDF Query Language) is the W3C standard query language for RDF graph databases. It is conceptually similar to SQL but designed for querying data stored as triples.

Triples

All data in the knowledge graph is stored as triples -- statements with three parts:

Subject  ->  Predicate  ->  Object
(who)        (verb)         (what)

For example:

Tim Cook       works_for       Apple Inc
Apple Inc      competes_with   Microsoft
Tim Cook       discusses       Revenue Growth
ComponentDescriptionExamples
SubjectThe entity being describedTim Cook, Apple Inc
PredicateThe relationship or propertyworks_for, rdf:type, rdfs:label
ObjectThe value or related entityApple Inc, "Tim Cook", aiera:PERSON

URIs and Prefixes

Every resource in RDF has a unique URI. Prefixes are shortcuts that make queries readable.

Without prefix:

SELECT * WHERE {
  <http://aiera.com/ontology#Tim_Cook> <http://aiera.com/ontology#works_for> <http://aiera.com/ontology#Apple_Inc> .
}

With prefix:

PREFIX aiera: <http://aiera.com/ontology#>
SELECT * WHERE {
  aiera:Tim_Cook aiera:works_for aiera:Apple_Inc .
}

Auto-Injected Prefixes

The API automatically injects the following standard prefixes when they are used but not declared. You do not need to include PREFIX declarations for these:

PrefixURIPurposeReference
rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#Core RDF vocabularyRDF Concepts
rdfs:http://www.w3.org/2000/01/rdf-schema#RDF Schema (labels, classes)RDF Schema
xsd:http://www.w3.org/2001/XMLSchema#Data types (string, date, etc.)XML Schema
aiera:http://aiera.com/ontology#JARVIS domain vocabularyThis document

This means you can write queries without explicit prefix declarations:

SELECT ?person ?company
WHERE {
  ?person rdf:type aiera:PERSON .
  ?person aiera:works_for ?company .
}

Variables

Variables start with ? and represent unknowns to be matched:

SELECT ?person ?company WHERE {
  ?person aiera:works_for ?company .
}

The pattern ?s ?p ?o is shorthand for Subject, Predicate, Object:

SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10

Supported Query Types

TypeDescriptionReference
SELECTReturns variable bindings as a tableSELECT
ASKReturns true/false for pattern existenceASK
CONSTRUCTReturns an RDF graphCONSTRUCT
DESCRIBEReturns RDF description of resourcesDESCRIBE

Note

UPDATE operations (INSERT, DELETE, CLEAR, DROP) are blocked for safety. Only read queries are permitted.


JARVIS Ontology Schema

Entity Types

Entities are classified using rdf:type. The ontology defines 26 entity types across 6 categories:

CategoryTypesDescription
CorePERSON, ORGANIZATION, PRODUCT, LOCATION, TEMPORAL, EVENTFundamental entity types
BusinessCOMPETITOR, COMPETITIVE_PRODUCT, SUPPLIER, CUSTOMER, PEER, PARTNER, INDUSTRY_SEGMENTBusiness relationship entities
FinancialREPORTED_METRIC, COMPANY_GUIDANCE, CONSENSUS_ESTIMATE, MARKET_METRICFinancial metrics and estimates
KPIsPRIMARY_KPI, INDUSTRY_KPI, OPERATIONAL_KPIKey performance indicators
OwnershipSHAREHOLDER, ANALYST_FIRM, ANALYST_QUESTIONOwnership and analyst coverage
StrategicSTRATEGY, RISK, CATALYSTStrategic planning concepts

Relationship Predicates

Relationships connect entities. The ontology defines 34 relationship predicates:

CategoryPredicates
Employmentworks_for, leads, reports_to, serves_on_board
Businesscompetes_with, competes_with_product, peer_of, supplies_to, customer_of, partner_with, subsidiary_of, primary_player_in, secondary_player_in
Financialreports_metric, provides_guidance, beats_estimate, misses_estimate, revises_guidance, has_target
Ownershipowns_shares_in, covers_stock, rates
Eventsspeaks_at, discusses, mentions, asks_about, extracted_from
Strategicimplements, faces, expects, invests_in
Geographicoperates_in, headquartered_in, expanding_to

Common Properties

PropertyDescriptionExample
rdfs:labelHuman-readable name"Tim Cook"
aiera:rolePerson's role"CEO"
aiera:confidenceExtraction confidence0.95
aiera:sourceData source"earnings_call_12345"
aiera:timestampWhen extracted"2024-01-15T10:30:00Z"

Named Graphs

Data is organized into named graphs by event ID. Each event's extracted data is stored in GRAPH aiera:event/{event_id}, allowing you to query entities and relationships from specific events.

Reified Statements

Relationships include metadata via RDF reification -- confidence scores, effective dates, and provenance information are attached to relationship statements.


Best Practices

  1. Always use LIMIT -- queries without a LIMIT clause can return very large result sets.
  2. Be specific with patterns -- use rdf:type to narrow matches to specific entity types.
  3. Filter early -- place FILTER clauses as close to the relevant triple patterns as possible.
  4. Use OPTIONAL sparingly -- each OPTIONAL can multiply query execution time.
  5. Select only needed variables -- SELECT ?name ?role is more efficient than SELECT *.

Further Reading

Previous
Delete Transcrippet™