Skip to content

Workspace DSL

Constantine edited this page Oct 2, 2015 · 10 revisions

The Workspace Domain Specific Language (DSL) is a simplified syntax for creating workspaces in Ultrastructure.

Syntax

The syntax for the Workspace DSL is defined by an Antlr4 grammar. You can browse the Workspace DSL syntax diagram for complete details.

Example

workspace: "uri:http://ultrastructure.me/ontology/com.chiralbehaviors/demo/phantasm/v1" 
           "Phantasm Demo" "First demo of Phantasm"
imports {
    "urn:uuid:00000000-0000-0004-0000-000000000003" as kernel
}
attributes {
    aliases = "Aliases" "Alias Smith and Jones" indexed: true text;
    discount = "Percentage" "The cut off the top" numeric;
    URI = "URI" "the Universal Resource Indicator" text;
    
    artifactId = "Artifact ID" "artifact identifier" text;
    classification = "Classifier" "classification" text;
    groupId = "Group ID" "group identifier" text;
    typeValues = "Type Values" "Valid values for the Type attribute" text;
    properties = "properties" "a property map" keyed: true text;
    type = "Type" "type" text
        attribute values {
            typeValues: "jar" 1
            typeValues: "yml" 2
            typeValues: "package" 3
        };
    version = "Version" "version" text;
    edges {
        type.IsValidatedBy.typeValues
    }
    
}
locations {
    MavenArtifact = "MavenArtifact" "A maven artifact";
    facets {
        IsA.MavenArtifact { artifactId classification groupId type version }
    }
}
products {
    Thing1 = "Thing1" "Thing 1";
    Thing2 = "Thing2" "Thing 2";
    Thing3 = "Thing3" "Thing 3";
    edges {
        this.HasMember.Thing1
    }
    facets {
        IsA.Thing1 { aliases URI discount properties }
            constraints {
                one thing1Of: IsA.Thing2
                one derivedFrom: IsA.MavenArtifact
            }
    }
}
relationships {
    derivedFrom = "Derived From" "A is derived from B" | derivativeOf = "Derivative Of" "A is a derivative of B";
    inThing1 = "In Thing 1" "A is part of a thing1" | thing1Of = "Thing 1 Of" "A is the thing 1 of B";
    inThing2 = "In Thing 2" "A is part of a thing1" | thing2Of = "Thing 2 Of" "A is the thing 2 of B";
}

Clone this wiki locally