OWL: what is the difference between non-negative integer and positive integer? - semantics

I am trying to use Protégé to build my OWL ontology
Whilst building some data properties, I found that OWL has two types: non negative integer and positive integer: what is the difference between them?

They come from XML Schema:
Positive Integer
positiveInteger is ·derived· from nonNegativeInteger by setting the value of ·minInclusive· to be 1. This results in the standard mathematical concept of the positive integer numbers. The ·value space· of positiveInteger is the infinite set {1,2,...}. The ·base type· of positiveInteger is nonNegativeInteger.
Non-Negative Integer
nonNegativeInteger is ·derived· from integer by setting the value of ·minInclusive· to be 0. This results in the standard mathematical concept of the non-negative integers. The ·value space· of nonNegativeInteger is the infinite set {0,1,2,...}. The ·base type· of nonNegativeInteger is integer.

Related

RedisGraph: Specifing Integer type of values ? Max int?

Is there a way to specify which specific type of integer a property can use : int16, uint32 .. ?
or is it just NUMBER ??
Second : which is the biggest integer value that we can use in RedisGraph ?
Currently, all integers are stored as 64-bit signed integers, so the max size will always be INT64_MAX. The largest value is theoretically implementation-defined, but on all the systems I'm familiar with this resolves to 0x7fffffffffffffff, or 9,223,372,036,854,775,807.
Since RedisGraph does not use a schema to enforce the types of properties (a.val can be an integer on one node and a string on another), values are stored in a 16-byte struct with type data, so being able to specify smaller integer types would not result in space savings.

ISO Pascal record variants without a field name

I'm slightly confused trying to figure a section of ISO Pascal.
The grammar allows you to do this:
type RPoint = Record
Case Boolean of
False : (X,Y,Z : Real);
True : (R,theta,phi : Real);
end;
To construct it, you do:
var p: RPoint;
begin
p.x := 1;
end.
There's one part I don't understand: what's the purpose of the Case Boolean part? I understand that you can do case MyVal: Boolean; then MyVal becomes the field selector. However, what is the purpose when there is no field selector, just a type?
In addition, the standard says:
With each variant-part shall be associated a type designated the selector-type possessed by the
variant-part . If the variant-selector of the variant-part contains a tag-field, or if the case-constant-
list of each variant of the variant-part contains only one case-constant, then the selector-type shall
be denoted by the tag-type, and each variant of the variant-part shall be associated with those
values specified by the selector-type denoted by the case-constants of the case-constant-list of the
variant . Otherwise, the selector-type possessed by the variant-part shall be a new ordinal-type that
is constructed to possess exactly one value for each variant of the variant-part, and no others, and
each such variant shall be associated with a distinct value of that type.
I don't quite understand what the selector-type is and why it would be a new ordinal-type. Wouldn't the selector-type just be the type like in case Boolean of? And what does each case-constant-list having only one case-constant have to do with it?
Here your variant record has two possible 'personalities'. Boolean is a type with two possible values. So, it seemed like a logical choice. But, it doesn't have to be Boolean.
You could have used some other ordinal type such as Integer or Byte to get the same effect. For example:
type RPoint = Record
Case Byte of
0: (X,Y,Z : Real);
1: (R,theta,phi : Real);
end;

OWL What's the difference between int and integer type

I have a data type property which is the number of parking inside the building. that is a data type property. i set the domain to building, but when i tried to set the range of that property, i found that i have two options, which are int and integer.
i couldn't find the difference between then. could you help please
OWL uses the XSD datatypes in its specification, so this question has the same answer as XSD: What is the difference between xs:integer and xs:int?, which says:
"The difference is the following: xs:int is a signed 32-bit integer. xs:integer is an integer unbounded value."

math.floor is supposed to return integer

I am trying to get the integer part of a number after dividing two variables.
ie, get 3 if the value is 3.75
displaycount and itemcount are both integer variables.
Dim cntr As Integer
cntr = Math.Floor(Math.Abs(itemCount / displaycount))
That code produces a blue squiggly in VS2012 with the comment that "runtime errors may occur when converting Double to Integer" BUT Math.Floor is supposed to take a decimal or double and return an integer.
"Math.Floor is supposed to take a decimal or double and return an integer." No, it isn't. It returns a value of the same type as its argument. See the documentation, e.g. Math.Floor Method (Double).
I would have expected VS to suggest a fix of adding CInt() around the RHS of the assignment; did that not appear for you?
If you need an Integer as result, consider using either the CInt, Int or the Fix functions.
CInt rounds to the nearest integer using the bankers's rounding (n.5 rounds towards the closest even number).
Int removes the fractional parts. Negative numbers are truncated towards smaller numbers
Int(-8.4) = -9.
Fix removes the fractional parts. Negative numbers are truncated towards greater numbers
Fix(-8.4) = -8.
See Conversion.Int Method and Type Conversion Functions (Visual Basic).

Integer division rounding in VB.NET

When two variables are declared as integer type and you perform
14/4, you get 4, but when you use integer division, 14\4, you get 3.
I thought when you use integer division it rounds to the closest even number. So 14\4 = 3.5 (4 is the closest even number) should be 4 instead,
right?
In VB.NET, the / operator is defined to return a floating-point result. It converts the variables to double before performing the division.
This is not the case in the integer division \ where the division is performed without the remainder if the quotient is a decimal (decimals are ignored). For example if the quotient is 3.x, then x is ignored
When you cast a floating point number to an integer in VB.NET, the value is rounded to the nearest even number. Apparently rounding a number when converting it to an integer is a behavior that stretches back to the days of the BASIC language.
However, when performing integer division (with the \ operator), the fractional part is simply discarded, no matter what the fractional part is. This is why you get the behavior that you are seeing.