ns.1024.gdn

The K·D·L Vocabulary

Abstract

The K·D·L vocabulary provides useful terms for representing the data structures of the markup language K·D·L in R·D·F.

1. Introduction

1.1 Purpose and Scope

K·D·L is a minimal language aimed at conveying configurations and serializations of data. At times, it may be necessary to represent a K·D·L document in X·M·L, so that it may be processed with ordinary X·M·L tooling. The most straightforward way of doing this would be to translate the K·D·L data structure into R·D·F semantics, and then serialize the resulting R·D·F into X·M·L. The K·D·L vocabulary provides the necessary terms for this effort.

The namespace for the K·D·L vocabulary is https://ns.1024.gdn/KDL/#.

1.2 Relationship to Other Vocabularies

The K·D·L vocabulary only relies on a few terms from the core R·D·F vocabularies.

In this document, the following prefixes are used to represent the following strings :⁠—

Prefix Expansion
kdl: https://ns.1024.gdn/KDL/#
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
xsd: http://www.w3.org/2001/XMLSchema#

1.3 Term Status

Terms in this document are categorized according to one the five following term statuses :⁠—

stable (✅)

The term has widely‐accepted usage.

testing (🔬)

The term is currently being used in some applications, but its exact meaning has not yet settled.

dependency (📥)

The term is not currently being used directly, but its definition informs the usage of a stable or testing term. (This value is not a part of the original term status definition.)

unstable (🚧)

The term is not currently being used in a widespread fashion, but experiments into its utility are taking place. Its usage may change significantly in the future.

archaic (🦖)

The term was once widely‐used, but such usage is considered outdated and is discouraged.

1.4 Definitions for Computers

There is an Owl ontology for the main vocabulary and a separate ontology for K·D·L namespaces (which imports the former). Both are provided in a J·son‐L·D format suitable for viewing with, e·g, Protégé. The term definitions seen on this page are derived from the Owl definitions.

There also exist two J·son‐L·D contexts :⁠— a J·son‐L·D context for the main vocabulary and a J·son‐L·D context for K·D·L namespaces (which, again, makes reference to the former).

Generally, only stable and testing terms will be included in the J·son‐L·D contexts for this vocabulary. If you need to use an unstable term, you will need to define it yourself.

1.5 Using this Vocabulary

For the following steps, the notation ‹ (<namespace> localName) › indicates an X·M·L expanded name in the namespace namespace and with a local name of localName.

To map a K·D·L document into X·M·L, create an element :⁠—

To map a K·D·L node into X·M·L, create an element :⁠—

To map a K·D·L argument into X·M·L, create an element :⁠—

To map a K·D·L property into X·M·L, create an element :⁠—

To map a non‐null K·D·L value into X·M·L, create an element :⁠—

To map a null K·D·L value into X·M·L, create an element :⁠—

To map a K·D·L type annotation into X·M·L, create an element :⁠—

A sample serialization is as follows :⁠—

<!DOCTYPE Document [
  <!ENTITY boolean "http://www.w3.org/2001/XMLSchema#boolean">
  <!ENTITY decimal "http://www.w3.org/2001/XMLSchema#decimal">
  <!ENTITY integer "http://www.w3.org/2001/XMLSchema#integer">
  <!ENTITY string "http://www.w3.org/2001/XMLSchema#string">
]>
<Document
  xmlns="https://ns.1024.gdn/KDL/#"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
  <hasNodes rdf:parseType="Collection">
    <Node>
      <hasName rdf:value="package"/>
      <hasChildren rdf:parseType="Collection">
        <Node>
          <hasName rdf:value="name"/>
          <hasParameters rdf:parseType="Collection">
            <Argument>
              <rdf:value rdf:datatype="&string;">my-pkg</rdf:value>
            </Argument>
          </hasParameters>
        </Node>
        <Node>
          <hasName rdf:value="version"/>
          <hasParameters rdf:parseType="Collection">
            <Argument>
              <rdf:value rdf:datatype="&string;">1.2.3</rdf:value>
            </Argument>
          </hasParameters>
        </Node>
        <Node>
          <hasName rdf:value="dependencies"/>
          <hasChildren rdf:parseType="Collection">
            <Node>
              <hasName rdf:value="lodash"/>
              <hasParameters rdf:parseType="Collection">
                <Argument>
                  <rdf:value rdf:datatype="&string;">^3.2.1</rdf:value>
                </Argument>
                <Property>
                  <hasName rdf:value="optional"/>
                  <rdf:value rdf:datatype="&boolean;">true</rdf:value>
                </Property>
                <Property>
                  <hasName rdf:value="alias"/>
                  <rdf:value rdf:datatype="&string;">underscore</rdf:value>
                </Property>
              </hasParameters>
            </Node>
          </hasChildren>
        </Node>
        <Node>
          <hasName rdf:value="scripts"/>
          <hasChildren rdf:parseType="Collection">
            <Node>
              <hasName rdf:value="build"/>
              <hasParameters rdf:parseType="Collection">
                <Argument>
                  <rdf:value rdf:datatype="&string;">
      echo "foo"
      node -c "console.log('hello, world!');"
      echo "foo" > some-file.txt
    </rdf:value>
                </Argument>
              </hasParameters>
            </Node>
          </hasChildren>
        </Node>
      </hasChildren>
    </Node>
  </hasNodes>
</Document>

Just for fun, here is the same document as Json‐L·D :⁠—

{ "@context": "https://ns.1024.gdn/KDL/context.jsonld"
, "@type": "Document"
, "hasNodes":
  [ { "@type": "Node"
    , "hasName": { "value": "package" }
    , "hasChildren":
      [ { "@type": "Node"
        , "hasName": { "value": "name" }
        , "hasParameters":
          [ { "@type": "Argument"
            , "value":
              { "@type": "string"
              , "@value": "my-pkg" } } ] }
      , { "@type": "Node"
        , "hasName": { "value": "version" }
        , "hasParameters":
          [ { "@type": "Argument"
            , "value":
              { "@type": "string"
              , "@value": "1.2.3" } } ] }
      , { "@type": "Node"
        , "hasName": { "value": "dependencies" }
        , "hasChildren":
          [ { "@type": "Node"
            , "hasName": { "value": "lodash" }
            , "hasParameters":
              [ { "@type": "Argument"
                , "value":
                  { "@type": "string"
                  , "@value": "^3.2.1" } }
              , { "@type": "Property"
                , "hasName": { "value": "optional" }
                , "value":
                  { "@type": "boolean"
                  , "@value": "true" } }
              , { "@type": "Property"
                , "hasName": { "value": "alias" }
                , "value":
                  { "@type": "string"
                  , "@value": "underscore" } } ] } ] }
      , { "@type": "Node"
        , "hasName": { "value": "scripts" }
        , "hasChildren":
          [ { "@type": "Node"
            , "hasName": { "value": "build" }
            , "hasParameters":
              [ { "@type": "Argument"
                , "value":
                  { "@type": "string"
                  , "@value": "\n      echo \"foo\"\n      node -c \"console.log('hello, world!');\"\n      echo \"foo\" > some-file.txt\n    " } } ] } ] } ] } ] }

Namespace support can be added by simply supplying a expanded form, local part, namespace, and prefix on every has name element.

3. Dictionary of Terms

3.1 Class Definitions

3.1.1 Argument (kdl:Argument)

I·R·I

https://ns.1024.gdn/KDL/#Argument

Subclass Of

kdl:Parameter

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

stable

An argument to a K·D·L Node.

3.1.2 Document (kdl:Document)

I·R·I

https://ns.1024.gdn/KDL/#Document

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

stable

A K·D·L document; i·e list of Nodes.

3.1.3 Identifier (kdl:Identifier)

I·R·I

https://ns.1024.gdn/KDL/#Identifier

Subclass Of

rdf:value only xsd:string

rdf:value exactly 1

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

stable

A K·D·L identifier.

3.1.4 List (rdf:List)

I·R·I

http://www.w3.org/1999/02/22-rdf-syntax-ns#List

Is Defined By

https://www.w3.org/TR/rdf-schema

Term Status

stable

A (Lisp‐like) list of things.

3.1.5 Node (kdl:Node)

I·R·I

https://ns.1024.gdn/KDL/#Node

Subclass Of

kdl:hasName some owl:Thing

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

stable

A single K·D·L node.

3.1.6 Null Parameter (kdl:NullParameter)

I·R·I

https://ns.1024.gdn/KDL/#NullParameter

Equivalent Class

kdl:isNull value "true"⁠^^⁠xsd:boolean

Subclass Of

rdf:value max 0

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

stable

A value·less parameter to a K·D·L Node.

This class is implied by is null being true, so there usually isn’t any reason to specify it explicitly.

3.1.7 Parameter (kdl:Parameter)

I·R·I

https://ns.1024.gdn/KDL/#Parameter

Equivalent Class

kdl:Argument or kdl:Property

Subclass Of

rdf:value only (xsd:string or xsd:boolean or xsd:integer or xsd:decimal)

rdf:value max 1

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

stable

A K·D·L Argument or Property.

3.1.8 Property (kdl:Property)

I·R·I

https://ns.1024.gdn/KDL/#Property

Subclass Of

kdl:Parameter

kdl:hasName some owl:Thing

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

stable

A property for a K·D·L Node.

3.1.9 Type Annotation (kdl:TypeAnnotation)

I·R·I

https://ns.1024.gdn/KDL/#TypeAnnotation

Subclass Of

kdl:hasName some owl:Thing

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

stable

A type annotation for a K·D·L Node or Parameter.

3.2 Object Property Definitions

3.2.1 has children (kdl:hasChildren)

I·R·I

https://ns.1024.gdn/KDL/#hasChildren

Domain

kdl:Node

Range

rdf:List

Functional?

yes

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

stable

A List of child Nodes for this Node.

Although it is not expressible using formal ontology semantics, the List must be a simple, non‐sparse list of Nodes.

3.2.2 has first (rdf:first)

I·R·I

http://www.w3.org/1999/02/22-rdf-syntax-ns#first

Domain

rdf:List

Is Defined By

https://www.w3.org/TR/rdf-schema

Term Status

stable

The first thing in this List.

3.2.3 has name (kdl:hasName)

I·R·I

https://ns.1024.gdn/KDL/#hasName

Range

kdl:Identifier

Functional?

yes

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

stable

The name for this thing.

3.2.4 has nodes (kdl:hasNodes)

I·R·I

https://ns.1024.gdn/KDL/#hasNodes

Domain

kdl:Document

Range

rdf:List

Functional?

yes

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

stable

A List of child Nodes for this Document.

Although it is not expressible using formal ontology semantics, the List must be a simple, non‐sparse list of Nodes.

3.2.5 has parameters (kdl:hasParameters)

I·R·I

https://ns.1024.gdn/KDL/#hasParameters

Domain

kdl:Document

Range

rdf:List

Functional?

yes

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

stable

A List of child Parameters for this Node.

Although it is not expressible using formal ontology semantics, the List must be a simple, non‐sparse list of Parameters. Attributes and Properties may be intermixed freely.

3.2.6 has rest (rdf:rest)

I·R·I

http://www.w3.org/1999/02/22-rdf-syntax-ns#rest

Domain

rdf:List

Range

rdf:List

Is Defined By

https://www.w3.org/TR/rdf-schema

Term Status

stable

The remaining things in this List.

3.2.7 has type annotation (kdl:hasTypeAnnotation)

I·R·I

https://ns.1024.gdn/KDL/#hasTypeAnnotation

Domain

kdl:Node or kdl:Parameter

Range

kdl:TypeAnnotation

Functional?

yes

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

stable

A Type Annotation for this Node or Parameter.

3.3 Data Property Definitions

3.3.1 is null (kdl:isNull)

I·R·I

https://ns.1024.gdn/KDL/#isNull

Domain

kdl:Parameter

Range

xsd:boolean

Functional?

yes

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

stable

Whether this Parameter has a null value.

This is used in place of (e·g) setting the value to nil, in order to allow value to be a purely data property.

3.3.2 value (rdf:value)

I·R·I

http://www.w3.org/1999/02/22-rdf-syntax-ns#value

Is Defined By

https://www.w3.org/TR/rdf-schema/

Term Status

stable

A value for this thing.

3.4 Named Individual Definitions

3.4.1 nil (rdf:nil)

I·R·I

http://www.w3.org/1999/02/22-rdf-syntax-ns#nil

Type

rdf:List

Is Defined By

https://www.w3.org/TR/rdf-schema/

Term Status

stable

Used to close out a List.

4. Namespaces in K·D·L

4.1 Class Definitions

4.1.1 🔬 Namespaced Identifier (kdl:NamespacedIdentifier)

I·R·I

https://ns.1024.gdn/KDL/#NamespacedIdentifier

Subclass Of

kdl:Identifier

inverse(kdl:hasName) only (not kdl:Property)

kdl:expandedForm exactly 1

kdl:localPart exactly 1

kdl:namespace exactly 1

kdl:prefix exactly 1

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

testing

An Identifier whose value is comprised of a valid prefix and local part, separated by a colon.

Not all Identifiers which contain a colon are necessarily Namespaced Identifiers, but this vocabulary enables K·D·L processors to indicate some of them as such. Any of the prefix, namespace, local part, or expanded form might be the empty string.

Properties are forbidden from being namespaced, as this could introduce ambiguity with namespace definitions.

Although it is not expressible using formal ontology semantics, the value, prefix, local part, namespace, and expanded form of any Namespaced Identifier must satisfy the expectations documented here.

4.2 Data Property Definitions

4.2.1 🔬 expanded form (kdl:expandedForm)

I·R·I

https://ns.1024.gdn/KDL/#expandedForm

Domain

kdl:NamespacedIdentifier

Range

xsd:string

Functional?

yes

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

testing

The expanded form of this Namespaced Identifier.

Although it is not expressible using formal ontology semantics, this must be the result of catenating the Namespaced Identifier’s namespace with its local part.

4.2.2 🔬 local part (kdl:localPart)

I·R·I

https://ns.1024.gdn/KDL/#localPart

Domain

kdl:NamespacedIdentifier

Range

xsd:string

Functional?

yes

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

testing

The local part of this Namespaced Identifier.

4.2.3 🔬 namespace (kdl:namespace)

I·R·I

https://ns.1024.gdn/KDL/#namespace

Domain

kdl:NamespacedIdentifier

Range

xsd:string

Functional?

yes

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

testing

The namespace of this Namespaced Identifier.

4.2.4 🔬 namespace prefix (kdl:prefix)

I·R·I

https://ns.1024.gdn/KDL/#prefix

Domain

kdl:NamespacedIdentifier

Range

xsd:string

Functional?

yes

Is Defined By

https://ns.1024.gdn/KDL/

Term Status

testing

The namespace prefix of this Namespaced Identifier.