Source: https://skl.ai/learn/ Learn # Learn SKL How SKL describes software, layer by layer, from what data means to what software does with it, shown on one small sales system. On this page What a spec is · How specs are written · An order, as it’s written · The layers · Identity · Vocabulary · Structure · Constraints · Capabilities · Mappings · User interfaces · Policies · Versions · Where SKL fits ## What a spec is A spec is a declarative definition, written in SKL, of a system’s data, capabilities, business logic, or user interfaces. It declares what something is, what it holds, and what it must meet, and where a capability needs code, its spec points at the code. Each spec has an address of its own, and specs point at each other by address: a record at its spec, and a spec at the terms and constraints it uses. The SKL Kernel reads specs as it runs, so a change to one takes effect on the next request, and every change is a version. ## How specs are written Most specs aren’t typed from nothing. There are three ways to write them, and they mix. ### Import them Import an OpenAPI description or a Postman collection, and its operations become capabilities you can call. A GraphQL or SQL schema is read as specs of the data it describes. ### Ask an AI to write them An AI can write specs from a description of what you need. The SKL Kernel checks each one against SKL’s own specs when it’s saved, and refuses one that doesn’t meet them. ### Write them yourself Specs are files, in JSON-LD or another format the SKL Kernel reads, so any editor will do. However they’re written, they are the same specs: the SKL Kernel reads them all alike, and every change to one is a version. ## An order, as it’s written Here is what an order is in a small sales system, written in JSON-LD. Its addresses are examples, and “…” marks lines left out. The layers below take it apart, and the Example follows it through the whole system. A class IdentityVersionsStructureConstraintsVocabulary JSON-LDThe context, which says what skl: stands for, outside the graph that holds the spec ``` { "@context": { "skl": "https://skl.ai/" }, "@graph": [ { ``` Identity and versionsThis version, the identity every version shares, and the namespace that owns it ``` "@id": "https://example.org/Order/v/1", "skl:sID": { "@id": "https://example.org/Order" }, "skl:namespace": { "@id": "https://example.org/sales" }, ``` StructureWhat an order is, and the properties it holds ``` "@type": "skl:Class", "skl:localId": "Order", "skl:label": "Order", "skl:hasProperty": [ ``` ConstraintsExactly one customer, and exactly one total ``` { "skl:path": { "@id": "https://example.org/customer" }, "skl:constraint/minCount": 1, "skl:constraint/maxCount": 1 }, { "skl:path": { "@id": "https://example.org/total" }, "skl:constraint/minCount": 1, "skl:constraint/maxCount": 1 }, ``` VocabularyA status, from a set of terms ``` { "skl:path": { "@id": "https://example.org/status" }, "skl:constraint/in": { "@id": "https://example.org/orderStatuses" } } ] } ] } ``` Order, from the site’s example, each part beside the layer it belongs to. ## The layers SKL describes software in layers, each built on the ones below it: a constraint checks a property, a property’s values can come from a set of terms, and everything has an address. The lower layers say what data means, the upper ones what software does with it, and policies and versions apply to every layer. Beside each layer’s name are the standards it draws on, and Why SKL says what SKL keeps from each, and why. What software does with it What data means User interfacesWhat do people see? · MappingsHow does one system’s data line up with another’s? · CapabilitiesWhat can a system do? · ConstraintsWhat must every record meet? · StructureWhat does a record hold? · VocabularyWhat do the words mean? · IdentityWhat is this, and how is it referred to? · PoliciesWho may see and do what?Beside every layer · VersionsWhat changed, and when?Beside every layer SKL’s layers, from Identity at the foundation up to User interfaces, each built on the ones below it. Policies and versions stand beside every layer. ### What data means #### Identity RDF What specs are What is this, and how is it referred to? Everything has an address of its own, an IRI, created under the namespace that owns it, so no one has to hand addresses out. An address carries no meaning of its own: rename the thing, and its address stays. See it in SKL **`@id`** `https://example.org/Order/v/1`This version of Order **`skl:sID`** `https://example.org/Order`The identity every version of it shares **`skl:namespace`** `https://example.org/sales`The namespace that owns it, under which its addresses are made **`skl:localId`** `Order`A short code, for formats such as JSON `@id``skl:namespace``skl:idPrefix` #### Vocabulary SKOS The model for term sets What do the words mean? A field’s values can come from a set of terms. Each term has an address of its own, so software reads what a value means instead of matching a word. Labels are kept apart from the terms they name, in each language needed, and a term can sit under a broader one. Each product keeps its own sets, and can map its terms to another’s. See it in SKL A term, and its label Vocabulary ``` { "@context": { "skl": "https://skl.ai/" }, "@graph": [ { "@id": "https://example.org/def/4KD8RW", "@type": "skl:vocab/TermDefinition", "skl:localId": "7Q2M9K", "skl:vocab/inVocabSet": { "@id": "https://example.org/orderStatuses" }, "skl:vocab/definition": "The order waits for a person to review it." }, { "@id": "https://example.org/label/9PX2LM", "@type": "skl:vocab/TermLabel", "skl:label": "Held for review", "skl:inLanguage": { "@id": "skl:vocab/def/06G9CF0MMWGZEFK95Q7WW7N30X" }, "skl:vocab/definitionReference": { "@id": "https://example.org/def/4KD8RW" } } ] } ``` `skl:vocab/VocabSet``skl:vocab/TermDefinition``skl:vocab/TermLabel``skl:vocab/broaderDefinition` #### Structure RDFS A few terms, used as they areGraphQL and SQL Schemas it reads as specs What does a record hold? Each property is declared once, on its own, with what it means and the kind of value it takes. A class says which properties its records hold, and can build on another class. Capabilities, mappings, and policies are described the same way, so software reads them all alike. See it in SKL A property, declared once StructureConstraints ``` { "@context": { "skl": "https://skl.ai/", "xsd": "http://www.w3.org/2001/XMLSchema#" }, "@graph": [ { "@id": "https://example.org/total/v/1", "skl:sID": { "@id": "https://example.org/total" }, "@type": "skl:Property", "skl:localId": "total", "skl:label": "Total", "skl:constraint/datatype": { "@id": "xsd:decimal" }, "skl:constraint/minInclusive": 0 } ] } ``` `skl:Property``skl:Class``skl:hasProperty``rdfs:subClassOf` #### Constraints SHACL Not used; its core is followedJSON Schema A few constraints come from it What must every record meet? Constraints sit on the spec: how many values, of which type, within which range, matching which pattern, from which set, and pointing at which kind of record. The SKL Kernel checks them when a record is saved, and refuses a record that doesn’t meet them; a call is refused when it lacks an input the capability requires. See it in SKL A saveAn ordertotal −50 The answerRefused: the total is below 0, so nothing is saved `skl:constraint/minCount``skl:constraint/datatype``skl:constraint/minInclusive``skl:constraint/pattern``skl:constraint/in``skl:constraint/class` ### What software does with it #### Capabilities OpenAPI and Postman API descriptions it reads as capabilitiesMCP A protocol it can offer capabilities over What can a system do? A capability says what it takes and what it returns, as structure with constraints. What answers it is a spec of its own: one of the SKL Kernel’s own operations, such as save or find, a piece of code, an operation of a web API, or another capability, and a switch can choose among them for each call. Apps, AI agents, and other systems call them the same way. See it in SKL A capability Capabilities ``` { "@context": { "skl": "https://skl.ai/" }, "@graph": [ { "@id": "https://example.org/placeOrder/v/1", "skl:sID": { "@id": "https://example.org/placeOrder" }, "@type": "skl:invocable/Router", "skl:localId": "placeOrder", "skl:label": "Place order", "skl:inputs": { "@id": "https://example.org/PlaceOrderInputs" }, "skl:outputs": { "@id": "https://example.org/Order" }, "skl:routerSwitch": { "@id": "https://example.org/placeOrderSwitch" } } ] } ``` `skl:invocable/Router``skl:Switch``skl:invocable/CodeBlock``skl:invocable/operation/Http``skl:inputs``skl:outputs` #### Mappings Defined by SKL How does one system’s data line up with another’s? Mappings say how one system’s records, fields, terms, and capabilities correspond to another’s, including what answers a capability, with the capability’s inputs mapped one way and the answer’s outputs mapped back. Each mapping runs in one direction, so a name split one way is joined the other way by a mapping of its own. Live systems are read and invoked without forcing a central data copy or one shared schema first. See it in SKL A correspondence MappingsVocabulary ``` { "@context": { "skl": "https://skl.ai/" }, "@graph": [ { "@id": "https://example.org/inTransitIsShipped/v/1", "skl:sID": { "@id": "https://example.org/inTransitIsShipped" }, "@type": "skl:mapping/Atomic", "skl:type": { "@id": "skl:vocab/def/06G9CF0MMY5AZX5ZHRXQSW39AF" }, "skl:sourceItem": { "@id": "https://example.org/partner/def/2RM8TZ" }, "skl:targetItem": { "@id": "https://example.org/def/7HW3QN" }, "skl:mapping/semanticCorrespondence": { "@id": "skl:vocab/def/06G9CF0MMZ5YFANDNF3TYP5YEM" } } ] } ``` `skl:mapping/Atomic``skl:mapping/Transformation``skl:mapping/InvocableBinding` #### User interfaces Defined by SKL What do people see? Pages and the components they’re built from are specs too: what a page shows, for which record, and which capability each control calls. Styles are specs as well, so a product’s look is data its user interfaces read. Its SKL terms `skl:ui/Page``skl:ui/Composition``skl:ui/Component``skl:ui/style/StyleSet` ### Across every layer #### Policies Defined by SKL Who may see and do what? SKL says how software asks who may run a capability or read which records, and an access service answers. When an AI agent acts for a person, the question can name them both, and the answer allows only what both may do. Policies are specs too: which code runs with full access and which runs locked down, and how new addresses are created. Its SKL terms `skl:authorization/authorize``skl:authorization/authorizeQuery``skl:onBehalfOf``skl:governance/CodeExecutionPolicy``skl:governance/IdCreationPolicy` #### Versions Defined by SKL What changed, and when? Every spec has versions that share one identity, so a reference to it keeps working as it changes. Two versions can be compared, and an earlier one brought back. A change can wait as a draft on a branch, and specs are published together as releases. A call can leave an activity record: who acted, for whom, which capability ran, and what came back. Its SKL terms `skl:sID``skl:versioning/status``skl:versioning/branch``skl:packaging/Release``skl:events/ActivityEvent` ## Where SKL fits Today, your software vendors each hold a piece of the definitions that determine how your business runs. Database schemas, ontologies, and code lists hold what your data means, and API descriptions say what each system can do. A semantic layer holds the terms and metrics people query by, and each AI agent is handed context of its own. SKL writes these in one language, layer by layer, and goes on to what software does with them. | If you have | In SKL | Layer | | --- | --- | --- | | Data, and what it means | | A knowledge graph | Records and specs that point at each other by address, in RDF | Identity | | Code lists and taxonomies | Sets of terms, each with an address of its own, its labels kept apart, and broader terms above it | Vocabulary | | An ontology | Classes and properties, each property declared once, on its own, and classes that build on other classes | Structure | | A database schema | The SKL Kernel reads an SQL schema as specs: tables as classes, columns as properties, their limits as constraints, and allowed values as sets of terms | Structure · Constraints | | Validation schemas | Constraints on each spec, checked when a record is saved, and a call refused when it lacks an input the capability requires | Constraints | | Data in several databases | Each kind of record kept in the database a binding names for it, and reads that find, count, and group records across them | Capabilities | | APIs, logic, and user interfaces | | An API description | Capabilities, one for each operation it lists, each saying what it takes and returns | Capabilities | | An API you serve | Operations bound to the capabilities that answer them, served with no server code | Capabilities | | Functions and scripts | Code that answers a capability, checked against what the capability takes and returns, and run locked down unless a policy trusts it | Capabilities · Policies | | Decision logic | Switches that pick what answers a call by trying conditions in order, the first that holds winning. A condition compares a field with a value, or combines others with and, or, not, and exactly one of, and the same conditions say where a policy or a set of terms applies. A change to one takes effect on the next call | Capabilities | | Field mappings | Mappings for records, fields, and terms, each running one way | Mappings | | A design system | Styles as specs, in sets that can override one another, so a product’s look is data its user interfaces read. Pages and components are specs too | User interfaces | | AI, analytics, and decisions | | Conversations with AI models | Conversations and their messages as records, each reply from a capability that bindings connect to the model provider’s API | Capabilities · Mappings | | Analytics, metrics, and measures | SKL Ontology 4.x defines measures, dimensions, and the logic behind a metric. When a read groups records, the SKL Kernel aggregates their values with sum, average, count, median, percentile, and more, by day, month, or year | Structure · Capabilities | | Requirements and decision records | Records SKL Ontology 4.x defines: requirements, decisions, assumptions, and objectives, each linked to what it is about. A decision notes the options it weighed and what follows from it, and links to the assumptions it rests on and the decision it replaces | Structure | | Access, usage, and history | | Access policies | The two questions software asks an access service, who may read which records and who may run which capability, written as capabilities that the access service you connect answers | Policies | | Credentials and sign-in | Credentials as records, each secret kept apart from them, and the two steps of a sign-in that gets a new one | Policies | | Usage limits and metering | A call can record what it used, such as tokens, time, and retries, and a usage policy caps how much of any of these a caller may use in a period: once a cap is reached, further calls in that period are refused | Policies · Versions | | Logs and traces | A record of a call kept as data you can query: who acted, for whom, which capability ran, the steps it took, and what came back. Policies say which calls keep one | Versions | | Version control | A history for every spec, and for the records of any class that opts in: drafts on branches, commits, merges that report conflicts, when each property changed and who changed it where the save names who acted, an earlier version brought back as a new one, and releases | Versions | Two of these have a pattern of their own: a semantic layer, in shared meaning for people, software, and AI, and context for AI agents, in AI agents that act within your limits. Next ### An example, end to end A small sales system, in SKL Next ### Patterns Six ways to build with SKL ## Hear when it’s published The fourth generation of SKL and the SKL Kernel will be open sourced here in 2027, with SKL Ontology 4.x, the shared specs SKL starts from. Tell us what you would build with it.