I’m making an Ontology that describes programming languages, but I have the following problem: a language can have strong or weak typing, and I need to limit my schema to these two options… so, how can I do that?
Here’s a sample of my schema:
:Language a rdfs:Class .
:typing a rdf:Propery ;
rdfs:domain :Language ;
rdfs:range ? .
Thanks in advance.
I disagree with the answer posted by Eduardo Silva. A functional property can have only one value from the range of the function. It can be used multiple times, but an OWL reasoner can make some entailments from those triples. For example, if you have some individual
example:x1and a functional property:p, and you see in your data:then you are entitled to infer that
:fooand:barmust be the same individual, since otherwise the functional nature of:pwould be violated. Alternatively, if you know by some other means that:fooand:barare different individuals, then, given the two additional triples above, your OWL model is inconsistent.In other words, it would be fine to have two values for
test:typingon some resource, as long as you then entail that the two type schemes denoted are in fact the same. Which probably isn’t what you want. Moreover, there’s nothing to stop a triple store containing a new value fortest:typingwhich wasn’t mentioned in the original range description. For example:This is not inconsistent with
test:typingbeing a functional property.To restrict the range of a property to be one of a certain enumeration of values, what you actually want is an OWL enumerated class. For example:
The extension (set of admissible values) of an enumerated class is exactly the given collection of individuals. No others are allowed.