GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • LDkit
  • Documentation
  • API Reference

This view

  • Original page
  • New address

GeezerVison is showing ldkit.io — LDkit · Linked Data query toolkit for TypeScript developers

LDkit

Linked Data query toolkit
for TypeScript developers

npm i ldkit

1. Create data schema

Specify entities to retrieve and their properties. Various data types, optional properties, arrays and language annotated literals are supported.

import { dbo, rdfs, xsd } from "ldkit/namespaces";

const PersonSchema = {
  "@type": dbo.Person,
  name: rdfs.label,
  abstract: dbo.abstract,
  birthDate: {
    "@id": dbo.birthDate,
    "@type": xsd.date,
  },
} as const;

2. Set up data source

Use a SPARQL query endpoint, or any other RDF data source.

import { type Options, setGlobalOptions } from "ldkit";

const options = {
  sources: ["https://dbpedia.org/sparql"],
} satisfies Options;

setGlobalOptions(options);

3. Fetch data!

Convert data Schema to a Lens and fetch data with one line of code. Data gets transformed from RDF to native TypeScript automatically.

import { createLens } from "ldkit";

const Persons = createLens(PersonSchema);

const adaIri = "http://dbpedia.org/resource/Ada_Lovelace";
const ada = await Persons.findByIri(adaIri);

console.log(ada.name); // Ada Lovelace
console.log(ada.birthDate); // Date object of 1815-12-10

Read the documentation

Next-gen RDF abstraction

Query RDF data from any source effortlessly.

First class TypeScript

Best in class developer experience. Fully typed workflow.

Deploy anywhere

LDkit runs in browser, Deno and Node.

RDF/JS compliant

Compatible or built upon all the popular RDF/JS libraries

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.