Skip to content

Instantly share code, notes, and snippets.

View sebilasse's full-sized avatar

Sebastian Lasse sebilasse

View GitHub Profile
@sebilasse
sebilasse / wikiUtil.ts
Created March 7, 2025 11:23
wd utils (v1.1) to `as`, as described to max in fedi
import { AsObjectNormalized } from "@AS";
import { HEADERS } from "@/lib/constants.ts";
import { createHash } from "https://deno.land/[email protected]/hash/mod.ts";
export interface WikiPropertyVar {
name: string;
property: string;
container: string | string[];
type: string | string[];
functional: boolean;
@sebilasse
sebilasse / wikidataToAS.ts
Last active March 7, 2025 11:24
abstracted wd (v1.1) to `as`, as described to max in fedi
import { Redaktor } from "@/API/context/index.ts"; // Context Factory
import { AsLinkObject } from "@AS"; // Type
import { WBK, simplifySnak, simplifyQualifiers } from "https://esm.sh/[email protected]";
import wellKnownIDS from "@/data/wellKnownIDS.json" with { type: "json" };
// useful for well known ids like ISO, ISBN etc ... {"Q142": "FR" ... ...}
import { wdPropertyToAS, wdToNameQualifier } from "@/data/PROPERTY/_PROPERTY.ts";
// what goes to as containers like image, icon, attachment etc. and which Qualifiers to use ...
// first parser result with qualified statements and Quantity / Unit // WIP ...
{
"type": [
"Place",
"redaktor:Factual",
"redaktor:Topic",
"wd:Q3624078",
"wd:Q6256",
"redaktor:ADM0",
@sebilasse
sebilasse / osmToASPlace.ts
Created January 9, 2025 19:58
OSM Place to ActivityPub (WIP)
import { AsLocation, AsLinkObject, AsObjectNormalized } from "@AS";
import { OsmRes, NominatimRes, NominatimLookup } from '../interfaces.d.ts';
import { ASUnits } from "../context/index.ts";
import { getSitelinkUrl } from "../wikidata.ts";
export interface LocationFeatureSpecification {
/* amenity */
propertyID?: string;
/* restaurant */
value?: any; /* string | boolean | number | https://schema.org/StructuredValue; */
/* osm:979019920 */
@sebilasse
sebilasse / ActivityPubNormalize.ts
Last active January 5, 2025 11:05
Normalize and inflate ActivityPub
import { IS_BROWSER } from "$fresh/runtime.ts";
import {
APall, RedaktorActor, AsActivity, AsObject,
AsObjectNormalized, AsLinkObject, AsCollection
} from './interfaces.d.ts';
import {
AsActors, AsActivities, AsObjects, AsLinks
} from './ActivityPubInfo.ts';
import { Object as asObject } from "jsr:@fedify/fedify";
import DOMPurify from '$dompurify';
import plugin from 'tailwindcss/plugin';
// const maxScreenWidth = 3800;
const maxContainerWidth = 640;
const media = {
square: { min: 305, dif: 21, start: 15, '--l': '15', '--apt': '100%', '--ar': '1 / 1' }
};
const ratios = [ // [w,h]
// landscape
@sebilasse
sebilasse / wikidataToASPlace.ts
Created August 4, 2024 13:10
abstracted wd to as as described to max
// import wikidata from "https://esm.sh/[email protected]";
import { WBK } from "https://esm.sh/[email protected]";
import { createHash } from "https://deno.land/[email protected]/hash/mod.ts";
import { HEADERS } from "@/lib/constants.ts";
import { quantityToAS } from "./Unit.ts";
import { Redaktor } from "./context/index.ts";
// import { WikidataSPARQL } from "./context/indexCheck.ts";
const wikidata = WBK({

In advance

For decades, a wide variety of transportation orders were placed by telephone with local providers. Whether ordering a cab or food, courier trips or ridesharing - the contact, for example, to the often cooperative cab center, formed by local cab entrepreneurs, was established by phone call. For the past 10 years, national and global players have been pushing their way into passenger, food and courier transport services: Uber, Lieferando, Flix, BlablaCar - all with centralized IT structures, all profit-driven. By means of new decentralized, federated IT services, local providers of transport services can emancipate themselves from the expanding platform capitalists and establish their own powerful service brands. By using their own IT networks, cab, delivery and other types of transport can switch local customers from centralized to their own decentralized services.

Goal

An IT system with the following features is to be created for the cab industry as an example for many types of transp

@sebilasse
sebilasse / DE_districts.json
Created December 15, 2023 08:02
Taxiteam Ortsteile
This file has been truncated, but you can view the full file.
{
"Q1055": {
"id": "Q1055",
"kreisfrei": true,
"name": "Hamburg, Freie und Hansestadt",
"amt": "02000000",
"children": {
"Bezirk Altona": [
"Q1630",
{
@sebilasse
sebilasse / WMIdetails.ts
Last active June 8, 2023 11:42
VIN WMI details mit wikidata für Clemens
// source: wikidata.org - All structured data from the main, Property, Lexeme, and EntitySchema namespaces is available under CC0
// seeAlso: https://en.wikipedia.org/wiki/Vehicle_identification_number#List_of_common_WMI
const [t, vm, vg, vb] = [' Motor Company', 'Van/MPV ', 'Van/Cargo ', '“bus” '];
const [
A,a,AM,
B,b,BM,
C,c,cb,ch,CT,CV,
D,d,ds,dm,DU,
E,e,F,f,ft,fu,
G,Gd,g,ge,