The object is a MD5 hash of the subject.
The object is a SHA-1 hash of the subject.
The object is a SHA-256 hash of the subject.
The object is a SHA-512 hash of the subject.
This is an ontology for computable list functions.
Concatenates separate lists into a single list
schema:
($a_1 .. $a_n) list:append $a_s
definition:
true
if and only if the subject is a list of lists and the concatenation of all those lists
is $a_s
.
$a_s
can be calculated as a function of the subject.
requires:
all $a_1, .., $a_n
to be lists with all constituent members bound.
example:
( (1 2) (3 4) ) list:append (1 2 3 4).
Extracts the first member of a list.
schema:
($a_1 .. $a_n) list:first $a_s
definition:
true
if and only the subject is a list and $a_s
is the first member of that list.
$a_s
can be calculated as a function of the subject.
requires:
all $a_1, .., $a_n
to be bound.
Determines if an subject is a member of the object list or binds every member of the object list to the subject.
schema:
$a_1 list:in $a_2
definition:
true
if and only $a_2
is a list and $a_1
is in that list.
$a_1
can be calculated from $a_2
.
requires:
$a_2
to be a bound list.
Iterates over index/value pairs of the subject list
schema:
($a_1 .. $a_n) list:iterate ($i $v)
definition:
Gets the matching pair of list index and list value for every member of the subject.
If the object is a variable, it will create a solution for each member of the subject list.
If any member of the object list is a variable, it will create a solution for all matching
members of the subject list.
If the object is ground and the entry at the specified index matches the specified value,
it evaluates to true
; otherwise, false
.
requires:
$i
is an integer.
example:
( 1 2 3 ) list:iterate ($i $v).
Extracts the first member of a list.
schema:
($a_1 .. $a_n) list:last $a_s
definition:
true
if and only the subject is a list and $a_s
is the last member of that list.
$a_s
can be calculated as a function of the subject.
requires:
all $a_1, .., $a_n
to be bound.
Calculates the length of a list.
schema:
($a_1 .. $a_n) list:length $a_s
definition:
true
if and only the subject is a list and $a_s
is integer length of that list.
$a_s
can be calculated as a function of the subject.
requires:
$a_1, .., $a_n
to be bound.$a_s
: unbound, xs:integer
(or its derived types) (see note on type promotion, and casting from string)Determines if an object is a member of the subject list or binds every member of the subject list to the object.
schema:
$a_1 list:member $a_2
definition:
true
if and only $a_1
is a list and $a_2
is in that list.
$a_2
can be calculated from $a_1
.
requires:
$a_1
to be a bound list.
Gets the member of a list at a given position (where the position of the first element is 1)
schema:
(($a_1 .. $a_n) $a_i) list:memberAt $a_m
definition:
Iff ($a_1 .. $a_n)
has an element at position $a_i
,
and if that element and $a_m
can unify.
requires:
$a_i
or $a_m
(or both) must be bound.
Note that if $a_i
is a variable, this builtin may bind it to more than one value
(e.g. ((“A” “B” “A”) ?i) list:memberAt "A"
).
literal domains:
$a_1 .. $a_n
, $a_m
: unconstrained$a_i
: xs:decimal
, xs:float
, xs:double
within the value space of xs:integer
(see also note on type promotion and substitution).
I.e., in case the double/float/decimal's literal's value is within the value space of integers,
the literal will match the domain.
In case of a negative integer, the index will count backwards from the length of the list.Removes the second component of the subject list from the first component of that list.
schema:
($a_1 $a_2) list:remove $a_3
definition:
Iff the subject is a list of two lists $a_1
and $a_2
, $a_2
is a subset of $a_1
and $a_3
is a list composed of the members of the $a_1
with
all members of $a_2
removed, matching left to right.
$a_3
can be calculated as a function of the subject.
requires:
$a_1
and $a_2
must be bound lists.
example:
( (1 2 3 4) (2 3) ) list:remove (1 4).
These raise the level above RDF's pure relational data, and Web Ontology's ontological level, to allow rules to be expressed and inference done. They connect the inference to the web, allowing data to be fetched from resources elsewhere, and remote servers to be queried.
Any statement mentioning anything in this class is considered boring and purged by the cwm --purge option. This is a convenience, and does not have any value when published as a general fact on the web.
The class of Notation-3 Formulae
A Notation-3 List, as a resource. A sub-class of an RDF List.
A document which, which parsed as Notation3 as defined in general by http://www.w3.org/DesignIssues/Notation3.html and this schema, conveys the intent of the author by the semantics defined on those specifications, and the semantics defined by the specifications of any other identifiers used in the document.
Some other Notation-3 type
An RDF Literal
Something which is true: believe it as you would believe this.
Understood natively by cwm in that it will execute rules in a formula declared a Truth within a formula it is already taking rules from.
The class of Notation3-specifiec resource types.
Built-in to perform RDF linear implication i.e. retracting the subject graph and asserting the object graph.
All possible conclusions which can be drawn from a formula.
schema:
$a_1 log:conclusion $a_2
definition:
$a_2
is the set of conclusions which can be
drawn from $a_1
, by successively applying any
rules it contains to the data it contains.
requires:
$a_1
is a formula
$a_2
is unbound or a formula.
note: This is equivalent to cwm's "--think" command line function. It does use built-ins, so it may for example indirectly invoke other documents, validate signatures, etc.
A function to merge formulae: logical AND.
schema:
($a_1 .. $a_n) log:conjunction $a_s
definition:
$a_s
, which can be generated, is a formula containing a copy
of each of the formulae $a_1 .. $a_n
.
requires:
all $a_1, .., $a_n
to be formulae.
This connects a document and a string that represents it. (Cwm knows how to go get a document in order to evaluate this.)
schema:
$a_1 log:content $a_2
requires:
$a_1
must be an IRI.
$a_2
must be either unbound or a string.
note: The content-type of the information is not given and so must be known or guessed.
When document D is the definitiveDocument for property P, any statement X P Y is true iff the semantics of document D include that statement.
For example, there may be a definitive document for the zipcode of airports by airport code, and so on. This is useful to let a reasoner know that it can extend its query to the given document. (Cwm will do this if its mode includes "r").
When service S is the definitiveService for property P,
any statement X P Y is true iff and only if a query to S returns
that it is. The protocol for the service S depends on the scheme.
For mysql protocol, the URI of the service is like
sql://user:password@host.domain/database/
.
For example, there may be a definitive service for the zipcode of airports by airport code, and so on. This is useful to let a reasoner know that it can help resolve a query by delegating it to the service in question. (Cwm will do this if its mode includes "r").
Takes a list of a string and a URI and creates a datatyped literal.
schema:
($a_1 $a_2) log:dtlit $a_3
definition:
true
if and only if the datatyped literal formed of $a_1
and $a_1
equals $a_3
.
The subject is a list composed of a string and an IRI, and the object
is a datatyped literal with the value $a_1
and datatype $a_2
.
requires:
$a_1
and $a_2
to be bound.
$a_1
to be a xs:string
(see note on casting to string).
$a_2
to be an IRI.
example:
`{ ("2005-03-30T11:00:00" :tz) log:dtlit ?X } => { ?X a :Answer } .
will produce "2005-03-30T11:00:00"^^:tz a :Answer .
Determines if two RDF resources are the same.
schema:
$a_1 log:equalTo $a_2
definition:
true
if and only if $a_1
and $a_2
are the same RDF node (symbol or literal).
Do not confuse with owl:sameAs.
Built-in used as ?SCOPE e:findall (?SELECT ?WHERE ?ANSWER).
Within the subject ?SCOPE
it unifies ?ANSWER
with a list that contains
all the instantiations of ?SELECT
satisfying the ?WHERE
clause.
Built-in for implementing a scoped universal quantification.
Built-in for implementing a scoped universal quantification.
Logical implication.
This is the relation between the antecedent (subject) and conclusion (object) of a rule.
schema:
$a_1 log:implies $a_2
definition:
The application of a rule to a knowledge-base is as follows.
For every substitution which, applied to the antecedent ($a_1
),
gives a formula ($a_2
) which is a subset of the knowledge-base,
then the result of applying that same substitution to the
conclusion may be added to the knowledge-base.
requires:
$a_1
and $a_2
must be formulae.
related:
See log:conclusion
.
The subject formula includes the object formula.
schema:
$a_1 log:includes $a_2
definition:
$a_1
includes $a_2
if there exists some substitution
which when applied to $a_2
creates a formula B' such that for
every statement in B' is also in $a_1
, every variable
universally (or existentially) quantified in B' is quantified in
the same way in $a_1
.
Variable substitution is applied recursively to nested compound terms such as formulae, lists and sets.
requires:
$a_1
and $a_2
must be formulae.
note: You can use this to peer inside nested formulae.
The subject formula, expressed as N3, gives this string.
schema:
$a_1 log:n3String $a_2
definition:
$a_1
, serialized as N3, gives $a_2
.
requires:
$a_1
is a formula.
related:
See log:parsedAsN3
.
Determines if two RDF resources are not the same.
schema:
$a_1 log:notEqualTo $a_2
definition:
true
if and only if $a_1
and $a_2
are not the same RDF node (symbol or literal).
Custom built-in for implementing scoped negation-as-failure (SNAF).
Custom built-in for implementing scoped negation-as-failure (SNAF).
The object formula is NOT a subset of subject.
schema:
$a_1 log:notIncludes $a_2
definition:
true
if and only if log:includes
is false
. The converse of log:includes.
related:
See log:includes
.
The subject is a key and the object is a string, where the strings are to be output in the order of the keys. See cwm --strings in cwm --help.
The subject string, parsed as N3, gives this formula.
schema:
$a_1 log:parsedAsN3 $a_2
definition:
$a_1
, parsed as N3, gives $a_2
.
requires:
$a_1
is a syntactically valid string in N3 format.
related:
See log:n3String
.
For anything identified by a URI with a fragid, this is the thing identified by the same URI without a hash or fragid. For anything else, it is itself.
Returns an identifier based on the type of the RDF Resource.
schema:
$a_1 log:rawType $a_2
definition:
true
if the type of $a_1
is the same as $a_2
, or binds the type to $a_2
.
requires:
$a_2
is unbound or one of log:Formula
, log:Literal
,
log:List
, log:Set
or log:Other
.
example:
log:semanticsOrError
returns either a formula or a string, and you can check which using log:rawType
.
This allows one to look at the actual string of the URI which identifies this, for anything, even a blank node or a formula. This peeks into the internal workings of cwm, and so is not normally used. Use log:uri instead.
The log:semantics of a document is the formula achieved by parsing representation of the document.
schema:
$a_1 log:semantics $a_2
definition:
For a document in Notation3, log:semantics
is the
log:parsedAsN3
of the log:content
of the document.
For a document in another RDF syntax, it is parsed according to the
appropriate specification to yield an RDF formula
(a subclass of N3 log:Formula
).
Evaluates to false
if an unrecognized document format is retrieved.
requires:
$a_1
must be an IRI.
aside: Philosophers will be distracted here into worrying about the meaning of meaning. At least we didn't call this function "meaning"! In as much as N3 is used as an interlingua for interoperability for different systems, this for an N3 based system is the meaning expressed by a document.
related:
See log:parsedAsN3
and log:content
.
This connects a document and either the formula it parses to, or an error message explaining what went wrong with trying.
schema:
$a_1 log:semanticsOrError $a_2
requires:
$a_1
must be an IRI.
related:
See log:semantics
.
Built-in to generate a Skolem IRI object which is a function of the arguments in the subject list
This allows one to look at the actual string of the URI which identifies this.
(Cwm can get the URI of a resource or get the resource from the URI.) This is a level breaker, breaking the rule of not looking inside a URI. Use (eg with string:match) to replace RDF's old "aboutEach" functionality. Use to implement the URI spec and protocol specs, etc.
The class log:N3 is the class of N3 literal values. log:N3 is an instance of rdfs:Datatype and a subclass of rdfs:Literal. The value of log:content of a log:N3Document is a literal with datatype log:N3.
This is an ontology for computable math functions.
A math:Function is unique in terms of math:EqualTo.
The class of things that are N3 lists where all of the members are math:Value items.
A logical operator allows evaluation eihter way, or testing relationship between two values
A math:ReverseFunction is unambiguous in terms of math:EqualTo.
The class of things that compare values.
This is the class of things that are math lists with only two members.
The class of things that derive from XSD numeric datatypes.
The object is calulated as the absolute value of the subject.
The object is calulated as the arc cosine value of the subject.
The object is calulated as the arc sine value of the subject.
The object is calulated as the arc tangent value of the subject.
The subject is an angle expressed in radians. The object is calulated as the cosine value of the subject.
The subject is an angle expressed in radians. The object is calulated as the #hyperbolic cosine value of the subject.
The subject is an angle expressed in radians. The object is calulated as the conversion in degrees of the value of the subject.
The subject is a pair of numbers. The object is calculated by subtracting the second number of the pair from the first.
schema:
$a1 math:equalTo $a2
summary: checks equality of numbers
definition:
true
if and only if $a1
is equal to $a2
.
requires:
$a_1
or $a_2
(or both) must be either concrete numerals, or variables bound to a numeral.
literal domains:
$a1
: xs:decimal
(or its derived types), xs:float
, or xs:double
(see note on type promotion, and casting from string)$a2
: xs:decimal
(or its derived types), xs:float
, or xs:double
(see note on type promotion, and casting from string)The subject is a pair of numbers. The object is calculated by raising the first number of the power of the second.
True iff the subject is a number which is greater than the object.
The subject is a pair of numbers. The object is calculated by dividing the first number of the pair by the second, ignoring remainder.
True iff the subject is a number which is LESS than a object.
The number of items in a list. The subject is a list, the object is calculated as the number of members. Obsolete, see list:length
The subject or object is calculated to be the negation of the other.
True iff the subject is a number which is NOT EQUAL to a object.
True iff the subject is a number which is NOT greater than the object.
True iff the subject is a number which is NOT LESS than a object.
The subject is a list of numbers. The object is calculated as the arithmentic product of those numbers.
The subject is a pair of numbers. The object is calculated by dividing the first number of the pair by the second.
The subject is a pair of integers. The object is calculated by dividing the first number of the pair by the second and taking the remainder.
The object is calulated as the number with no fractional part that is closest to the subject. If there are two such numbers, then the one that is closest to positive infinity is returned.
The subject is an angle expressed in radians. The object is calulated as the sine value of the subject.
The subject is an angle expressed in radians. The object is calulated as the hyperbolic sine value of the subject.
schema:
($a_1 .. $a_n) math:sum $a_s
summary: performs addition of numbers
definition:
true
if and only if the arithmetic sum of $a_1, .. $a_n
equals $a_s
.
requires:
all $a_1, .., $a_n
to be bound.
literal domains:
$a_1 .. $a_n
: xs:decimal
(or its derived types), xs:float
, or xs:double
(see note on type promotion, and casting from string)$a_s
: xs:decimal
(or its derived types), xs:float
, or xs:double
(see note on type promotion, and casting from string)The subject is an angle expressed in radians. The object is calulated as the tangent value of the subject.
The subject is an angle expressed in radians. The object is calulated as the hyperbolic tangent value of the subject.
This is an ontology for computable string functions. It is implemented, for example, in CWM and Euler.
(obsolete - (was backwards!) - use: string:concatenation)
schema:
($a_1 .. $a_n) string:concatenation $a_s
summary: concatenates the given resources
definition:
true
if and only if the string concatenation of $a_1, .. $a_n
equals $a_s
.
requires:
all $a_1, .., $a_n
to be bound.
literal domains:
$a_1 .. $a_n
: xs:string
(see note on casting to string)$a_s
: xs:string
(see note on casting to string)True iff the subject string contains the object string.
True iff the subject string contains the object string, with the comparison done ignoring the difference between upper case and lower case characters.
True iff the subject string ends with the object string.
True iff the subject string is the same as object string ignoring differences between upper and lower case.
The subject is a list, whose first member is a format string, and whose remaining members are arguments to the format string. The formating string is in the style of python's % operator, very similar to C's sprintf(). The object is calculated from the subject.
True iff the string is greater than the object when ordered according to Unicode(tm) code order.
True iff the string is less than the object when ordered according to Unicode(tm) code order.
The subject is a string; the object is is a regular expression in the perl, python style. It is true iff the string matches the regexp.
True iff the subject string is the NOT same as object string ignoring differences between upper and lower case.
True iff the string is NOT greater than the object when ordered according to Unicode(tm) code order.
True iff the string is NOT less than the object when ordered according to Unicode(tm) code order.
The subject string; the object is is a regular expression in the perl, python style. It is true iff the string does NOT match the regexp.
A built-in for replacing characters or sub. takes a list of 3 strings; the first is the input data, the second the old and the third the new string. The object is calculated as the replaced string. For example, ("fofof bar", "of", "baz") string:replace "fbazbaz bar".
The subject is a list of two strings. The second string is a regular expression in the perl, python style. It must contain one group (a part in parentheses). If the first string in the list matches the regular expression, then the object is calculated as being the part of the first string which matches the group.
True iff the subject string starts with the object string.
Iff the subject is a xsd:dateTime
and the object is the integer day component of the dateTime.
the object can be calculated as a function of the subject.
Iff the subject is a xsd:dateTime
and the object is the integer the day number within the week, Sunday being 0.
the object can be calculated as a function of the subject.
Iff the subject is a dateTime format string and the object is the
result of formatting the Universal Time of processing in the format given.
If the format string has zero length,
then the ISOdate standard format is used.
[ is time:gmtime of ""]
the therefore the current date time.
It will end with "Z" as a timezone code.
the object can be calculated as a function of the subject.
Rules which use this function will of course NOT be repeatable.
Iff the subject is a xsd:dateTime
and the object is the hour year component of the dateTime.
the object can be calculated as a function of the subject.
Iff the subject is a xsd:dateTime
and the object is the integer number of seconds
since the beginning of the era on a given system. Don't assume a particular value, always test for it.
the object can be calculated as a function of the subject.
Cwm implements this as a bidirectional function: you can calculate the ISO date from the seconds since the beginning of the era, or vice-versa.
Iff the subject is a dateTime format string and the object is the
result of formatting the current time of processing and local timezone in the format given.
If the format string has zero length,
then the ISOdate standard format is used.
[ is time:gmtime of ""]
the therefore the current date time.
It will end with "Z" as a timezone code.
the object can be calculated as a function of the subject.
Rules which use this function will of course NOT be repeatable.
Iff the subject is a xsd:dateTime
and the object is the integer minute component of the dateTime.
the object can be calculated as a function of the subject.
Iff the subject is a xsd:dateTime
and the object is the integer month component of the dateTime.
the object can be calculated as a function of the subject.
Iff the subject is a xsd:dateTime
and the object is the integer year component of the dateTime.
the object can be calculated as a function of the subject.
Iff the subject is a xsd:dateTime
and the object is the trailing timezone offset
part, e.g. "-05:00"..
the object can be calculated as a function of the subject.
Iff the subject is a xsd:dateTime
and the object is the integer year component of the dateTime.
the object can be calculated as a function of the subject.
These are terms drawn to match the available functions in mxCrypto.