Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Standard Datatypes #74

Closed
VladimirAlexiev opened this issue Sep 19, 2024 · 4 comments
Closed

Use Standard Datatypes #74

VladimirAlexiev opened this issue Sep 19, 2024 · 4 comments
Assignees
Labels
datatype Pertains to datatypes in ontology and instance data ontology Pertains to ontology representation

Comments

@VladimirAlexiev
Copy link
Collaborator

VladimirAlexiev commented Sep 19, 2024

CIM defines its own datatypes:

cim:Boolean a rdfs:Class ;
  rdfs:label "Boolean"@en ;
  rdfs:comment "A type with the value space \"true\" and \"false\"." ;
  cims:belongsToCategory dl:Package_DiagramLayoutProfile ;
  cims:stereotype "Primitive" .

This query finds all their uses:

PREFIX cims: <http://iec.ch/TC57/1999/rdf-schema-extensions-19990926#>
select ?dt (count(*) as ?c) {
  ?prop cims:dataType ?dt.
  ?dt cims:stereotype "Primitive"
} group by ?dt order by ?dt

(Note: the next section deals with cims:stereotype "CIMDatatype").

We want to map them to corresponding XSD datatypes:

dt c xsd
cim:Boolean 230 xsd:boolean
cim:Date 1 xsd:date
cim:DateTime 64 xsd:dateTime
cim:Decimal 16 xsd:decimal
cim:Duration 26 xsd:duration
cim:Float 369 xsd:float
cim:Integer 59 xsd:integer
cim:MonthDay 2 xsd:gMonthDay
cim:String 121 xsd:string
cim:Time 2 xsd:time
eu:URI 2 xsd:anyURI
profcim:IRI 3 xsd:anyURI
profcim:StringFixedLanguage 1 xsd:string
profcim:StringIRI 3 xsd:string
eumd:DateTimeStamp 2 xsd:dateTimeStamp

This means to delete all their statements, and replace with standard datatypes.

Notes:

  • profcim:StringIRI is used for identifier, conformsTo,
    i.e. values that can be "string or IRI" (though its description mentions only IRI).
    But when we are unsure, we must go with the "lowest common denominator" which is string
  • Potentially mapping cim:String to rdf:PlainLiteral is considered in Multilinguality in CIM? #73
@VladimirAlexiev VladimirAlexiev added ontology Pertains to ontology representation datatype Pertains to datatypes in ontology and instance data labels Sep 19, 2024
@VladimirAlexiev VladimirAlexiev self-assigned this Sep 22, 2024
@VladimirAlexiev
Copy link
Collaborator Author

VladimirAlexiev commented Sep 22, 2024

fix02-datatypes-74.ru does this:

  • replace prop ranges with standard datatypes
  • delete definitions of CIM Primitives (all their statements)

@Sveino
Copy link
Owner

Sveino commented Sep 23, 2024

In CIM18 we have added anyURI as primitive.
We have also agreed to add:

  • year (xsd:gYear)
  • day (xsd:gDay)
  • month (xsd:gMonth)
  • yearMonth (xsd:gYearMonth)

We have agreed that we can define some constraints the the primitive in the profile:

  • Decimal

totalDigits: Specifies the total number of digits allowed in the decimal value (including both the integer and fractional parts).

fractionDigits: Specifies the maximum number of digits allowed after the decimal point.

  • Float

Float : Single position (including not-a-number (NoN) xsd:float

FloatRealNumber: Real number single position

Double: double position (including not-a-number (NoN) xsd:double

DoubleRealNumber: Real number double position

  • Integer

Integer (no restriction)

PositiveInteger xsd:positiveInteger

NonPositiveInteger xsd:nonPositiveInteger

NegativeInteger xsd:negativeInteger

NonNegativeInteger xsd:nonNegativeInteger

  • anyURI

uUUID (RFC 4122 e.g. urn:uuid:c757873d-ec9a-4326-a141-556f43239520 (non case sensitive)

eIC https://www.[iana.org/assignments/urn-formal/eic](https://www.iana.org/assignments/urn-formal/eic) e.g. urn:eic::10X1001A1001A16H

url Uniform Resource Identifier Reference (RFC 3986 icon). Note: URIs are case sensitive. For UUID (urn:uuid:53fefa32-fcbb-4ff8-8a92-55ee120877b7) use all lowercase

uri Uniform Resource Locator (RFC 1738 icon). Note URLs are accessed directly using the specified protocol.

uriString dct:conformsTourn:iso:std:iec:61970-600-2:ed-1</dct:conformsTo>

  • string: maxLength

#profcim:StringIRI is used for identifier, conformsTo,
i.e. values that can be "string or IRI" (though its description mentions only IRI).
The point with this was that it is a URI, but should be exchange as a String.

@Sveino
Copy link
Owner

Sveino commented Sep 23, 2024

I think it is find to remove the primitive from the RDFS and only refer to xsd. However, in SHACL we need to address the different constraints.

@VladimirAlexiev
Copy link
Collaborator Author

VladimirAlexiev commented Sep 23, 2024

  • "FloatRealNumber, DoubleRealNumber": I don't know what these are
  • "NoN": the right spelling is "NaN"
  • "totalDigits, fractionDigits": can be specified by deriving from XSD datadypes, but no repositories I know about process custom datatypes. So it's better to check with SHACL: maxLength and a regex respectively
  • "StringIRI.. is a URI, but should be exchange as a String": that is xsd:anyURI

Reopen this so I can add to the mapping:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datatype Pertains to datatypes in ontology and instance data ontology Pertains to ontology representation
Projects
None yet
Development

No branches or pull requests

3 participants
@VladimirAlexiev @Sveino and others