Hi Vasiliy,
Am 20.07.2010 15:50, schrieb Vasiliy Faronov:
Bob Ferris wrote:
How can I make sure that the value of my counter concept is of the type
xsd:Integer? I think with the current definition:
co:count
rdf:type rdf:Property , owl:FunctionalProperty ;
rdfs:comment "Links a counter resource to the actual count"@en ;
rdfs:domain co:Counter ;
rdfs:isDefinedBy co: ;
rdfs:label "has count"@en ;
rdfs:range xsd:integer ;
vs:term_status "stable"@en .
it works.
Hmm. I may be mistaken here, but I think that's a wrong declaration.
The range of co:count is not xsd:integer, it's rdfs:Literal.
rdfs:Literal is the class, xsd:integer is a datatype (a special feature
of the rdfs:Literal class). In other words, you don't write:
"99" a xsd:integer .
but instead:
"99"^^xsd:integer a rdfs:Literal .
At least, the FOAF and SIOC ontologies specify rdfs:Literal as the range
of datatype properties.
If you have a look at the owl:DatatypeProperty example from the OWL
guide[1]:
<owl:DatatypeProperty rdf:ID="yearValue">
<rdfs:domain rdf:resource="#VintageYear" />
<rdfs:range rdf:resource="&xsd;positiveInteger"/>
</owl:DatatypeProperty>
I think, I can add owl:DatatypeProperty as rdf:type to co:count to make
this definition stronger, or?
Also note that you can't really "make sure" that the value is of the
right type, unless people use some kind of RDFS-driven validator, which
I guess isn't common.
Therefore, I include such range definition, to enable a user of my
ontology the opportunity to provide an automated check for that.
Cheers,
Bob
[1] http://www.w3.org/TR/2004/REC-owl-guide-20040210/#Datatypes1