Model

Define the vocabulary that describes your domain

Each dataspace has a namespace ontology where you define the classes and properties of your domain. It lives in the admin application, which shares your base URI with an admin. subdomain prefix: for the end-user app at https://localhost:4443/, the ontology document is https://admin.localhost:4443/ontologies/namespace/.

Northwind reuses Schema.org terms rather than inventing its own, so "modeling" here means declaring which classes the app works with and how they should be labeled:

@prefix :	    <#> .
@prefix rdfs:	<http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:    <http://www.w3.org/2002/07/owl#> .
@prefix schema: <https://schema.org/> .

: a owl:Ontology .

schema:ProductGroup a owl:Class ;
    rdfs:label "Product group" ;
    rdfs:isDefinedBy : .

schema:Product a owl:Class ;
    rdfs:label "Product" ;
    rdfs:isDefinedBy : .

schema:Order a owl:Class ;
    rdfs:label "Order" ;
    rdfs:isDefinedBy : .

In the browser

Open the admin application and edit the namespace ontology document directly, or follow the Change model guide, which also shows how to add SPIN constructors to classes — the templates that drive "create instance" forms in the UI.

From the command line

Append the class definitions from ns.ttl to the namespace ontology document with POST. The prepended @base makes the : prefix resolve to ${base}ns# — the terms belong to the end-user namespace even though the ontology document lives in the admin app:

admin_base="https://admin.localhost:4443/"

{ echo "@base <${base}ns> ."; cat ns.ttl; } | post.sh \
    -f "$cert_pem_file" \
    -p "$cert_password" \
    --content-type "text/turtle" \
    "${admin_base}ontologies/namespace/"

Ontologies are cached in memory, so tell the application to reload it:

clear-ontology.sh \
    -f "$cert_pem_file" \
    -p "$cert_password" \
    -b "$admin_base" \
    --ontology "${base}ns#"

What you now see

The ontology document in the admin app renders your classes with their labels. The visible payoff on the end-user side comes in the next stage: resources imported as schema:Product or schema:Order arrive typed and labeled, and the model is what the UI uses to render and create them.

How this works

  • Ontologies — namespace ontologies, imports and caching
  • Change model — classes, constructors and constraints from the UI

Next: Data