DSL Query Schemas
We use Prisma internally to manage the relations between each of our different data models. The Aviato DSL also supports filtering across relations.
Schema
1 datasource db { 2 provider = "postgresql" 3 url = env("DATABASE_URL") 4 } 5 6 model School { 7 id String @id 8 fullName String 9 entityType EntityType 10 location String? 11 locationCoordinates Unsupported("GEOMETRY(Point, 4326)")? 12 locationIDList Int[] 13 country String? 14 locality String? 15 region String? 16 URLs Json? 17 educationDegreeLinks EducationDegreeLink[] 18 personEducationLinks PersonEducationLink[] 19 workExperienceLinks WorkExperienceLink[] 20 } 21 22 model CompanyFund { 23 id Int @id 24 name String? 25 date DateTime? 26 amountRaised Float? 27 companyID String? 28 fundOwner Company? @relation("fundOwner", fields: [companyID], references: [id], onDelete: Cascade) 29 personInvestorList Person[] @relation("CompanyFundToPerson") 30 companyInvestorList Company[] @relation("CompanyToCompanyFund") 31 } 32 33 model CompanyInvestmentLink { 34 totalAmountRaised Float? 35 date DateTime? 36 personID String? 37 companyInvestorID String? 38 companyID String? 39 id Int @id 40 company Company? @relation("companyInvestmentLinkTargets", fields: [companyID], references: [id], onDelete: Cascade) 41 companyInvestor Company? @relation("companyInvestmentLinkInvestors", fields: [companyInvestorID], references: [id], onDelete: Cascade) 42 person Person? @relation(fields: [personID], references: [id], onDelete: Cascade) 43 } 44 45 model FundingRound { 46 id Int @id 47 announcedOn DateTime? 48 moneyRaised Float? 49 name String? 50 stage String? 51 isHidden Boolean? 52 valuation Json? 53 valuationPostRound Json? 54 issuePrice Float? 55 outstandingShares Float? 56 companyID String? 57 company Company? @relation(fields: [companyID], references: [id], onDelete: Cascade) 58 leadPersonInvestorList Person[] @relation("leadPersonInvestor") 59 leadCompanyInvestorList Company[] @relation("leadCompanyInvestor") 60 personInvestorList Person[] @relation("personInvestor") 61 companyInvestorList Company[] @relation("companyInvestor") 62 } 63 64 model Person { 65 id String @id(map: "Person_pkey") 66 fullName String 67 headline String? 68 entityType EntityType? 69 location String? 70 locationIDList Int[] 71 URLs Json? 72 gender String? 73 investedRoundList String[] 74 investedIndustries String[] 75 investorCategoryList String[] 76 investorCurrentFirmID String? 77 investorDisinterests String? 78 investorFirmPosition String? 79 investorInterests String? 80 investorMaxInvestment Float? 81 investorMinInvestment Float? 82 investorParticipatedRoundsCount Int? 83 investorPreviousFirmID String? 84 investorPreviousFirmPosition String? 85 investorTargetInvestment Float? 86 investorTitle String? 87 investorType String? 88 emailList String[] 89 researchPaperCount Int? 90 researchPapers Json[] 91 country String? 92 locality String? 93 region String? 94 computed_oneYearAtCurrentCompany Boolean? 95 computed_employeeDuringMA Boolean? 96 computed_founderDuringMA Boolean? 97 computed_employeeDuringIPO Boolean? 98 computed_likelyToExplore Boolean? 99 computed_unicornEarlyEngineer Boolean? 100 computed_employeeDuringBigMA Boolean? 101 computed_potentialToLeave Boolean? 102 computed_topUniversity Boolean? 103 computed_bigTechAlumPublic Boolean? 104 computed_bigTechAlumPrivate Boolean? 105 computed_priorBackedFounder Boolean? 106 computed_recentlyLeftCompany Boolean? 107 computed_investmentCount Int? 108 computed_totalRaised Float? 109 companiesFoundedList CompanyFoundingLink[] 110 outboundInvestmentList CompanyInvestmentLink[] 111 degreeList EducationDegreeLink[] 112 educationList PersonEducationLink[] 113 experienceList WorkExperienceLink[] 114 participatedInvestorCompanyFundList CompanyFund[] @relation("CompanyFundToPerson") 115 participatedLeadInvestorFundingRoundList FundingRound[] @relation("leadPersonInvestor") 116 participatedInvestorFundingRoundList FundingRound[] @relation("personInvestor") 117 } 118 119 model WorkExperienceLink { 120 id BigInt 121 endDate DateTime? 122 startDate DateTime? 123 seniorityScore Int? 124 description String? 125 entityType EntityType 126 positionList Json[] 127 investmentInfo Json? 128 companyID String 129 schoolID String? 130 personID String 131 companyName String? 132 companyIsStealth Boolean? 133 person Person @relation(fields: [personID], references: [id], onDelete: Cascade) 134 company Company? @relation(fields: [companyID], references: [id], onDelete: Cascade, map: "company_entityID") 135 school School? @relation(fields: [schoolID], references: [id], onDelete: Cascade) 136 137 @@id([id, companyID]) 138 } 139 140 model PersonEducationLink { 141 id BigInt @id 142 endDate DateTime? 143 startDate DateTime? 144 name String? 145 subject String? 146 schoolID String? 147 personID String 148 person Person @relation(fields: [personID], references: [id], onDelete: Cascade) 149 school School? @relation(fields: [schoolID], references: [id], onDelete: Cascade) 150 degree EducationDegreeLink[] 151 } 152 153 model CompanyFoundingLink { 154 id Int @id 155 companyID String 156 personID String 157 person Person @relation(fields: [personID], references: [id], onDelete: Cascade) 158 company Company @relation(fields: [companyID], references: [id], onDelete: Cascade, map: "company_entityID") 159 } 160 161 model EducationDegreeLink { 162 id BigInt @id 163 fieldOfStudy String? 164 name String? 165 schoolID String? 166 personID String 167 endDate DateTime? 168 startDate DateTime? 169 person Person @relation(fields: [personID], references: [id], onDelete: Cascade) 170 school School? @relation(fields: [schoolID], references: [id], onDelete: Cascade, map: "school_entityID") 171 personEducationID BigInt? 172 personEducation PersonEducationLink? @relation(fields: [personEducationID], references: [id], onDelete: Cascade) 173 } 174 175 model Company { 176 id String @id 177 name String? 178 description String? 179 location String? 180 locationCoordinates Unsupported("GEOMETRY(Point, 4326)")? 181 locationIDList Int[] 182 tagline String? 183 founded DateTime? 184 yearFounded Int? 185 industryList String[] 186 headcount Int? 187 exitCount Int? 188 isStealth Boolean? 189 isStartup Boolean? 190 country String? 191 region String? 192 locality String? 193 URLs Json? 194 financingStatus String? 195 ownershipStatus String? 196 status String? 197 ipoDate DateTime? 198 latestDealType String? 199 latestDealDate DateTime? 200 latestDealAmount Float? 201 investmentCount Int? 202 investorCount Int? 203 legalName String? 204 leadInvestorCount Int? 205 leadInvestmentCount Int? 206 totalFunding Float? 207 acquisitionCount Int? 208 stockExchange String? 209 stockSymbol String? 210 participatedRoundList String[] 211 fundingRoundCount Int? 212 signals String[] 213 lastRoundValuation Float? 214 outstandingShares Float? 215 sharePrice Float? 216 sharePriceHistorical Json? 217 targetMarketList String[] 218 webEngagement Json? 219 webTrafficSources Json? 220 webViewerCountries Json? 221 weeklyFacebookChange Float? 222 weeklyFacebookPercent Float? 223 monthlyFacebookChange Float? 224 monthlyFacebookPercent Float? 225 triMonthlyFacebookChange Float? 226 triMonthlyFacebookPercent Float? 227 yearlyFacebookChange Float? 228 yearlyFacebookPercent Float? 229 weeklyWebTrafficChange Float? 230 weeklyWebTrafficPercent Float? 231 monthlyWebTrafficChange Float? 232 monthlyWebTrafficPercent Float? 233 triMonthlyWebTrafficChange Float? 234 triMonthlyWebTrafficPercent Float? 235 yearlyWebTrafficChange Float? 236 yearlyWebTrafficPercent Float? 237 weeklyTwitterChange Float? 238 weeklyTwitterPercent Float? 239 monthlyTwitterChange Float? 240 monthlyTwitterPercent Float? 241 triMonthlyTwitterChange Float? 242 triMonthlyTwitterPercent Float? 243 yearlyTwitterChange Float? 244 yearlyTwitterPercent Float? 245 monthlyHeadcountChange Float? 246 monthlyHeadcountPercent Float? 247 triMonthlyHeadcountChange Float? 248 triMonthlyHeadcountPercent Float? 249 yearlyHeadcountChange Float? 250 yearlyHeadcountPercent Float? 251 facebookLikes Float? 252 twitterFollowers Float? 253 linkedinFollowers Float? 254 currentWebTraffic Float? 255 facebookHistorical Json? 256 twitterHistorical Json? 257 headcountHistorical Json? 258 webTrafficHistorical Json? 259 relativeHeadcountHistorical Json? 260 producthuntFollowerCount Int? 261 producthuntAvgRating Float? 262 producthuntTotalVotes Int? 263 productList Json? 264 screenshotList String[] 265 timeline Json[] 266 CIKNumber String? 267 businessModelList String[] 268 legalEntityID String? 269 marketCap Float? 270 patentCount Int? 271 cageCode String? 272 dunsNumber String? 273 NAICSCode String? 274 equityCompensation Json? 275 monetaryCompensation Json? 276 departmentMonetaryCompensation Json? 277 jobListingList Json[] 278 video Json? 279 embeddedNews Json[] 280 isAcquired Boolean? 281 incomeSourceList String[] 282 isGovernment Boolean? 283 isNonProfit Boolean? 284 isVCFirm Boolean? 285 techStackList Json[] 286 isExited Boolean? 287 isShutDown Boolean? 288 jobFamilyList String[] 289 paySchedule String? 290 salaryBreakdownList Json[] 291 vestingDetails String? 292 vestingScheduleList Json[] 293 vestingType String? 294 generalLevelList String[] 295 customerTypes CustomerType[] 296 g2AverageStars Float? 297 g2ReviewCount Int? 298 g2UserRatings Json? 299 weeklyG2StarsChange Float? 300 weeklyG2StarsPercent Float? 301 monthlyG2StarsChange Float? 302 monthlyG2StarsPercent Float? 303 triMonthlyG2StarsChange Float? 304 triMonthlyG2StarsPercent Float? 305 yearlyG2StarsChange Float? 306 yearlyG2StarsPercent Float? 307 weeklyG2ReviewCountChange Float? 308 weeklyG2ReviewCountPercent Float? 309 monthlyG2ReviewCountChange Float? 310 monthlyG2ReviewCountPercent Float? 311 triMonthlyG2ReviewCountChange Float? 312 triMonthlyG2ReviewCountPercent Float? 313 yearlyG2ReviewCountChange Float? 314 yearlyG2ReviewCountPercent Float? 315 computed_tags String[] 316 cardTransaction Json[] 317 cardRevenue Json[] 318 cardTransactionsStability Json[] 319 cardRevenueGrowth Json[] 320 cardCustomers Json[] 321 stockPriceHistorical Json? 322 significantDevelopments Json? 323 historicalFinancials Json? 324 g2StarsHistorical Json? 325 g2ReviewCountHistorical Json? 326 theorgFollowerCount Int? 327 ownedPatents Json? 328 governmentAwards Json? 329 computed_percentChangeInDepartmentHeadcount Json? 330 computed_departmentHeadcounts Json? 331 computed_departmentHeadcountsHistorical Json? 332 computed_departmentCountryHeadcounts Json? 333 computed_departmentCountryHeadcountsHistorical Json? 334 computed_departmentCountryHeadcountsAbsolute Json? 335 computed_departmentPercentChangeCountryHeadcounts Json? 336 computed_funding Json? 337 investedIndustryList String[] 338 investedRoundList String[] 339 maxInvestment Float? 340 minInvestment Float? 341 targetInvestment Float? 342 investorType String? 343 computed_investmentCount Int? 344 computed_exitedInvestmentCount Int? 345 computed_IPOedInvestmentCount Int? 346 computed_acquiredInvestmentCount Int? 347 computed_shutdownAndExitedInvestmentCount Int? 348 computed_shutdownInvestmentCount Int? 349 computed_operatingInvestmentCount Int? 350 computed_founded DateTime? 351 acquiredBy CompanyAcquisitionLink? @relation("acquiree") 352 acquisitionList CompanyAcquisitionLink[] @relation("acquirer") 353 companyFoundingLinks CompanyFoundingLink[] 354 inboundInvestmentList CompanyInvestmentLink[] @relation("companyInvestmentLinkTargets") 355 outboundInvestmentList CompanyInvestmentLink[] @relation("companyInvestmentLinkInvestors") 356 fundingRoundList FundingRound[] 357 workExperienceLinks WorkExperienceLink[] 358 participatedLeadInvestorFundingRoundList FundingRound[] @relation("leadCompanyInvestor") 359 participatedInvestorFundingRoundList FundingRound[] @relation("companyInvestor") 360 participatedInvestorCompanyFundList CompanyFund[] @relation("CompanyToCompanyFund") 361 fundList CompanyFund[] @relation("fundOwner") 362 } 363 364 model CompanyAcquisitionLink { 365 id Int @id 366 announcedOn DateTime? 367 acquirerName String? 368 acquireeName String? 369 price Float? 370 acquireeCompanyID String? @unique 371 acquirerCompanyID String? 372 acquireeCompany Company? @relation("acquiree", fields: [acquireeCompanyID], references: [id], onDelete: Cascade) 373 acquirerCompany Company? @relation("acquirer", fields: [acquirerCompanyID], references: [id], onDelete: Cascade) 374 } 375 376 enum EntityType { 377 person 378 company 379 school 380 organization 381 } 382 383 enum CustomerType { 384 B2B 385 B2C 386 B2G 387 }
Examples
To find all people who are currently employed at Google, first make a DSL nameQuery
or call the enrich
to find the aviato ID for google. Then, make the following DSL
1 { 2 "offset": 0, 3 "limit": 100, 4 "filters": [ 5 { 6 "AND": [ 7 { 8 "experienceList.company.id": { 9 "operation": "eq", 10 "value": "H3TGFhoSrYx454dgVH6xL5EqXuW9dkb" // The ID for google 11 } 12 }, 13 { 14 "experienceList.endDate": { 15 "operation": "eq", 16 "value": null 17 } 18 } 19 ] 20 } 21 ], 22 }