SPIN Standard Library
type: Ontology
version info: 1.3.0
imports: spin
comment: A collection of generally useful SPARQL functions (expressed as SPIN functions), and SPIN templates. Also provides a top-level classification of functions, and definitions of the standard SPARQL functions.
type: LibraryOntology

Constraint template
type: Class
subclass of: ConstructTemplate
comment: Metaclass for CONSTRUCT templates that create spin:ConstraintViolations and can be used as values of spin:constraint.

Test case
type: Class
subclass of: Resource
comment: A test to verify that a SPIN function or magic property works as expected, and to generate documentation of example uses of the function. Each TestCase consists of a SPARQL function call or an expression that can be executed with spin:eval, and an expected result. The test framework only needs to execute spin:eval on the expression and compare it with the expected result.
constraint: Argument
  comment: The test expression or SELECT query (anything that can be evaluated with spin:eval).
  predicate: test expression
constraint: Argument
  comment: The expected result of the test case, or nothing to indicate that an error is expected.
  predicate: testResult
  optional: true

test expression
type: Property
sub property of: arg

testResult
type: Property
sub property of: arg

Union template
type: Class
subclass of: Template
comment: This type can be used for templates that serve as the union (or "collector") of other templates. Union templates differ from other templates in that all spl:Arguments are optional. This means that union templates can be declared as subclasses of multiple other templates, yet when instantiated, only some of the arguments defined by the superclasses need to be filled in.

instance
type: Property
sub property of: arg
domain: ModuleCall

class
type: Property
sub property of: arg

count
type: Property
sub property of: arg

value type
type: Property
sub property of: arg

predicate
type: Property
sub property of: arg

default value
type: Property
sub property of: arg

optional
type: Property
sub property of: arg
range: boolean

SPIN Overview
type: SelectTemplate
subclass of: SelectTemplates
comment: Finds all constraints and rules attached to classes in the current graph, using spin:constraint, spin:constructor, spin:rule or their sub-properties. The result set will contain the associated class, the predicate, and the SPIN rule.
label template: SPIN Overview
body: Select
  where:
    rest: nil
    first: Union
      elements:
        rest: nil
        first: Bind
      elements:
        rest: nil
        first: Bind
      elements:
        rest: nil
        first: Bind
  where: TriplePath
    subject:
      var name: property
    path: ModPath
      sub path: subPropertyOf
      mod min: 0
      mod max: -2
    object:
      var name: bp
  where:
    subject:
      var name: class
    predicate:
      var name: property
    object:
      var name: rule
  where: Filter
    expression: ne
      arg2: Modules
      arg1:
        var name: class
  where: Filter
    expression: notExists
      type: NOT EXISTS
      elements:
        predicate: type
        object: Argument
  where: Filter
    expression: notExists
      type: NOT EXISTS
      elements:
        predicate: type
        object: Attribute
  result variables:
    var name: class
  result variables:
    var name: property
  result variables:
    var name: rule

Argument
type: ConstructTemplate
constraint: Argument
  comment: the property holding the values of each function call
  value type: Property
  predicate: predicate
comment: Provides metadata about an argument of a SPIN Function or Template. Arguments wrap a given rdf:Property (predicate) and specify its value type and whether the argument is optional. When used as spin:constraint, the body of this template will verify that a non-optional value exists and that it has the specified value type. Arguments that have been declared spl:optional true become optional if the type of ?this is spl:UnionTemplate.
body: Construct
  where:
    rest: nil
    first: Filter
      expression: isIRI
        arg1: this
  where: Union
    elements:
      rest:
        first: Bind
        rest: nil
      first:
        rest: nil
        first: Filter
      first: Filter
        expression: notExists
      first: Filter
        expression: notExists
    elements:
      rest:
        first: Bind
        rest: nil
      first:
        rest: nil
        first: Filter
      first:
        subject: this
      first: Filter
        expression: and
  templates:
    predicate: type
    object: ConstraintViolation
  templates:
    predicate: violationRoot
    object: this
  templates:
    predicate: violationPath
    object:
      var name: predicate
  templates:
    predicate: label
    object:
      var name: label
constraint: Argument
  comment: indicates whether the argument is optional
  value type: boolean
  predicate: optional
  optional: true
constraint: Argument
  comment: the default value for the argument
  predicate: default value
  optional: true
label template: Argument {?predicate} : {?valueType}
subclass of: ConstructTemplates
constraint: Argument
  comment: the value type of the argument
  value type: Class
  predicate: value type
  optional: true
constraint: Argument
  comment: a comment describing the argument
  value type: string
  predicate: comment
  optional: true

Attribute
type: ConstructTemplate
constraint: Argument
  comment: the default value of the attribute
  predicate: default value
  optional: true
comment: Defines an "attribute" of a class. Attribute definitions bundle common modeling patterns known from object-oriented languages like UML. Each attribute can have min and max cardinality, a value type and a default value. The attribute links a class with one RDF property. This template should be used as spin:constraints on a class to make sure that classes meet the expected cardinalities and valueType constraints. If a model wants to use spl:defaultValue, then it should instantiate the spl:ConstructDefaultValues as a spin:constructor at some root class, such as rdfs:Resource.
constraint: Argument
  comment: a comment describing the meaning of this attribute
  value type: string
  predicate: comment
  optional: true
subclass of: ConstructTemplates
body: Construct
  where: Union
    elements:
      rest: nil
      first: Filter
        expression: and
    elements:
      rest: nil
      first: Filter
        expression: and
    elements:
      first: Filter
        expression: bound
  templates:
    predicate: type
    object: ConstraintViolation
  templates:
    predicate: violationRoot
    object: this
  templates:
    predicate: violationPath
    object:
      var name: predicate
constraint: Argument
  comment: the maximum number of values permitted for the property
  value type: integer
  predicate: maxCount
  optional: true
label template: Attribute {?predicate} : {?valueType} [{?minCount},{?maxCount}]
constraint: Argument
  comment: the RDF property holding the attribute value
  value type: Property
  predicate: predicate
constraint: Argument
  comment: the type that all values of the property must have
  value type: Class
  predicate: value type
  optional: true
constraint: Argument
  comment: the minimum number of values permitted for the property
  value type: integer
  predicate: minCount
  optional: true

Test-instanceOf-rdfsClassInheritance
type: Test case
testResult: true
test expression: instanceOf
  arg2: Class
  arg1: Restriction

relevant property at class
type: MagicProperty
subclass of: MagicProperties
comment: A magic property that establishes a relationship between properties (left) and classes (right) to determine which properties are "relevant" for the class. Relevant means that they have the class in their domain and/or restrictions, including superclasses and sub-properties (unless they define their own domain). Domains consisting of an owl:unionOf are also handled. Note that the performance of the body of this magic property has been optimized for the case in which the class is given, so ideally use this for queries such as ?property spl:relevantPropertyAtClass skos:Concept .
return type: Class
constraint: Argument
  comment: The property.
  value type: Property
  predicate: arg1
body: Select
  where: TriplePath
    subject:
      var name: class
    path: ModPath
      sub path: subClassOf
      mod min: 0
      mod max: -2
    object:
      var name: superClass
  where: Union
    elements:
      rest: nil
      first:
        predicate: domain
    elements:
      rest: nil
      first:
        predicate: onProperty
    elements:
      rest:
        first: TriplePath
      first:
        predicate: first
  where: TriplePath
    subject: arg1
    path: ModPath
      sub path: subPropertyOf
      mod min: 0
      mod max: -2
    object:
      var name: property
  where: Filter
    expression: or
      arg2: notExists
        type: NOT EXISTS
      arg1: eq
        arg1: arg1
  where: Filter
    expression: isIRI
      arg1:
        var name: class
  result variables:
    var name: class
  distinct: true

Infer default value
type: ConstructTemplate
subclass of: ConstructTemplates
comment: Can be used to infer default values for a given subject/predicate combination. This is typically assigned as spin:rule to a class. If ?this does not already have a value for a given property {?predicate}, then this will infer the value {?defaultValue}.
label template: Default value for {?predicate}: {?defaultValue}
constraint: Argument
  comment: The predicate to infer the default value of.
  value type: Property
  predicate: predicate
constraint: Argument
  comment: The default value to infer.
  predicate: default value
body: Construct
  where: Optional
    elements:
      subject: this
      predicate:
        var name: predicate
      object:
        var name: anyValue
  where: Filter
    expression: not
      arg1: bound
  templates:
    subject: this
    predicate:
      var name: predicate
    object:
      var name: defaultValue

COALESCE
type: Function
subclass of: Misc functions
comment: Takes any number of arguments, and returns the first bound argument, starting at the left.
symbol: COALESCE

Misc functions
type: Function
subclass of: Functions
comment: A collection of functions that are difficult to categorize.
abstract: true

rand
type: Function
subclass of: Mathematical functions
comment: Returns a number between 0 (inclusive) and 1.0e0 (exclusive). Different numbers can be produced every time this function is invoked. Numbers should be produced with approximately equal probability.
symbol: RAND
return type: double

Mathematical functions
type: Function
subclass of: Functions
comment: A collection of functions operating on numbers.
abstract: true

year
type: Function
subclass of: Date functions
comment: Extracts the year from a date/time literal.
symbol: year
return type: integer
constraint: Argument
  comment: The date or dateTime argument.
  value type: Literal
  predicate: arg1

Date functions
type: Function
subclass of: Functions
comment: A collection of functions that operate on date/time literals.
abstract: true

object in graph
type: Function
subclass of: Ontology functions
comment: Gets the object of a given subject (?arg1) / predicate (?arg2) combination in a given graph ?arg3. Note that if multiple values are present then the result might be unpredictably random.
constraint: Argument
  comment: The graph to query in.
  value type: Resource
  predicate: arg3
constraint: Argument
  comment: The predicate to get the object of.
  value type: Property
  predicate: arg2
constraint: Argument
  comment: The subject to get the object from.
  value type: Resource
  predicate: arg1
body: Select
  where: NamedGraph
    graph name node: arg3
    elements:
      subject: arg1
      predicate: arg2
      object:
        var name: object
  result variables:
    var name: object

Ontology functions
type: Function
subclass of: Functions
comment: A collection of functions performing ontology-related operations.
abstract: true

round
type: Function
subclass of: Mathematical functions
comment: Returns the number with no fractional part that is closest to the argument. If there are two such numbers, then the one that is closest to positive infinity is returned. An error is raised if ?arg1 is not a numeric value.
symbol: round
constraint: Argument
  comment: The number to round.
  predicate: arg1

strlen
type: Function
subclass of: String functions
comment: Computes the length of a given input string.
symbol: STRLEN
return type: integer
constraint: Argument
  comment: The input string.
  value type: string
  predicate: arg1

String functions
type: Function
subclass of: Functions
comment: A collection of functions that return strings.
abstract: true

Test-instanceOf-untypedString
type: Test case
testResult: true
test expression: instanceOf
  arg2: string
  arg1: test

strends
type: Function
subclass of: String functions
comment: Returns true if the lexical form of ?arg1 ends with the lexical form of ?arg2, otherwise it returns false.
symbol: STRENDS
return type: boolean
constraint: Argument
  comment: The sub-string that the input string is supposed to end with.
  value type: string
  predicate: arg2
constraint: Argument
  comment: The input string.
  value type: string
  predicate: arg1

hasValueOfType
type: Function
subclass of: Boolean functions
comment: Checks whether a given subject (?arg1) has at least one value of a given type (?arg3) for a given property (?arg2) or one of its sub-properties.
return type: boolean
constraint: Argument
  comment: the type to match against
  value type: Class
  predicate: arg3
constraint: Argument
  comment: the expected property
  value type: Property
  predicate: arg2
constraint: Argument
  comment: the subject that is expected to have the value
  value type: Resource
  predicate: arg1
body: Ask
  where: TriplePath
    subject:
      var name: p
    path: ModPath
      sub path: subPropertyOf
      mod min: 0
      mod max: -2
    object: arg2
  where:
    subject: arg1
    predicate:
      var name: p
    object:
      var name: value
  where: Filter
    expression: instanceOf
      arg2: arg3
      arg1:
        var name: value

Boolean functions
type: Function
subclass of: Functions
comment: A collection of functions that return a boolean value (true or false).
abstract: true

All arguments
type: SelectTemplate
subclass of: SelectTemplates
comment: Gets a list of all spl:Arguments declared at a given class and its superclasses.
label template: All spl:Arguments of {?class}
constraint: Argument
  comment: The class to get the arguments of.
  value type: Class
  predicate: class
body: Select
  where: TriplePath
    subject:
      var name: class
    path: ModPath
      sub path: subClassOf
      mod min: 0
      mod max: -2
    object:
      var name: atClass
  where:
    subject:
      var name: atClass
    predicate: constraint
    object:
      var name: arg
  where:
    subject:
      var name: arg
    predicate: type
    object: Argument
  result variables:
    var name: arg
  result variables:
    var name: atClass

sha1
type: Function
subclass of: Misc functions
comment: Returns the SHA1 checksum, as a hex digit string, calculated on the UTF-8 representation of the simple literal or lexical form of the xsd:string. Hex digits SHOULD be in lower case.
symbol: SHA1
return type: string
constraint: Argument
  comment: The input literal.
  predicate: arg1

Regex property constraint
type: Constraint template
subclass of: Property constraint templates
label template: Values of {?property} must match the regular expression {?pattern}
constraint: Argument
  comment: The regular expression to match.
  value type: string
  predicate: pattern
body: Construct
  where:
    subject: this
    predicate:
      var name: property
    object:
      var name: object
  where: Filter
    expression: not
      arg1: regex
        arg1: string
  where: Bind
    variable:
      var name: message
    expression: concat
      arg5: "
      arg4:
        var name: pattern
      arg3: must match the regular expression "
      arg2:
        var name: object
      arg1: Value
  templates:
    predicate: type
    object: ConstraintViolation
  templates:
    predicate: violationRoot
    object: this
  templates:
    predicate: violationPath
    object:
      var name: property
  templates:
    predicate: label
    object:
      var name: message

Property constraint templates
type: Constraint template
subclass of: Constraint templates
comment: Abstract superclass of constraint templates that constrain exactly one property.
constraint: Argument
  comment: The property being constrained.
  value type: Property
  predicate: property
abstract: true

Constraint templates
type: Constraint template
subclass of: ConstructTemplates
comment: Abstract superclass of templates that can be used as spin:constraints. The subclasses are expected to construct spin:ConstraintViolations and use ?this to talk about the instances of the associated class.
abstract: true

tz
type: Function
subclass of: Date functions
comment: Returns the timezone part of ?arg1 as a simple literal. Returns the empty string if there is no timezone.
symbol: TZ

now
type: Function
subclass of: Date functions
comment: Gets the current date and time as an xsd:dateTime literal.
symbol: now
return type: dateTime

Test-instanceOf-lingualString
type: Test case
testResult: true
test expression: instanceOf
  arg2: string
  arg1: test

str
type: Function
subclass of: String functions
comment: Returns the lexical form of ?arg1 (a literal); returns the codepoint representation of ?arg1 (an IRI). This is useful for examining parts of an IRI, for instance, the host-name.
symbol: str
return type: string
constraint: Argument
  comment: the node to convert to string
  predicate: arg1

ceil
type: Function
subclass of: Mathematical functions
comment: Returns the smallest (closest to negative infinity) number with no fractional part that is not less than the value of arg. An error is raised if ?arg1 is not a numeric value.
symbol: ceil
constraint: Argument
  comment: The number to get the ceiling of.
  predicate: arg1

hasValue
type: Function
subclass of: Boolean functions
comment: Checks whether a given resource (?arg1) has a given value (?arg3) for a given property (?arg2) or one of the sub-properties of it.
return type: boolean
constraint: Argument
  comment: the expected value
  predicate: arg3
constraint: Argument
  comment: the property that is expected to hold the value
  value type: Property
  predicate: arg2
constraint: Argument
  comment: the subject that is expected to have the value
  value type: Resource
  predicate: arg1
body: Ask
  where: TriplePath
    subject:
      var name: p
    path: ModPath
      sub path: subPropertyOf
      mod min: 0
      mod max: -2
    object: arg2
  where:
    subject: arg1
    predicate:
      var name: p
    object: arg3

floor
type: Function
subclass of: Mathematical functions
comment: Returns the largest (closest to positive infinity) number with no fractional part that is not greater than the value of ?arg1. An error is raised if ?arg1 is not a numeric value.
symbol: floor
constraint: Argument
  comment: The value to get the floor of.
  predicate: arg1

timezone
type: Function
subclass of: Date functions
comment: Returns the timezone part of ?arg1 as an xsd:dayTimeDuration. Raises an error if there is no timezone.
symbol: TIMEZONE
return type: duration
constraint: Argument
  comment: The input time.
  value type: dateTime
  predicate: arg1

IN
type: Function
subclass of: Boolean functions
comment: Checks whether the value on the left (?arg1) is one of the values on the right (?arg2, ?arg3 ...).
symbol: IN
return type: boolean
constraint: Argument
  comment: The value to find.
  predicate: arg1

strstarts
type: Function
subclass of: String functions
comment: Returns true if the lexical form of ?arg1 begins with the lexical form of ?arg2, otherwise it returns false.
symbol: STRSTARTS
return type: boolean
constraint: Argument
  comment: The sub-string that the input string is supposed to begin with.
  value type: string
  predicate: arg2
constraint: Argument
  comment: The input string.
  value type: string
  predicate: arg1

ge
type: Function
subclass of: Boolean functions
comment: Returns true if ?arg1 >= ?arg2.
symbol: >=
return type: boolean
constraint: Argument
  comment: the second operand
  value type: Literal
  predicate: arg2
constraint: Argument
  comment: the first operand
  value type: Literal
  predicate: arg1

has argument
type: Function
subclass of: Boolean functions
comment: Checks if a given module class (?module) has at least one declared spl:Argument.
return type: boolean
constraint: Argument
  comment: The module class to check.
  value type: Module
  predicate: class
body: Ask
  where: TriplePath
    subject:
      var name: class
    path: ModPath
      sub path: subClassOf
      mod min: 0
      mod max: -2
    object:
      var name: superClass
  where:
    subject:
      var name: superClass
    predicate: constraint
    object:
      var name: con
  where:
    subject:
      var name: con
    predicate: type
    object: Argument

subject
type: Function
subclass of: Ontology functions
comment: Gets the "first" subject of a given predicate (?arg1)/object (?arg2) combination. Note that if multiple values are present then the result might be unpredictably random.
constraint: Argument
  comment: The object.
  predicate: arg2
constraint: Argument
  comment: The predicate.
  value type: Property
  predicate: arg1
body: Select
  where:
    subject:
      var name: subject
    predicate: arg1
    object: arg2
  result variables:
    var name: subject

isURI
type: Function
subclass of: Boolean functions
comment: Checks whether a node is a URI.
symbol: isURI
return type: boolean
constraint: Argument
  comment: the node to check
  predicate: arg1

hours
type: Function
subclass of: Date functions
comment: Extracts the hours from a date/time literal.
symbol: hours
return type: integer
constraint: Argument
  comment: The dateTime or time argument.
  value type: Literal
  predicate: arg1

Test-instanceOf-typedString
type: Test case
testResult: true
test expression: instanceOf
  arg2: string
  arg1: test

unary plus
type: Function
subclass of: Mathematical functions
comment: Returns the operand ?arg1 with the sign unchanged. Semantically, this operation performs no operation.
symbol: +
constraint: Argument
  comment: the operand
  value type: Literal
  predicate: arg1

minutes
type: Function
subclass of: Date functions
comment: Extracts the minutes from a date/time literal.
symbol: minutes
return type: integer
constraint: Argument
  comment: The dateTime or time argument.
  value type: Literal
  predicate: arg1

replace
type: Function
constraint: Argument
  comment: The replacement string.
  value type: string
  predicate: arg3
constraint: Argument
  comment: The input string.
  value type: string
  predicate: arg1
constraint: Argument
  comment: The pattern to replace.
  value type: string
  predicate: arg2
comment: Replaces each non-overlapping occurrence of a regular expression pattern with a replacement string. Regular expession matching may involve modifier flags.
return type: string
constraint: Argument
  comment: Additional flags for the replacement.
  value type: string
  predicate: arg4
  optional: true
subclass of: String functions
symbol: REPLACE

NOT IN
type: Function
subclass of: Boolean functions
comment: Checks whether the value on the left (?arg1) is none of the values on the right (?arg2, ?arg3 ...).
symbol: NOT IN
return type: boolean
constraint: Argument
  comment: The value to find.
  predicate: arg1

strafter
type: Function
subclass of: String functions
comment: Returns a literal of the same kind (simple literal, plain literal same language tag, xsd:string) as the first argument arg1. The lexical form of the result is the substring of the value of arg1 that proceeds in arg1 the first occurrence of the lexical form of arg2; otherwise the lexical form of the result is the empty string. If the lexical form of arg2 is the empty string, the lexical form of the result is the emprty string.
symbol: STRAFTER
return type: string
constraint: Argument
  comment: The pattern to find within the input string.
  value type: string
  predicate: arg2
constraint: Argument
  comment: The input string.
  value type: string
  predicate: arg1

sha384
type: Function
subclass of: Misc functions
comment: Returns the SHA384 checksum, as a hex digit string, calculated on the UTF-8 representation of the simple literal or lexical form of the xsd:string. Hex digits SHOULD be in lower case.
symbol: SHA384
return type: string
constraint: Argument
  comment: The input literal.
  predicate: arg1

lang
type: Function
subclass of: String functions
comment: Returns the language tag of ?arg1, if it has one. It returns "" if the literal has no language tag. Node that the RDF data model does not include literals with an empty language tag.
symbol: lang
return type: string
constraint: Argument
  comment: the literal to get the language of
  value type: Literal
  predicate: arg1

md5
type: Function
subclass of: Misc functions
comment: Returns the MD5 checksum, as a hex digit string, calculated on the UTF-8 representation of the simple literal or lexical form of the xsd:string. Hex digits SHOULD be in lower case.
symbol: MD5
return type: string
constraint: Argument
  comment: The input literal.
  predicate: arg1

sha256
type: Function
subclass of: Misc functions
comment: Returns the SHA256 checksum, as a hex digit string, calculated on the UTF-8 representation of the simple literal or lexical form of the xsd:string. Hex digits SHOULD be in lower case.
symbol: SHA256
return type: string
constraint: Argument
  comment: The input literal.
  predicate: arg1

strbefore
type: Function
subclass of: String functions
comment: Returns a literal of the same kind (simple literal, plain literal same language tag, xsd:string) as the first argument arg1. The lexical form of the result is the substring of the value of arg1 that precedes in arg1 the first occurrence of the lexical form of arg2; otherwise the lexical form of the result is the empty string. If the lexical form of arg2 is the empty string, the lexical form of the result is the emprty string.
symbol: STRBEFORE
return type: string
constraint: Argument
  comment: The pattern to find within the input string.
  value type: string
  predicate: arg2
constraint: Argument
  comment: The input string.
  value type: string
  predicate: arg1

Existence property pair constraint
type: Constraint template
subclass of: Property pair constraint templates
label template: The property {?property} must have a value whenever {?otherProperty} has a value
body: Construct
  where: Filter
    expression: exists
      type: EXISTS
      elements:
        subject: this
  where: Filter
    expression: notExists
      type: NOT EXISTS
      elements:
        subject: this
  where: Bind
    variable:
      var name: message
    expression: concat
      arg3: has
      arg2:
        var name: otherProperty
      arg1: Property must have a value because
  templates:
    predicate: type
    object: ConstraintViolation
  templates:
    predicate: violationRoot
    object: this
  templates:
    predicate: violationPath
    object:
      var name: property
  templates:
    predicate: label
    object:
      var name: message

Property pair constraint templates
type: Constraint template
subclass of: Property constraint templates
comment: Abstract base class for templates that take two properties as arguments and establish a relationship between them.
constraint: Argument
  comment: The "other" property.
  value type: Property
  predicate: otherProperty
abstract: true

strlang
type: Function
subclass of: String functions
comment: Takes a string (?arg1) and a language (?arg2) and constructs a literal with a corresponding language tag.
symbol: STRLANG
return type: PlainLiteral
constraint: Argument
  comment: The language tag, e.g. "en-AU".
  value type: string
  predicate: arg2
constraint: Argument
  comment: The string value.
  value type: string
  predicate: arg1

LCASE
type: Function
subclass of: String functions
comment: Converts a string to lower case characters.
symbol: LCASE
return type: string
constraint: Argument
  comment: The input string.
  value type: string
  predicate: arg1

Test-instanceOf-typedString-false
type: Test case
testResult: false
test expression: instanceOf
  arg2: integer
  arg1: test

URI
type: Function
subclass of: Ontology functions
comment: Equivalent to IRI.
symbol: URI
return type: Resource
constraint: Argument
  comment: The IRI string to convert to a resource.
  value type: string
  predicate: arg1

le
type: Function
subclass of: Boolean functions
comment: Returns true if ?arg1 <= ?arg2.
symbol: <=
return type: boolean
constraint: Argument
  comment: the second operand
  value type: Literal
  predicate: arg2
constraint: Argument
  comment: the first operand
  value type: Literal
  predicate: arg1

bnode
type: Function
subclass of: Ontology functions
comment: Constructs a blank node that is distinct from all blank nodes in the dataset being queried and distinct from all blank nodes created by calls to this constructor for other query solutions. If the no argument form is used, every call results in a distinct blank node. If the form with a simple literal is used, every call results in distinct blank nodes for different simple literals, and the same blank node for calls with the same simple literal within expressions for one solution mapping. This functionality is compatible with the treatment of blank nodes in SPARQL CONSTRUCT templates.
symbol: BNODE
constraint: Argument
  comment: A literal input node.
  predicate: arg1
  optional: true

min
type: Function
subclass of: Mathematical functions
comment: Takes two arguments and returns the smaller one of them.
return type: Literal
constraint: Argument
  comment: The second argument.
  value type: Literal
  predicate: arg2
constraint: Argument
  comment: The first argument.
  value type: Literal
  predicate: arg1
body: Select
  where: Bind
    variable:
      var name: result
    expression: if
      type: IF
      arg3: arg2
      arg2: arg1
      arg1: lt
        arg2: arg2
        arg1: arg1
  result variables:
    var name: result

struuid
type: Function
subclass of: String functions
comment: Returns a string that is the scheme specific part of UUID. That is, as a simple literal, the result of generating a UUID, converting to a simple literal and removing the initial urn:uuid:.
symbol: STRUUID
return type: string

max
type: Function
subclass of: Mathematical functions
comment: Takes two arguments and returns the larger one of them.
return type: Literal
constraint: Argument
  comment: The second argument.
  value type: Literal
  predicate: arg2
constraint: Argument
  comment: The first argument.
  value type: Literal
  predicate: arg1
body: Select
  where: Bind
    variable:
      var name: result
    expression: if
      type: IF
      arg3: arg2
      arg2: arg1
      arg1: gt
        arg2: arg2
        arg1: arg1
  result variables:
    var name: result

seconds
type: Function
subclass of: Date functions
comment: Extracts the seconds from a date/time literal.
symbol: seconds
return type: integer
constraint: Argument
  comment: The dateTime or time argument.
  value type: Literal
  predicate: arg1

sub property of
type: Function
subclass of: Ontology functions
comment: Checks whether a given property (?arg1) is a (transitive) sub-property of another property (?arg2).
return type: boolean
constraint: Argument
  comment: The potential super-property.
  value type: Property
  predicate: arg2
constraint: Argument
  comment: The potential sub-property.
  value type: Property
  predicate: arg1
body: Ask
  where: TriplePath
    subject: arg1
    path: ModPath
      sub path: subPropertyOf
      mod min: 0
      mod max: -2
    object: arg2

Range property constraint
type: Constraint template
subclass of: Property constraint templates
comment: Represents a constraint that narrows down a property by a minimum and maximum value compared by <= and >=.
label template: Values of {?property} must be within the interval [ {?min} , {?max} ]
constraint: Argument
  comment: The minimum value.
  value type: Literal
  predicate: min
  optional: true
constraint: Argument
  comment: The maximum value.
  value type: Literal
  predicate: max
  optional: true
body: Construct
  where:
    subject: this
    predicate:
      var name: property
    object:
      var name: object
  where: Filter
    expression: or
      arg2: and
        arg2: gt
        arg1: bound
      arg1: and
        arg2: lt
        arg1: bound
  where: Bind
    variable:
      var name: message
    expression: concat
      arg7: ]
      arg6:
        var name: max
      arg5: ,
      arg4:
        var name: min
      arg3: must be in the interval [
      arg2:
        var name: object
      arg1: Value
  templates:
    predicate: type
    object: ConstraintViolation
  templates:
    predicate: violationRoot
    object: this
  templates:
    predicate: violationPath
    object:
      var name: property
  templates:
    predicate: label
    object:
      var name: message
abstract: true

sub class of
type: Function
subclass of: Ontology functions
comment: Checks whether a given class (?arg1) is a (transitive) sub-class of another class (?arg2).
return type: boolean
constraint: Argument
  comment: The potential super-class.
  value type: Class
  predicate: arg2
constraint: Argument
  comment: The potential sub-class.
  value type: Class
  predicate: arg1
body: Ask
  where: TriplePath
    subject: arg1
    path: ModPath
      sub path: subClassOf
      mod min: 0
      mod max: -2
    object: arg2

divide
type: Function
subclass of: Mathematical functions
comment: Returns the arithmetic quotient of its operands.
symbol: /
return type: Literal
constraint: Argument
  comment: the second operand
  value type: Literal
  predicate: arg2
constraint: Argument
  comment: the first operand
  value type: Literal
  predicate: arg1

is numeric
type: Function
subclass of: Boolean functions
comment: Returns true if arg1 is a numeric value. Returns false otherwise. term is numeric if it has an appropriate datatype (see the section Operand Data Types) and has a valid lexical form, making it a valid argument to functions and operators taking numeric arguments.
symbol: isNumeric
constraint: Argument
  comment: The node to check whether it's numeric.
  predicate: arg1

day
type: Function
subclass of: Date functions
comment: Extracts the day from a date/time literal.
symbol: day
return type: integer
constraint: Argument
  comment: The date or dateTime argument.
  value type: Literal
  predicate: arg1

Object count property constraint
type: Constraint template
subclass of: Count property constraint templates
comment: Represents a constraint that can be attached to a class to specify that a given property must have between min and max values.
label template: The property {?property} must have between {?minCount} and {?maxCount} values
body: Construct
  where: Bind
    variable:
      var name: objectCount
    expression: objectCount
      arg2:
        var name: property
      arg1: this
  where: Filter
    expression: or
      arg2: and
        arg2: gt
        arg1: bound
      arg1: and
        arg2: lt
        arg1: bound
  where: Bind
    variable:
      var name: message
    expression: concat
      arg2:
        var name: objectCount
      arg1: Invalid number of values:
  templates:
    predicate: type
    object: ConstraintViolation
  templates:
    predicate: violationRoot
    object: this
  templates:
    predicate: violationPath
    object:
      var name: property
  templates:
    predicate: label
    object:
      var name: message

Count property constraint templates
type: Constraint template
subclass of: Property constraint templates
comment: Abstract superclass of property constraints that compare the number of values with either min or max count.
constraint: Argument
  comment: The minimum number of values that the property must have.
  value type: integer
  predicate: minCount
  optional: true
constraint: Argument
  comment: The maximum number of values that the property must have.
  value type: integer
  predicate: maxCount
  optional: true
abstract: true

unary minus
type: Function
subclass of: Mathematical functions
comment: Returns the operand ?arg1 with the sign reversed. If ?arg1 is positive, its negative is returned; if it is negative, its positive is returned.
symbol: -
constraint: Argument
  comment: the operand
  value type: Literal
  predicate: arg1

IRI
type: Function
subclass of: Ontology functions
comment: Creates a IRI resource (node) from a given IRI string (?arg1).
symbol: IRI
return type: Resource
constraint: Argument
  comment: The IRI string to convert to a resource.
  value type: string
  predicate: arg1

Untyped object property constraint
type: Constraint template
subclass of: Property constraint templates
comment: A generic SPIN template that can be used to declare a constraint that all values of a given property must have an rdf:type.
label template: Values of {?property} must have a type
body: Construct
  where:
    subject: this
    predicate:
      var name: property
    object:
      var name: object
  where: Filter
    expression: notExists
      type: NOT EXISTS
      elements:
        predicate: type
  where: Bind
    variable:
      var name: message
    expression: concat
      arg3: must have a type
      arg2:
        var name: object
      arg1: Value
  templates:
    predicate: type
    object: ConstraintViolation
  templates:
    predicate: violationRoot
    object: this
  templates:
    predicate: violationPath
    object:
      var name: property
  templates:
    predicate: label
    object:
      var name: message

Test-instanceOf-rdfsLiteral
type: Test case
testResult: true
test expression: instanceOf
  arg2: Literal
  arg1: test

Test-instanceOf-rdfsClass
type: Test case
testResult: true
test expression: instanceOf
  arg2: Class
  arg1: Thing

month
type: Function
subclass of: Date functions
comment: Extracts the month from a date/time literal.
symbol: month
return type: integer
constraint: Argument
  comment: The date or dateTime argument.
  value type: Literal
  predicate: arg1

encode_for_uri
type: Function
subclass of: String functions
symbol: ENCODE_FOR_URI
return type: string
constraint: Argument
  comment: The string to convert.
  value type: string
  predicate: arg1

Test-object-labelOfArgument
type: Test case
testResult: Argument
test expression: Select
  where: NamedGraph
    graph name node: SPIN Standard Library
    elements: Bind
      variable:
        var name: value
      expression: object
        arg2: label
        arg1: Argument
  result variables:
    var name: value

UCASE
type: Function
subclass of: String functions
comment: Converts a string to upper case characters.
symbol: UCASE
return type: string
constraint: Argument
  comment: The input string.
  value type: string
  predicate: arg1

mul
type: Function
subclass of: Mathematical functions
comment: Returns the arithmetic product of its operands.
symbol: *
constraint: Argument
  comment: the second operand
  value type: Literal
  predicate: arg2
constraint: Argument
  comment: the first operand
  value type: Literal
  predicate: arg1

Construct default values
type: ConstructTemplate
subclass of: ConstructTemplates
comment: This template can be attached as spin:constructor to a root class such as rdfs:Resource to ensure that SPIN processors assign default values to certain properties. Looks for any templates attached as spin:constraints to the types of ?this and then assigns their declared spl:defaultValues.
label template: Construct default values
body: Construct
  where:
    subject: this
    predicate: type
    object:
      var name: directType
  where: TriplePath
    subject:
      var name: directType
    path: ModPath
      sub path: subClassOf
      mod min: 0
      mod max: -2
    object:
      var name: type
  where:
    subject:
      var name: type
    predicate: constraint
    object:
      var name: attribute
  where:
    subject:
      var name: attribute
    predicate: default value
    object:
      var name: defaultValue
  where:
    subject:
      var name: attribute
    predicate: predicate
    object:
      var name: predicate
  templates:
    subject: this
    predicate:
      var name: predicate
    object:
      var name: defaultValue

Run test cases
type: SelectTemplate
subclass of: SelectTemplates
comment: Runs all spl:TestCases on the current model.
body: Select
  where:
    subject:
      var name: testCase
    predicate: test expression
    object:
      var name: expr
  where: Optional
    elements:
      subject:
        var name: testCase
      predicate: testResult
      object:
        var name: expected
  where: Bind
    variable:
      var name: actual
    expression: eval
      arg1:
        var name: expr
  where: Filter
    expression: or
      arg2: and
        arg2: ne
        arg1: bound
      arg1: ne
        arg2: bound
        arg1: bound
  result variables:
    var name: testCase
  result variables:
    var name: expected
  result variables:
    var name: actual

Test-instanceOf-rdfsClass-false
type: Test case
testResult: false
test expression: instanceOf
  arg2: Class
  arg1: versionInfo

substr
type: Function
constraint: Argument
  comment: The start index.
  value type: integer
  predicate: arg2
comment: Gets the sub-string of a given string. The index of the first character is 1.
constraint: Argument
  comment: The input string.
  value type: string
  predicate: arg1
constraint: Argument
  comment: The end index.
  value type: integer
  predicate: arg3
  optional: true
symbol: SUBSTR
return type: string
subclass of: String functions

Test-instanceOf-rdfsLiteral-false
type: Test case
testResult: false
test expression: instanceOf
  arg2: Literal
  arg1: Thing

object sub prop
type: Function
subclass of: Ontology functions
comment: Gets the object of a given subject (?arg1) / predicate (?arg2) combination, also taking the sub-properties of ?arg2 into account. Note that if multiple values are present then the result might be unpredictably random.
constraint: Argument
  comment: The predicate to get the object of (including sub-properties of it).
  value type: Property
  predicate: arg2
constraint: Argument
  comment: The subject to get the object from.
  value type: Resource
  predicate: arg1
body: Select
  where: TriplePath
    subject:
      var name: property
    path: ModPath
      sub path: subPropertyOf
      mod min: 0
      mod max: -2
    object: arg2
  where:
    subject: arg1
    predicate:
      var name: property
    object:
      var name: object
  result variables:
    var name: object

sub
type: Function
subclass of: Mathematical functions
comment: Returns the arithmetic difference of its operands.
symbol: -
constraint: Argument
  comment: the second operand
  value type: Literal
  predicate: arg2
constraint: Argument
  comment: the first operand
  value type: Literal
  predicate: arg1

subjectCount
type: Function
subclass of: Ontology functions
comment: Gets the number of values of a given property (?arg1) at a given object (?arg2). The result is the number of matches of (?subject, ?arg1, ?arg2).
return type: integer
constraint: Argument
  comment: the object to get the number of subjects of
  predicate: arg2
constraint: Argument
  comment: the predicate to get the number of subjects of
  value type: Property
  predicate: arg1
body: Select
  where:
    subject:
      var name: subject
    predicate: arg1
    object: arg2
  result variables:
    var name: result
    expression: Count
      expression:
        var name: subject

Non-existence property pair constraint
type: Constraint template
subclass of: Property pair constraint templates
label template: The property {?property} must have no values as long as {?otherProperty} has none
body: Construct
  where: Filter
    expression: notExists
      type: NOT EXISTS
      elements:
        subject: this
  where: Filter
    expression: exists
      type: EXISTS
      elements:
        subject: this
  where: Bind
    variable:
      var name: message
    expression: concat
      arg3: has none
      arg2:
        var name: otherProperty
      arg1: Property must have no values because
  templates:
    predicate: type
    object: ConstraintViolation
  templates:
    predicate: violationRoot
    object: this
  templates:
    predicate: violationPath
    object:
      var name: property
  templates:
    predicate: label
    object:
      var name: message

abs
type: Function
subclass of: Mathematical functions
comment: Returns the absolute value of arg. An error is raised if arg is not a numeric value.
symbol: abs
constraint: Argument
  comment: The input value.
  predicate: arg1

add
type: Function
subclass of: Mathematical functions
comment: Returns the arithmetic sum of its operands.
symbol: +
constraint: Argument
  comment: the second number
  value type: Resource
  predicate: arg2
constraint: Argument
  comment: the first number
  value type: Resource
  predicate: arg1

sha512
type: Function
subclass of: Misc functions
comment: Returns the SHA512 checksum, as a hex digit string, calculated on the UTF-8 representation of the simple literal or lexical form of the xsd:string. Hex digits SHOULD be in lower case.
symbol: SHA512
return type: string
constraint: Argument
  comment: The input literal.
  predicate: arg1

UUID
type: Function
subclass of: URI functions
comment: Returns a fresh IRI from the UUID URN scheme. Each call of UUID() returns a different UUID. It must not be the "nil" UUID (all zeroes). The variant and version of the UUID is implementation dependent.
symbol: UUID
return type: Resource

URI functions
type: Function
subclass of: Functions
comment: A collection of functions that create URI resources.
abstract: true

langMatches
type: Function
subclass of: String functions
comment: Returns true if language-tag (first argument) matches language-range (second argument) per the basic filtering scheme defined in [RFC4647] section 3.3.1.
symbol: langMatches
return type: boolean
constraint: Argument
  comment: the language tag that ?arg1 must have
  value type: string
  predicate: arg2
constraint: Argument
  comment: the literal that is expected to have ?arg2 as language tag
  value type: Literal
  predicate: arg1

strdt
type: Function
subclass of: Ontology functions
comment: Constructs a literal with lexical form and type as specified by the arguments.
symbol: STRDT
constraint: Argument
  comment: The datatype of the new literal.
  value type: Datatype
  predicate: arg2
constraint: Argument
  comment: The lexical form of the new literal.
  value type: string
  predicate: arg1

contains
type: Function
subclass of: String functions
comment: Returns an xsd:boolean indicating whether or not the value of ?arg1 contains (at the beginning, at the end, or anywhere within) at least one sequence of collation units that provides a minimal match to the collation units in the value of ?arg2, according to the collation that is used.
symbol: CONTAINS
constraint: Argument
  comment: The sub-string to search for in the input string.
  value type: string
  predicate: arg2
constraint: Argument
  comment: The input string.
  value type: string
  predicate: arg1

isUntypedLiteral
type: Function
subclass of: Boolean functions
comment: Checks whether a given literal is untyped. This function was introduced because the built-in datatype operand in SPARQL casts untyped literals to xsd:string, making it impossible to check it this way. This function here uses a work-around using sameTerm instead.
return type: boolean
constraint: Argument
  comment: The literal to test.
  value type: Literal
  predicate: arg1
body: Ask
  where: Filter
    expression: and
      arg2: not
        arg1: sameTerm
      arg1: isLiteral
        arg1: arg1

eval
constraint: Argument
  comment: The expression to evaluate. Should be a sp:Select, sp:Ask, a sp:Variable or an instance of a SPARQL function class, but may also be a simple RDF value.
  predicate: arg1

IF
type: Function
subclass of: Misc functions
comment: The SPARQL 1.1 built-in function IF.
symbol: IF
constraint: Argument
  comment: The function result if ?arg1 is false.
  predicate: arg3
constraint: Argument
  comment: The function result if ?arg1 is true.
  predicate: arg2
constraint: Argument
  comment: A condition to evaluate - if true then the ?arg2 will be returned, otherwise ?arg3.
  value type: boolean
  predicate: arg1

not
type: Function
subclass of: Boolean functions
comment: Returns the boolean negation of the argument.
symbol: !
return type: boolean
constraint: Argument
  comment: the operand to negate
  value type: boolean
  predicate: arg1

instanceOf
type: Function
version info: Note that in TopBraid this function has been implemented in native Java code, for performance reasons.
body: Ask
  where: Union
    elements:
      rest:
        first: TriplePath
      first: Filter
        expression: or
    elements:
      rest:
        first: Bind
      first: Filter
        expression: isLiteral
constraint: Argument
  comment: the type that the instance must have
  value type: Class
  predicate: arg2
comment: Checks whether a given resource (?arg1) has a given type (?arg2). In order to fulfill this condition, there must either be a triple ?arg1 rdf:type ?arg2, or ?instance rdf:type ?subClass where ?subClass is a subclass of ?arg2. If the first argument is a literal, then the second argument must be the matching XSD datatype.
return type: boolean
label template: {?arg1} instance of {?arg2}
constraint: Argument
  comment: the instance being tested
  value type: Resource
  predicate: arg1
subclass of: Boolean functions

lt
type: Function
subclass of: Boolean functions
comment: Returns true if ?arg1 < ?arg2.
symbol: <
return type: boolean
constraint: Argument
  comment: the second operand
  value type: Literal
  predicate: arg2
constraint: Argument
  comment: the first operand
  value type: Literal
  predicate: arg1

eq
type: Function
subclass of: Boolean functions
comment: Returns true if both arguments are equal.
symbol: =
return type: boolean
constraint: Argument
  comment: the second value to compare
  value type: boolean
  predicate: arg2
constraint: Argument
  comment: the first value to compare
  value type: boolean
  predicate: arg1

NOT EXISTS
type: Function
subclass of: Boolean functions
comment: The filter function NOT EXISTS. The graph pattern is stored in sp:elements.
symbol: NOT EXISTS
return type: boolean

concat
type: Function
subclass of: String functions
comment: The CONCAT built-in function. Creates a single string by concatenating all arguments from left to right. Note that if any one of the arguments is unbound (null) then the whole result string will be unbound.
symbol: CONCAT
return type: string

isIRI
type: Function
subclass of: Boolean functions
comment: Checks whether a given node is a IRI node.
symbol: isIRI
return type: boolean
constraint: Argument
  comment: the node being tested
  predicate: arg1

datatype
type: Function
subclass of: Ontology functions
comment: Returns the datatype IRI of argument ?arg1; returns xsd:string if the parameter is a simple literal.
symbol: datatype
return type: Class
constraint: Argument
  comment: the literal to get the datatype of
  value type: Literal
  predicate: arg1

gt
type: Function
subclass of: Boolean functions
comment: Returns true if ?arg1 > arg2.
symbol: >
return type: boolean
constraint: Argument
  comment: the second operand
  value type: Literal
  predicate: arg2
constraint: Argument
  comment: the first operand
  value type: Literal
  predicate: arg1

ne
type: Function
subclass of: Boolean functions
comment: Returns true if ?arg1 != ?arg2.
symbol: !=
return type: boolean
constraint: Argument
  comment: the second operand
  predicate: arg2
constraint: Argument
  comment: the first operand
  predicate: arg1

object
type: Function
version info: Note that in TopBraid this function has been implemented in native Java code, for performance reasons.
subclass of: Ontology functions
comment: Gets the object of a given subject (?arg1) / predicate (?arg2) combination. Note that if multiple values are present then the result might be unpredictably random.
constraint: Argument
  comment: The predicate to get the object of.
  value type: Property
  predicate: arg2
constraint: Argument
  comment: The subject to get the object from.
  value type: Resource
  predicate: arg1
body: Select
  where:
    subject: arg1
    predicate: arg2
    object:
      var name: object
  result variables:
    var name: object

bound
type: Function
subclass of: Boolean functions
comment: Returns true if ?arg1 is bound to a value. Returns false otherwise. Variables with the value NaN or INF are considered bound.
symbol: bound
return type: boolean
constraint: Argument
  comment: the variable or expression that is checked
  predicate: arg1

objectCount
type: Function
subclass of: Ontology functions
comment: Gets the number of values of a given property (?arg2) at a given subject (?arg1). The result is the number of matches of (?arg1, ?arg2, ?object).
return type: integer
constraint: Argument
  comment: the property to get the number of values of
  value type: Property
  predicate: arg2
constraint: Argument
  comment: the subject to get the number of objects of
  value type: Resource
  predicate: arg1
body: Select
  where:
    subject: arg1
    predicate: arg2
    object:
      var name: object
  result variables:
    var name: result
    expression: Count
      expression:
        var name: object

regex
type: Function
constraint: Argument
  comment: the input string
  value type: string
  predicate: arg1
comment: Returns true if a string (?arg1) matches the regular expression supplied as a pattern (?arg2) as influenced by the value of flags (?arg3), otherwise returns false.
return type: boolean
constraint: Argument
  comment: the flags
  value type: string
  predicate: arg3
  optional: true
subclass of: String functions
constraint: Argument
  comment: the match pattern
  value type: string
  predicate: arg2
symbol: regex

and
type: Function
subclass of: Boolean functions
comment: Return the logical AND between two (boolean) operands.
symbol: &&
return type: boolean
constraint: Argument
  comment: the second operand of the intersection
  value type: boolean
  predicate: arg2
constraint: Argument
  comment: the first operand of the intersection
  value type: boolean
  predicate: arg1

isBlank
type: Function
subclass of: Boolean functions
comment: Checks whether a given node is a blank node.
symbol: isBlank
return type: boolean
constraint: Argument
  comment: the node being checked
  predicate: arg1

or
type: Function
subclass of: Boolean functions
comment: Returns the logical OR between two (boolean) operands.
symbol: ||
return type: boolean
constraint: Argument
  comment: the second operand
  value type: boolean
  predicate: arg2
constraint: Argument
  comment: the first operand
  value type: boolean
  predicate: arg1

same term
type: Function
subclass of: Boolean functions
comment: Returns TRUE if ?arg1 and ?arg2 are the same RDF term as defined in Resource Description Framework (RDF): Concepts and Abstract Syntax; returns FALSE otherwise.
symbol: sameTerm
return type: boolean
constraint: Argument
  comment: the second argument
  predicate: arg2
constraint: Argument
  comment: the first argument
  predicate: arg1

EXISTS
type: Function
subclass of: Boolean functions
comment: The filter function EXISTS. The graph pattern is stored in sp:elements.
symbol: EXISTS
return type: boolean

isLiteral
type: Function
subclass of: Boolean functions
comment: Checks whether a given node is a literal.
symbol: isLiteral
return type: boolean
constraint: Argument
  comment: the node being tested
  predicate: arg1

Bind
variable:
  var name: bp
expression: constraint

Bind
variable:
  var name: bp
expression: constructor

Bind
variable:
  var name: bp
expression: rule

var name: rule

Bind
variable:
  var name: label
expression: concat
  arg2: localname
    arg1:
      var name: predicate
  arg1: Missing value for argument

Filter
expression: or
  arg2: eq
    arg2: false
    arg1:
      var name: optional
  arg1: not
    arg1: bound
      arg1:
        var name: optional

notExists
type: NOT EXISTS
elements:
  subject: this
  predicate:
    var name: predicate
  object:
    var name: value

notExists
type: NOT EXISTS
elements:
  subject: this
  predicate: type
  object:
    var name: template
elements: Filter
  expression: instanceOf
    arg2: Union template
    arg1:
      var name: template

Bind
variable:
  var name: label
expression: concat
  arg5: )
  arg4: localname
    arg1:
      var name: valueType
  arg3: (expected:
  arg2: localname
    arg1:
      var name: predicate
  arg1: Incorrect type of argument

Filter
expression: bound
  arg1:
    var name: valueType

var name: predicate

var name: value

and
arg2: or
  arg2: isLiteral
    arg1:
      var name: value
  arg1: ne
    arg2: Resource
    arg1:
      var name: valueType
arg1: not
  arg1: instanceOf
    arg2:
      var name: valueType
    arg1:
      var name: value

var name: rule

and
arg2: lt
  arg2:
    var name: minCount
  arg1: objectCount
    arg2:
      var name: predicate
    arg1: this
arg1: bound
  arg1:
    var name: minCount

and
arg2: gt
  arg2:
    var name: maxCount
  arg1: objectCount
    arg2:
      var name: predicate
    arg1: this
arg1: bound
  arg1:
    var name: maxCount

subject: this
predicate:
  var name: predicate
object:
  var name: value

first: Filter
  expression: not
    arg1: instanceOf
      arg2:
        var name: valueType
      arg1:
        var name: value
rest: nil

bound
arg1:
  var name: valueType

var name: property

var name: superClass

var name: superClass

var name: property

TriplePath
subject:
  var name: list
path: ModPath
  sub path: rest
  mod min: 0
  mod max: -2
object:
  var name: listSegment

first: TriplePath
  subject:
    var name: property
  path: SeqPath
    path2: unionOf
    path1: domain
  object:
    var name: list
rest: nil

var name: listSegment

var name: superClass

subject: arg1
predicate: domain
object:
  var name: anyDomain

var name: property

var name: anyValue

var name: pattern

string
arg1:
  var name: object

var name: otherProperty

var name: someValue

var name: property

var name: object

gt
arg2:
  var name: max
arg1:
  var name: object

bound
arg1:
  var name: max

lt
arg2:
  var name: min
arg1:
  var name: object

bound
arg1:
  var name: min

gt
arg2:
  var name: maxCount
arg1:
  var name: objectCount

bound
arg1:
  var name: maxCount

lt
arg2:
  var name: minCount
arg1:
  var name: objectCount

bound
arg1:
  var name: minCount

var name: object

var name: anyType

ne
arg2:
  var name: expected
arg1:
  var name: actual

bound
arg1:
  var name: expected

bound
arg1:
  var name: actual

bound
arg1:
  var name: expected

var name: otherProperty

var name: someValue

var name: property

var name: object

TriplePath
subject:
  var name: class
path: ModPath
  sub path: subClassOf
  mod min: 0
  mod max: -2
object: arg2

Filter
expression: or
  arg2: and
    arg2: eq
      arg2: string
      arg1: arg2
    arg1: or
      arg2: eq
        arg1: langString
      arg1: not
        arg1: bound
  arg1: or
    arg2: eq
      arg2: Literal
      arg1: arg2
    arg1: eq
      arg2: arg2
      arg1:
        var name: datatype

var name: datatype

bound
arg1:
  var name: datatype

var name: class

Bind
variable:
  var name: datatype
expression: datatype
  arg1: arg1