Re: Nullifying Values in Part7/8
Posted: Fri Jan 24, 2014 8:38 pm
@Onno
Not really small, but hopefully clarifying:
Not really small, but hopefully clarifying:
Code: Select all
<!-- Current indirect property in Part 8 representation with scale -->
<owl:Thing>
<rdf:type rdf:resource="&tpl;IndividualHasIndirectPropertywithValue"/>
<tpl:hasPossessor rdf:Resource="#MyDataObject"/>
<tpl:hasIndirectPropertyType rdf:resource="&rdl;SomeProperty"/>
<tpl:valPropertyValue rdf:datatype="&xsd;float">10.0</tpl:valPropertyValue>
<tpl:hasScale rdf:resource="&rdl;DegreesCelsius"/>
</owl:Thing>
<!-- option a : Use of empty strings to represent nulls
Notes:
- An empty string for a string property does not have the same meaning as null.
- A template role with a type of xsd:double or xsd:anyURI is not permitted to have an empty string as a value.
- The type associated with the roles would need to be relaxed to support plain literals or the current type
- for unit qualified values would both the value and scale need to be nullified???
-->
<owl:Thing>
<rdf:type rdf:resource="&tpl;IndividualHasIndirectPropertywithValue"/>
<tpl:hasPossessor rdf:Resource="#MyDataObject"/>
<tpl:hasIndirectPropertyType rdf:resource="&rdl;SomeProperty"/>
<tpl:valPropertyValue/> <!-- data type defaults to rdf:PlainLiteral, value is an empty string -->
<tpl:hasScale/> <!-- data type defaults to rdf:PlainLiteral, value is an empty string -->
</owl:Thing>
<!-- option b : new template for nulls -->
<owl:Thing>
<rdf:type rdf:resource="&tpl:NullProperty"/>
<tpl:hasPossessor rdf:Resource="#MyDataObject"/>
<tpl:hasPropertyType rdf:resource="&rdl;SomeProperty"/>
</owl:Thing>
<!-- option c : status of property on property templates
- Notes :
- Could the status roles be lists of status values so that status isn't limited to being one per property??
- Since the property can't be null it would have to be assigned a value even if the status was null
-->
<!-- single status option -->
<owl:Thing>
<rdf:type rdf:resource="&tpl;IndividualHasIndirectPropertywithValue"/>
<tpl:hasPossessor rdf:Resource="#MyDataObject"/>
<tpl:hasIndirectPropertyType rdf:resource="&rdl;SomeProperty"/>
<tpl:valPropertyValue rdf:datatype="&xsd;float">0.0</tpl:valPropertyValue>
<tpl:hasScale rdf:resource="&rdl;DegreesCelsius"/>
<tpl:hasStatus rdf:resource="&rdl;null"/>
</owl:Thing>
<!-- list of statuses option -->
<owl:Thing>
<rdf:type rdf:resource="&tpl;IndividualHasIndirectPropertywithValue"/>
<tpl:hasPossessor rdf:Resource="#MyDataObject"/>
<tpl:hasIndirectPropertyType rdf:resource="&rdl;SomeProperty"/>
<tpl:valPropertyValue rdf:datatype="&xsd;float">0.0</tpl:valPropertyValue>
<tpl:hasScale rdf:resource="&rdl;DegreesCelsius"/>
<tpl:hasStatuses rdf:parseType="Collection">
<rdf:Description rdf:about="&rdl;null"/>
<rdf:Description rdf:about="&rdl;Status1"/>
</tpl:hasStatuses
</owl:Thing>
<!-- option d : status of property in separate templates
- Note :
- Properties would have to be assigned identities so that they can be referenced from several templates
-->
<owl:Thing>
<rdf:type rdf:resource="&tpl;IndividualHasIndirectPropertywithValue"/>
<tpl:hasPossessor rdf:Resource="#MyDataObject"/>
<tpl:hasProperty rdf:Resource="#MyObjectsPropertyID"/>
<tpl:hasIndirectPropertyType rdf:resource="&rdl;SomeProperty"/>
<tpl:valPropertyValue rdf:datatype="&xsd;float">10.0</tpl:valPropertyValue>
<tpl:hasScale rdf:resource="&rdl;DegreesCelsius"/>
</owl:Thing>
<owl:Thing>
<rdf:type rdf:resource="&tpl:PropertyStatus"/>
<tpl:hasPossessor rdf:Resource="#MyDataObject"/>
<tpl:hasProperty rdf:Resource="#MyObjectsPropertyID"/>
<tpl:hasPropertyType rdf:resource="&rdl;SomeProperty"/>
<tpl:hasStatus rdf:resource="&rdl;null"/>
</owl:Thing>
<!-- option e : use of xsi:nil
- this is not valid RDF in the way that it is intended in xsi.
- the nil statement actually forces the creatoon of a blank node that has an xsi:nil predicate with a plainLiteral value
-->
<owl:Thing>
<rdf:type rdf:resource="&tpl;IndividualHasIndirectPropertywithValue"/>
<tpl:hasPossessor rdf:Resource="#MyDataObject"/>
<tpl:hasProperty rdf:Resource="#MyObjectsPropertyID"/>
<tpl:hasIndirectPropertyType rdf:resource="&rdl;SomeProperty"/>
<tpl:valPropertyValue xsi:nil="true"/>
<tpl:hasScale xsi:nil="true"/>
</owl:Thing>
this becomes the following when parsed :-
<owl:Thing>
<rdf:type rdf:resource="&tpl;IndividualHasIndirectPropertywithValue"/>
<tpl:hasPossessor rdf:Resource="#MyDataObject"/>
<tpl:hasProperty rdf:Resource="#MyObjectsPropertyID"/>
<tpl:hasIndirectPropertyType rdf:resource="&rdl;SomeProperty"/>
<tpl:valPropertyValue>
<rdf:Description>
<xsi:nil rdf:datatype="&rdf;PlainLiteral">true</xsi:nil>
</rdf:Description>
</tpl:valPropertyValue>
<tpl:hasScale xsi:nil="true">
<rdf:Description>
<xsi:nil rdf:datatype="&rdf;PlainLiteral">true</xsi:nil>
</rdf:Description>
</tpl:hasScale>
</owl:Thing>