import { Lens } from "https://deno.land/x/ldkit/mod.ts";
Find entities that match the given IRIs.
Examples
Example 1
Example 1
import { createLens } from "ldkit";
import { schema } from "ldkit/namespaces";
// Create a schema
const PersonSchema = {
"@type": schema.Person,
name: schema.name,
} as const;
// Create a resource using the data schema above
const Persons = createLens(PersonSchema);
// Get specific persons identified by IRIs
const matches = await Persons.findByIris([
"http://dbpedia.org/resource/Ada_Lovelace",
"http://dbpedia.org/resource/Alan_Turing"
]);
console.log(matches[0].name); // string "Ada Lovelace"
console.log(matches[1].name); // string "Alan Turing"