Closed tgoprince closed 4 years ago
Consider the OntoUML model fragment below:
The serialization of this model is at the end of this issue.
This generates inconsistencies on the three attributes of the RGB datatype, namely red, green, and blue.
RGB
red
green
blue
This is the code that is generated for them:
:red rdf:type owl:DatatypeProperty; rdfs:subPropertyOf gufo:hasQualityValue; rdfs:domain :Rgb; rdfs:range xsd:int; rdfs:label "red". :green rdf:type owl:DatatypeProperty; rdfs:subPropertyOf gufo:hasQualityValue; rdfs:domain :Rgb; rdfs:range xsd:int; rdfs:label "green". :blue rdf:type owl:DatatypeProperty; rdfs:subPropertyOf gufo:hasQualityValue; rdfs:domain :Rgb; rdfs:range xsd:int; rdfs:label "blue".
Note that :red, :green, and :blue are sub-properties of gufo:hasQualityValue that have :Rgb as their domain.
:red
:green
:blue
gufo:hasQualityValue
:Rgb
This is an issue because gufo:hasQualityValue has gufo:ConcreteIndividual as its domain, and :Rgb is a subtype of gufo:AbstractIndividual.
gufo:ConcreteIndividual
gufo:AbstractIndividual
The solution is to transform datatype attributes simply as datatype properties that DO NOT specialize gufo:hasQualityValue.
{ "type": "Package", "id": "dvqJnw6GAqACBAj5", "name": "AttributeDatatype", "description": null, "contents": [ { "type": "Class", "id": "7vqJnw6GAqACBAj_", "name": "int", "description": null, "properties": null, "literals": null, "propertyAssignments": null, "stereotypes": [ "datatype" ], "isAbstract": false, "isDerived": false }, { "type": "Class", "id": "qCGJnw6GAqACBAyA", "name": "Object with Quality", "description": null, "properties": null, "literals": null, "propertyAssignments": null, "stereotypes": [ "kind" ], "isAbstract": false, "isDerived": false }, { "type": "Class", "id": "xpOJnw6GAqACBAyf", "name": "Color", "description": null, "properties": [ { "type": "Property", "id": ".W5Jnw6GAqACBAzV", "name": "valueInRGB", "description": null, "propertyType": { "type": "Class", "id": "O5VJnw6GAqACBAz1" }, "cardinality": null, "isDerived": false, "isOrdered": false, "isReadOnly": false, "stereotypes": null, "propertyAssignments": null, "subsettedProperties": null, "redefinedProperties": null, "aggregationKind": "NONE" } ], "literals": null, "propertyAssignments": null, "stereotypes": [ "quality" ], "isAbstract": false, "isDerived": false }, { "type": "Class", "id": "O5VJnw6GAqACBAz1", "name": "RGB", "description": null, "properties": [ { "type": "Property", "id": "ePdJnw6GAqACBA0G", "name": "red", "description": null, "propertyType": { "type": "Class", "id": "7vqJnw6GAqACBAj_" }, "cardinality": null, "isDerived": false, "isOrdered": false, "isReadOnly": false, "stereotypes": null, "propertyAssignments": null, "subsettedProperties": null, "redefinedProperties": null, "aggregationKind": "NONE" }, { "type": "Property", "id": "os9Jnw6GAqACBA0K", "name": "green", "description": null, "propertyType": { "type": "Class", "id": "7vqJnw6GAqACBAj_" }, "cardinality": null, "isDerived": false, "isOrdered": false, "isReadOnly": false, "stereotypes": null, "propertyAssignments": null, "subsettedProperties": null, "redefinedProperties": null, "aggregationKind": "NONE" }, { "type": "Property", "id": "wx9Jnw6GAqACBA0O", "name": "blue", "description": null, "propertyType": { "type": "Class", "id": "7vqJnw6GAqACBAj_" }, "cardinality": null, "isDerived": false, "isOrdered": false, "isReadOnly": false, "stereotypes": null, "propertyAssignments": null, "subsettedProperties": null, "redefinedProperties": null, "aggregationKind": "NONE" } ], "literals": null, "propertyAssignments": null, "stereotypes": [ "datatype" ], "isAbstract": false, "isDerived": false }, { "type": "Class", "id": "tQopnw6GAqACBA2x", "name": "Object with Attribute", "description": null, "properties": [ { "type": "Property", "id": "qacpnw6GAqACBA3T", "name": "colorInRGB", "description": null, "propertyType": { "type": "Class", "id": "O5VJnw6GAqACBAz1" }, "cardinality": null, "isDerived": false, "isOrdered": false, "isReadOnly": false, "stereotypes": null, "propertyAssignments": null, "subsettedProperties": null, "redefinedProperties": null, "aggregationKind": "NONE" } ], "literals": null, "propertyAssignments": null, "stereotypes": [ "kind" ], "isAbstract": false, "isDerived": false }, { "type": "Class", "id": "gEOpnw6GAqACBA4q", "name": "Object with Association", "description": null, "properties": null, "literals": null, "propertyAssignments": null, "stereotypes": [ "kind" ], "isAbstract": false, "isDerived": false }, { "type": "Relation", "id": "uVXJnw6GAqACBA1G", "name": null, "description": null, "properties": [ { "type": "Property", "id": "uVXJnw6GAqACBA1H", "name": null, "description": null, "propertyType": { "type": "Class", "id": "xpOJnw6GAqACBAyf" }, "cardinality": "1", "isDerived": false, "isOrdered": false, "isReadOnly": false, "stereotypes": null, "propertyAssignments": null, "subsettedProperties": null, "redefinedProperties": null, "aggregationKind": "NONE" }, { "type": "Property", "id": "uVXJnw6GAqACBA1J", "name": null, "description": null, "propertyType": { "type": "Class", "id": "qCGJnw6GAqACBAyA" }, "cardinality": "1", "isDerived": false, "isOrdered": false, "isReadOnly": true, "stereotypes": null, "propertyAssignments": null, "subsettedProperties": null, "redefinedProperties": null, "aggregationKind": "NONE" } ], "propertyAssignments": null, "stereotypes": [ "characterization" ], "isAbstract": false, "isDerived": false }, { "type": "Relation", "id": "5zhpnw6GAqACBA5U", "name": null, "description": null, "properties": [ { "type": "Property", "id": "5zhpnw6GAqACBA5V", "name": null, "description": null, "propertyType": { "type": "Class", "id": "gEOpnw6GAqACBA4q" }, "cardinality": "0..*", "isDerived": false, "isOrdered": false, "isReadOnly": false, "stereotypes": null, "propertyAssignments": null, "subsettedProperties": null, "redefinedProperties": null, "aggregationKind": "NONE" }, { "type": "Property", "id": "5zhpnw6GAqACBA5X", "name": "hasValueInRGB", "description": null, "propertyType": { "type": "Class", "id": "O5VJnw6GAqACBAz1" }, "cardinality": "1", "isDerived": false, "isOrdered": false, "isReadOnly": false, "stereotypes": null, "propertyAssignments": null, "subsettedProperties": null, "redefinedProperties": null, "aggregationKind": "NONE" } ], "propertyAssignments": null, "stereotypes": null, "isAbstract": false, "isDerived": false } ], "propertyAssignments": null }
Consider the OntoUML model fragment below:
The serialization of this model is at the end of this issue.
This generates inconsistencies on the three attributes of the
RGB
datatype, namelyred
,green
, andblue
.This is the code that is generated for them:
Note that
:red
,:green
, and:blue
are sub-properties ofgufo:hasQualityValue
that have:Rgb
as their domain.This is an issue because
gufo:hasQualityValue
hasgufo:ConcreteIndividual
as its domain, and:Rgb
is a subtype ofgufo:AbstractIndividual
.The solution is to transform datatype attributes simply as datatype properties that DO NOT specialize
gufo:hasQualityValue
.