UNPKG

lincd-quora-ads

Version:

An API wrapper for Quora's Ads API.

37 lines (30 loc) 1.41 kB
import { NamedNode } from "lincd/lib/models"; import { JSONLD } from "lincd-jsonld/lib/utils/JSONLD"; import { createNameSpace } from "lincd/lib/utils/NameSpace"; import { linkedOntology } from "../package"; //import all the exports of this file as one variable called _this (we need this at the end) import * as _this from "./qads"; /** * Load the data of this ontology into memory, thus adding the properties of the entities of this ontology to the local graph. */ export var loadData = () => { return import("../data/qads.json").then((data) => JSONLD.parse(data)); }; /** * The namespace of this ontology, which can be used to create NamedNodes with URI's not listed in this file */ export var ns = createNameSpace("http://www.lincd.org/quora-ads#"); /** * The NamedNode of the ontology itself */ export var _self: NamedNode = ns(""); //A list of all the entities (Classes & Properties) of this ontology, each exported as a NamedNode export var QuoraAPI: NamedNode = ns("QuoraAPI"); export var exampleProperty: NamedNode = ns("exampleProperty"); //An extra grouping object so all the entities can be accessed from the prefix/name export const qads = { QuoraAPI, exampleProperty, }; //Registers this ontology to LINCD.JS, so that data loading can be automated amongst other things linkedOntology(_this, ns, "qads", loadData, "../data/qads.json");