Published
Edited
Aug 23, 2022
Importers
3 stars
Insert cell
# Pyxis: Domain Knowledge
Insert cell
Insert cell
Insert cell
Insert cell
import { pyxis } from "@leibatt/pyxis";
Insert cell
Insert cell
Insert cell
baltimoreCrimeJson = (await fetch("https://raw.githubusercontent.com/leibatt/pyxis/main/datasets/BPD_Part_1_Victim_Based_Crime_Data2.json")).json();
Insert cell
baltimoreCrime = pyxis.jsonObjectToDataset(baltimoreCrimeJson,"baltimoreCrimes");
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
crime = new pyxis.Concept(
"Crime", // name
[] // parentConcepts
);
Insert cell
Insert cell
crime.name
Insert cell
Insert cell
crime.parentConcepts;
Insert cell
Insert cell
nonViolentCrime = new pyxis.Concept(
"Non-violent Crime", // name
[crime] // parentConcepts
);
Insert cell
Insert cell
Insert cell
Insert cell
protest = new pyxis.Concept(
"Protest", // name
[] // parentConcepts
);
Insert cell
Insert cell
baltimoreProtests = new pyxis.Instance(
"2015BaltimoreProtests", // name
protest, // coreConcept
[crime], // relevantConcepts
{ // metadata
attributes: [{ name: "link", attributeType: pyxis.AttributeType.nominal }],
values: {"link": "https://en.wikipedia.org/wiki/2015_Baltimore_protests"},
id: "dr-2015-baltimore-protests"
}
);
Insert cell
Insert cell
baltimoreProtests.name;
Insert cell
Insert cell
baltimoreProtests.coreConcept;
Insert cell
Insert cell
baltimoreProtests.relevantConcepts
Insert cell
Insert cell
baltimoreProtests.metadata;
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
baltimoreProtestsNode = new pyxis.DomainKnowledgeNode(
"2015BaltimoreProtests", // name
baltimoreProtests
);
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more